Skip to content
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

Bump Rails Translation Manager and use new plural file #2621

Merged
merged 3 commits into from
Dec 8, 2022
Merged

Conversation

1pretz1
Copy link
Contributor

@1pretz1 1pretz1 commented Dec 6, 2022

We're now using the extra plural rules defined by RTM as a prod
dependency 1. This will replace the list defined in govuk_app_config
and so the reference has also been removed. RTM's version loads
automatically 2 and so we don't have to explicitly include the file in
the app.

Testing locally on a production rails server:

Fetching from plural file 1:

[6] pry(#<ContentItemsController>)> plural_form = I18n.with_locale("cy") { I18n.t!("i18n.plural.keys") }.sort
=> [:few, :many, :one, :other, :two, :zero]
[7] pry(#<ContentItemsController>)> plural_form = I18n.with_locale("zh") { I18n.t!("i18n.plural.keys") }.sort
=> [:other]
[8] pry(#<ContentItemsController>)> plural_form = I18n.with_locale("dr") { I18n.t!("i18n.plural.keys") }.sort
=> [:one, :other]

Fetching from the default store (rails-i18n) 3:

[11] pry(#<ContentItemsController>)> plural_form = I18n.with_locale("ar") { I18n.t!("i18n.plural.keys") }.sort
=> [:few, :many, :one, :other, :two, :zero]

⚠️ This repo is Continuously Deployed: make sure you follow the guidance ⚠️

Follow these steps if you are doing a Rails upgrade.

@govuk-ci govuk-ci temporarily deployed to government-frontend-pr-2621 December 6, 2022 13:10 Inactive
@govuk-ci govuk-ci temporarily deployed to government-frontend-pr-2621 December 7, 2022 12:19 Inactive
We're now using the extra plural rules defined by RTM as a prod
dependency [1]. This will replace the list defined in govuk_app_config
and so the reference has also been removed. RTM's version loads
automatically [2] and so we don't have to explicitly include the file in
the app.

Testing locally on a production rails server:

Fetching from plural file [1]:
```
[6] pry(#<ContentItemsController>)> plural_form = I18n.with_locale("cy") { I18n.t!("i18n.plural.keys") }.sort
=> [:few, :many, :one, :other, :two, :zero]
[7] pry(#<ContentItemsController>)> plural_form = I18n.with_locale("zh") { I18n.t!("i18n.plural.keys") }.sort
=> [:other]
[8] pry(#<ContentItemsController>)> plural_form = I18n.with_locale("dr") { I18n.t!("i18n.plural.keys") }.sort
=> [:one, :other]
```

Fetching from the default store (rails-i18n) [3]:
```
[11] pry(#<ContentItemsController>)> plural_form = I18n.with_locale("ar") { I18n.t!("i18n.plural.keys") }.sort
=> [:few, :many, :one, :other, :two, :zero]
```

[1]: https://github.com/alphagov/rails_translation_manager/blob/main/config/locales/plurals.rb
[2]: https://github.com/alphagov/rails_translation_manager/blob/f18fd2e178719dd0a103981160f898771957fa43/lib/rails_translation_manager.rb#L24
[3]: https://github.com/svenfuchs/rails-i18n/blob/ad26c50e1fea0eac2c9b85815f2c051f33a78045/rails/pluralization/ar.rb
Fix failing locales tests - Chinese (Taiwan / HK) solely uses 'other' as
its only plural form.
@govuk-ci govuk-ci temporarily deployed to government-frontend-pr-2621 December 7, 2022 16:14 Inactive
Copy link
Contributor

@KludgeKML KludgeKML left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@1pretz1 1pretz1 merged commit 0facb22 into main Dec 8, 2022
@1pretz1 1pretz1 deleted the bump-rtm-1-6-1 branch December 8, 2022 11:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants