瀏覽代碼

罗马尼亚语添加依赖

finlay 11 月之前
父節點
當前提交
5ea3513ad7
共有 3 個文件被更改,包括 8 次插入1 次删除
  1. 1 1
      lib/i18n.dart
  2. 1 0
      pubspec.yaml
  3. 6 0
      test/fisi18n_test.dart

+ 1 - 1
lib/i18n.dart

@@ -25,7 +25,7 @@ const Locale RUSSIAN_LOCALE = const Locale("ru", "RU");
 /// 西班牙语
 const Locale SPANISH_LOCALE = const Locale("es", "ES");
 
-/// 西班牙
+/// 罗马尼亚
 const Locale ROMANIA_LOCALE = const Locale("ro", "RO");
 
 AssetBundle _assetBundle = rootBundle;

+ 1 - 0
pubspec.yaml

@@ -33,6 +33,7 @@ flutter:
     - assets/zh_CN.json
     - assets/ru_RU.json
     - assets/es_ES.json
+    - assets/ro_RO.json
   # To add assets to your package, add an assets section, like this:
   # assets:
   #   - images/a_dot_burr.jpeg

+ 6 - 0
test/fisi18n_test.dart

@@ -28,6 +28,7 @@ void main() {
       FTrKeybookOption.EnglishOption,
       FTrKeybookOption.RussianOption,
       FTrKeybookOption.SpanishOption,
+      FTrKeybookOption.RomaniaOption,
     ];
     await FI18n.init((loacle) => {}, bookOptions);
   });
@@ -37,6 +38,7 @@ void main() {
     final enLocale = Locale("en", "US");
     final ruLocale = Locale("ru", "RU");
     final esLocal = Locale("es", "ES");
+    final roLocal = Locale("ro", "RO");
     await FI18n.load(curLocale);
     print(i18nBook.auth.login.t);
     print(i18nBook.common.versionNumber.translate(['1.2.11']));
@@ -52,6 +54,10 @@ void main() {
     print(" ***Locale change to $esLang *** ");
     print(i18nBook.auth.login.t);
     print(i18nBook.common.versionNumber.translate(['1.2.11']));
+     final roLang = await FI18n.ins.switchLanguage(roLocal);
+    print(" ***Locale change to $esLang *** ");
+    print(i18nBook.auth.login.t);
+    print(i18nBook.common.versionNumber.translate(['1.2.11']));
   });
   test('test - input value', () async {
     final curLocale = Locale("zh", "CN");