Comments (3)
Did you set ignorePluralRules
to false
like this? By default the rules are ignored
return EasyLocalization(
supportedLocales: supportedLocales,
fallbackLocale: supportedLocales.first,
ignorePluralRules: false,
path: 'lib/localization',
);
from easy_localization.
Interesting... The documentation for that field is this:
/// Ignore usage of plural strings for languages that do not use plural rules.
/// @Default value false
/// Example:
/// ```
/// // Default behavior, use "zero" rule for 0 even if the language doesn't
/// // use it by default (e.g. "en"). If "zero" localization for that string
/// // doesn't exist, "other" is still used as fallback.
/// // "nTimes": "{count, plural, =0{never} =1{once} other{{count} times}}"
/// // Text(AppLocalizations.of(context)!.nTimes(_counter)),
/// // will print "never, once, 2 times" for ALL languages.
/// ignorePluralRules: true
/// // Use "zero" rule for 0 only if the language is set to do so (e.g. for
/// "lt" but not for "en").
/// // "nTimes": "{count, plural, =0{never} =1{once} other{{count} times}}"
/// // Text(AppLocalizations.of(context)!.nTimes(_counter)),
/// // will print "never, once, 2 times" ONLY for languages with plural rules.
/// ignorePluralRules: false
/// ```
final bool ignorePluralRules;
But the constructor is this:
EasyLocalization({
//...
this.ignorePluralRules = true,
//...
})
That does not make sense. I'll check that later again.
By the way @petodavid do you know if this flag breaks languages with multiple plural forms?
from easy_localization.
You should expect no braking change in case you handle the rule cases (ZERO, ONE, TWO, FEW, MANY, OTHER), this depends on the language and not all languages are using all theses cases. For example in English we have ONE and OTHER. Here you can find all the rules: Rules.
Rule for English is this:
PluralCase _en_rule() {
if (_i == 1 && _v == 0) {
return ONE;
}
return OTHER;
}
from easy_localization.
Related Issues (20)
- French translation Special Cahracters are not displayed correctly HOT 1
- How to set mutiple language for mutiple package in project?
- context.setLocale reverse to previous language with Easy localization HOT 1
- [Feature Request] ARB support for localization
- [Feature Request]: Support namespaces / multiple files per language
- resetLocal crashes if deviceLocale not in supportedLocales HOT 2
- ignore_for_file: constant_identifier_names when generate locale_keys.g.dart
- Localization not working on physical device
- strict countryCode problem HOT 2
- Can we generate locale keys in record form? HOT 12
- When using Icelandic (is), the automatically generated code conflicts with the keyword 'is'
- Changing system language does not effect HOT 1
- Using macros to generate the LocaleKeys? HOT 1
- Refresh Localization Upon Version Update from Remote Assets
- [Feature Request] need `path` can nullable when `extraAssetLoaders` isNotEmpty
- [Feature Request] need log warning on extraAssetLoaders' key if duplicate in addAllRecursive
- How to run golden tests with easy localization?
- web application not updated after change localization .
- Allow using your own logger
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from easy_localization.