-
Notifications
You must be signed in to change notification settings - Fork 264
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
Inability to Ignore Specific Pluralization Keys in Arabic Translations #600
Comments
I do not think this is supported today, and adding ignores for each full key seems hard to maintain. Now base_locale: en
locales: [en, ar] to something like: locales:
en:
base: true
plural_keys:
- one
- other
ar:
plural_keys:
- zero
- two
- few
- many Could this be useful for your changes @markedmondson? What do you think @glebm ? |
Sounds good to me, and perhaps we use the defaults from here https://github.com/svenfuchs/rails-i18n/blob/master/lib/rails_i18n/pluralization.rb and https://github.com/svenfuchs/rails-i18n/tree/master/lib/rails_i18n/common_pluralizations (per locale definitions are here: https://github.com/svenfuchs/rails-i18n/tree/master/rails/pluralization) |
Is this purely for a workaround for the bug noted? Can't you configure this using wildcards and per locale settings, eg: ignore_missing:
ar:
- *.zero
- *.two
- *.few
- *.many I don't think this impacts the translator pluralization changes I made, however. |
Apparently not, or I did not get the suggestion
I've provided a reproducible test case here: https://github.com/diowa/ruby3-rails7-bootstrap-heroku/tree/tmp/i18n-tasks-600 Before posting, I've also tried
but after (briefly) reading the code, it seems that pluralization follows different rules, and I still get:
|
Apologies, those values need stringifying: ignore_missing:
ar:
- '*.zero'
- '*.two'
- '*.few'
- '*.many' |
Apologies on my behalf too, I've also tried that, but I forgot to report it. There are no syntax errors, but the result does not change Here it is: diff --git a/config/i18n-tasks.yml b/config/i18n-tasks.yml
index b48d6a6..ba966f4 100644
--- a/config/i18n-tasks.yml
+++ b/config/i18n-tasks.yml
@@ -137,7 +137,12 @@ search:
# # Keep in mind the context of all the strings for a more accurate translation.
## Do not consider these keys missing:
-# ignore_missing:
+ignore_missing:
+ ar:
+ - '*.zero'
+ - '*.two'
+ - '*.few'
+ - '*.many'
# - 'errors.messages.{accepted,blank,invalid,too_short,too_long}'
# - '{devise,simple_form}.*'
|
Ah, this is supported in my PR in https://github.com/glebm/i18n-tasks/pull/596/files#diff-3a91d9f9d36a17731fb2e6a43d064bbd3d16867bd2bab2c1627eaf30defd0267R120 Although I noticed I should be passing the locale in - will add that change. (Edit: Done in e804c6a) HOWEVER, that said, it only checks the base key and not the plural key, which I guess makes sense. We could add support for checking the plural key in my PR relatively simply though if that's acceptable...
|
Hello,
I am opening this issue because I did not find an existing solution or workaround. If this turns out to be a duplicate or addressed elsewhere (e.g., in the documentation), I apologize in advance. This is not a duplicate of #582 as far as I can tell
Problem Description
We are using Weblate for our translations, and due to Weblate issue #4484, we only utilize the
one
andother
pluralization keys for our strings. However, when runningi18n-tasks health
, we receive warnings about missing pluralization keys (such aszero, two, few, and many
) specifically for Arabic.For example:
Currently, we are using ignore_missing to suppress these warnings, but this results in ignoring the entire
document_search.documents_found
key, which is not ideal. We would like to be able to ignore only specific pluralization keys (e.g., zero, two, few, many), while still maintaining checks for one and other.Request
Is there a way to configure i18n-tasks to ignore only specific pluralization keys (such as zero, two, few, and many), without having to exclude the entire key?
Thank you for your attention, and I look forward to any guidance you can provide.
The text was updated successfully, but these errors were encountered: