ilteoood/flutter_i18n

add delimiter of file_translation_loader

Closed this issue · 1 comments

Maybe can add custom separators in file_translation_loader, because when different countryCodes use _ splitting, the i18n-ally plugin will not display this language, and it is normal when using -splitting. Although I think this is a bug in i18n-ally, it is better that this flutter package supports customization

final String delimiter;
FileTranslationLoader(
      {this.fallbackFile = "en",
      this.delimiter = "_",
      this.basePath = "assets/flutter_i18n",
      this.useCountryCode = false,
      this.useScriptCode = false,
      forcedLocale,
      decodeStrategies})
@protected
  String _composeSuffixCode() {
    String countryCode = "";
    if (useScriptCode && locale!.scriptCode != null) {
      countryCode = "${countryCode}${delimiter}${locale!.scriptCode}";
    }
    if (useCountryCode && locale!.countryCode != null) {
      countryCode = "${countryCode}${delimiter}${locale!.countryCode}";
    }
    return countryCode;
  }

This should be fixed in version 0.36.0