I need to support Locale for Serbian language that has both Cyrilic and Latin scriptCode, and therefore locales look like this:
Locale.fromSubtags(languageCode: 'sr', scriptCode: 'Cyrl', countryCode: 'RS')
Locale.fromSubtags(languageCode: 'sr', scriptCode: 'Latn', countryCode: 'RS')
And due to this requirement I have 2 JSON files for Serbian:
But unfortunately plugin just gives me error "Unable to load asset "lang/sr-RS.json"
How can I include support for scriptCode into my locale using this plugin?
App Store just released support for several contries including Serbia, so I assume a lot of iOS developers will now start supporting this language and will need this plugin to do so.
@LugonjaAleksandar easy_localization doesn鈥檛 support scriptCode yet, today I鈥檒l do PR. Can you translate in the example locales?
@Overman775 I've managed to do a workaround for now, just to continue with the development by adding this code:
EasyLocalization(
child: MyApp(),
useOnlyLangCode: false,
fallbackLocale: Locale('sr_Cyrl', 'RS'),
supportedLocales: [
Locale('sr_Cyrl', 'RS'),
Locale('sr_Latn', 'RS'),
Locale('en', 'US'),
],
path: 'lang',
)
Problem with this approach is that it doesn't work and throws errors below in main class when I provide locale and supportedLocales from this library for MaterialApp to consume.
I/flutter (19222): 鈺愨晲鈺愨晲鈺愨晲鈺愨晲
I/flutter (19222): Warning: This application's locale, sr_Cyrl_RS, is not supported by all of its
I/flutter (19222): localization delegates.
I/flutter (19222): > A MaterialLocalizations delegate that supports the sr_Cyrl_RS locale was not found.
I/flutter (19222): See https://flutter.dev/tutorials/internationalization/ for more
I/flutter (19222): information about configuring an app's locale, supportedLocales,
I/flutter (19222): and localizationsDelegates parameters.
I/flutter (19222): 鈺愨晲鈺愨晲鈺愨晲鈺愨晲
@LugonjaAleksandar @aissat fixed #136
@LugonjaAleksandar
dependencies:
easy_localization: ^2.2.0-dev
This works perfectly now, and all localisation delegates are recognising the format specified. Just for the reference if someone has the same issue, file names should be sr-Cyrl-RS.json and sr-Latn-RS.json.
When can we expect official release of this fix?