-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add plurals dropped from rails-i18n in 7.0.6 #49
Conversation
The 7.0.6 release of rails-i18n dropped support for a number of plurals [1] and this causes our apps that make use of these languages to error and thus be unable to update to rails-i18n 7.0.6 This commit ports over these rules from rails-i18n to maintain the behaviour. This update follows what was added into govuk_app_config [2] [1]: svenfuchs/rails-i18n#1017 [2]: alphagov/govuk_app_config#266
I assume we need Maltese (mt) and Chinese (zt) too. I'm a bit worried about this file as it's already out of sync with govuk_app_config and will error on some of them: rails_translation_manager/config/locales/plurals.rb Lines 60 to 63 in 6a7d153
|
ah ok I'll add those in too - it was only cy that I needed for Frontend |
As to the relevance of the plural rules file in Rail Translation Manager - IRC the original plan was to replace the plural file in govuk-app-config with this one as apps that use translations, should also include RTM but the work paused prematurely, due to the re-org of teams. We should probably continue with that plan, or point RTM to the file in govuk-app-config so we have one source of truth. |
ah c*** sorry I forgot to update the CHANGELOG as well |
Sure, is there any plan to do anything on it in the next 3-6 months? If not, and if it's not something on navigation and personalisation's radar, it's probably best to just delete this for now. It doesn't seem to serve a functional purpose and doesn't seem like something that would be difficult to restore if/when the plan gets re-spun up - whereas it'll be confusing and debty the whole time it exists in two places. |
Agreed. It wasn't on my radar but happy to take it on (have some spare time tomorrow). Sorry it was left in this state, there were quite a few things left to finish when the team disbanded, believe some follow up / clean up cards were made. |
Sorry is the consensus that we should remove plurals from govuk_app_config? |
I think that's a better solution for a few reasons:
Do we agree? |
@1pretz1 just to be clear, you're saying removing |
My suggestion would be to remove the plurals file defined in govuk_app_config and update the frontend apps to use RTM's version. Don't think it matters too much but think using RTM's version is cleaner. |
@1pretz1 the config in the frontend apps was the missing ingredient!!! So switching it in the frontend apps should happen first really |
We also need all apps to start using RTM in all environments, as nearly are flagged as development gems at all: Which is what through me before as I couldn't understand how the file would be used. I'm of the view that if someone is genuinely going to work on killing it GovukAppConfig and changing over in the next few weeks or so then leave this file and go for it. If it's a we should do this, lets put it on the backlog then we should kill this plurals file until that day comes. |
Right I'll raise a PR to remove from here first... |
Yep, I imagine the sequence to be:
I had a few moments so have started step 1: #51, also tested this against a frontend app and all works fine. +1 to Kev's comment about moving the Gem out of the dev group for the frontend apps. I'm happy to carry this work forward as feel motivated to do so 😄 |
OK go for it @1pretz1 and ping me to help with this |
I'm assuming the plurals.rb file gets auto loaded and doesn't need a wrapper class? not sure though, I assumed placing it in config was for it to be autoloaded as part of Rails initialisation, otherwise would presumably be a file in lib |
Hmm, I assumed not as the config file isn't part of the apps config, rather the gems and it isn't explicitly required (simple Ruby app). However, I'm not sure so I'll verify your point. |
It looks like this does it: rails_translation_manager/lib/rails_translation_manager.rb Lines 25 to 29 in 5431893
I gave it a spin locally and can see that file gets executed. What I imagine happens is that GovukAppConfig ones override these. |
Ah okay, thanks for checking! Class wrapper may not be needed then. |
The 7.0.6 release of rails-i18n dropped support for a number of plurals 1 and this causes our apps that make use of these languages to error and thus be unable to update to rails-i18n 7.0.6
This commit ports over these rules from rails-i18n to maintain the behaviour.
This update follows what was added into govuk_app_config 2