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
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use RTM plural list
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
  • Loading branch information
1pretz1 committed Dec 7, 2022
commit 5bbd87d9c2609fa01fd467a276c86f5176a4b65b
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -13,6 +13,7 @@ gem "plek"
gem "rack_strip_client_ip"
gem "rails-controller-testing"
gem "rails-i18n"
gem "rails_translation_manager"
gem "rss"
gem "sassc-rails"
gem "slimmer"
@@ -22,7 +23,6 @@ gem "uglifier"
group :development, :test do
gem "govuk_schemas"
gem "govuk_test"
gem "rails_translation_manager"
gem "rubocop-govuk"
end

1 change: 0 additions & 1 deletion config/locales/plurals.rb

This file was deleted.