mysociety / alaveteli

Provide a Freedom of Information request system for your jurisdiction
https://alaveteli.org
Other
387 stars 195 forks source link

Default gettext translation repos #5864

Open gbp opened 4 years ago

gbp commented 4 years ago

But default, the translations repos included in core are ./locale and ./locale_alaveteli_pro [1]. This is fine but in themes, via the alavetelitheme, these are overridden [2] to also include the themes locale directory but this doesn't include ./locale_alaveteli_pro by default. This causes the Pro translations to not be used.

We should either:

  1. add the ./locale_alaveteli_pro to alavetelitheme
  2. if possible, move knowledge of the theme locale repo loading into core and remove completely from the theme.

Also will require an upgrade note to add/remove the relevant lines in themes' ./lib/alavetelitheme.rb files.

[1] https://github.com/mysociety/alaveteli/blob/0.38.0.0/config/initializers/fast_gettext.rb#L4-L13 [2] https://github.com/mysociety/alavetelitheme/blob/use-with-alaveteli-0.38.0.0/lib/alavetelitheme.rb#L71-L76

garethrees commented 4 years ago
  1. add the ./locale_alaveteli_pro to alavetelitheme

We should do this anyway to fix the immediate issue right now, given its so easy.

  1. if possible, move knowledge of the theme locale repo loading into core and remove completely from the theme.

I think this is worth doing while we're thinking about it, as it reduces overall complexity in the application.

gbp commented 4 years ago

Made quick fix PR for MaDaDa https://github.com/okfnfr/dada-france-theme/pull/91

gbp commented 4 years ago

This was previously fixed for Transparencia https://github.com/mysociety/belgium-theme/commit/cdb383925