-
-
Notifications
You must be signed in to change notification settings - Fork 279
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
feat: #2386 - added tests about localization parameters #2412
feat: #2386 - added tests about localization parameters #2412
Conversation
Impacted file: * `plural_translation_test.dart`: added tests about localization parameters; simplified
Not sure how we fail fil while having 0% translations: https://crowdin.com/project/openfoodfacts/fil ══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞════════════════════════════════════════════════════ |
… and tl Impacted file: * `plural_translation_test.dart`
I didn't understand either, I did double-check, and at least for this label it's exactly the same as in English. After investigations, it's because there's a specific way to deal with plurals in /// The integer part of [_n]
int _i = 0;
/// Number of visible fraction digits.
int _v = 0;
/// The visible fraction digits in n, with trailing zeros.
int _f = 0;
PluralCase _fil_rule() {
if (_v == 0 && (_i == 1 || _i == 2 || _i == 3) ||
_v == 0 && _i % 10 != 4 && _i % 10 != 6 && _i % 10 != 9 ||
_v != 0 && _f % 10 != 4 && _f % 10 != 6 && _f % 10 != 9) {
return ONE;
}
return OTHER;
} And my crazy int was |
══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞════════════════════════════════════════════════════ (ja) ══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞════════════════════════════════════════════════════ (uk) id |
Codecov Report
@@ Coverage Diff @@
## develop #2412 +/- ##
==========================================
- Coverage 8.86% 7.52% -1.34%
==========================================
Files 161 204 +43
Lines 6623 9769 +3146
==========================================
+ Hits 587 735 +148
- Misses 6036 9034 +2998
Continue to review full report at Codecov.
|
@teolemon For the record, you fixed |
); | ||
expect( | ||
appLocalizations.contact_form_body_android( | ||
crazyInt, '', '', '', '', ''), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This and the following with empfehlen strings doesn't necessarily assure that all of the variables are still valid in all languages. We should check if crazyInt is in it 6 times if there is a check for it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@M123-dev I don't agree with you: I test if each parameter is displayed. Good enough is good enough.
What you suggest would mean that in some cases, the translation tool mistakes a parameter for another, which is very unlikely.
Anyway, that test set is a start, and is open to evolution.
Impacted file:
plural_translation_test.dart
: added tests about localization parameters; simplifiedWhat
Fixes bug(s)