feat(i18n): add ICU parser

This commit is contained in:
2023-02-27 17:42:22 +01:00
parent 8a37aec127
commit 75f561a19e
9 changed files with 413 additions and 26 deletions
+23 -7
View File
@@ -43,14 +43,30 @@ class App extends StatelessWidget {
// test
const I18nDataSource dataSource = AssetsFileDataSourceImpl();
const I18nRepository repository =
I18RepositoryImpl(dataSource: dataSource);
final test = (await repository.load('en')).ok;
final I18nRepository repository =
I18nRepositoryImpl(dataSource: dataSource);
print(test?.locale);
print(test?.data);
print(test?.data['btnAddFile']);
final test1 = (await repository.load(locale: 'en')).ok;
// final test2 = (await repository.loadFrom(
// Uri.parse('assets/i18n.en.yaml'),
// parser: const YamlParser(),
// ))
// .ok;
// print(test1?.locale);
// print(test1?.data);
// print(test1?.data['btnAddFile']);
final text = repository.get('youHavePushed', {
'count': 8,
});
print(text.ok);
// print(test2?.locale);
// print(test2?.data);
// print(test2?.data['btnAddFile']);
return 'test';
}),