flutter_i18n
flutter_i18n copied to clipboard
Error in i18n.dart when using Indonesian locale
After adding an .arb file in Indonesian locale (which has the country code in), the plugin adds:
class in extends S {
const in();
}
to generated/i18n.dart file, which fails because in is a reserved keyword in the dart language. Since any changes to i18n.dart gets overridden immediately, right now it is impossible to use this plugin for Indonesian locale.
That's an unfortunate bug, and will most probably cause backward-compatibility issues if we add a prefix or suffix to the class names. I guess we have to add special checks for in
country code for now.
@umutseven92 are you able to submit a pr (Kotlin) to fix this bug?
@noordawod Sure, ill take a look as soon as a I am able.
@noordawod So I did some digging and turns out this problem also occurred with the Icelandic locale (the country code is in, another reserved keyword). Issue here. It was fixed on 0.2, however since my Intellij version is 2019.1, I can only download version 0.0.6, which is very old. Long story short, I cannot test if the issue persists or not in the latest version. I will come back to this after Issue 53 is solved.
I will release a recent version of the plugin for 2019.1 this week. Thanks for taking the time to check this, @umutseven92!
@noordawod Some part of your build pipeline seems to be broken. There has not been an update ever since you wrote that comment. I am currently forced to build the plugin locally and set "ideaVersionPrefix=191" manually in the gradle.properties.
@Lootwig Yes, unfortunately this plugin seems to be abandoned (at least for now). Meanwhile I switched to VSCode and am using this plugin.
@umutseven92 not entirely abandoned, mind you, but the maintainers occasionally need to attend to other important matters in life. In any case, the most recent plugin code is now pushed to JetBrains' repo -- it'll take few days for them to approve it.
@umutseven92 I am also switching to VSCode and I found the extension you mentionned.
The only "problem" is that it misses the option to create string values directly from code.
Also, you need to run the update command every time you add a string.
Actually, "in" is deprecated for Indonesian Locale. Locale "id" is more recent for Indonesian.
I found this on window.dart
// This map is generated by //flutter/tools/gen_locale.dart
// Mappings generated for language subtag registry as of 2019-02-27.
static const Map<String, String> _deprecatedLanguageSubtagMap = <String, String>{
'in': 'id', // Indonesian; deprecated 1989-01-01