mirror of
https://github.com/immich-app/immich.git
synced 2025-05-23 17:03:01 -04:00
fix: translations from background service (#18473)
* fix: translations from background service * test: generate translation before running tests --------- Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
This commit is contained in:
parent
1b8fa51315
commit
15877ddf1f
5
.github/workflows/test.yml
vendored
5
.github/workflows/test.yml
vendored
@ -504,6 +504,11 @@ jobs:
|
||||
with:
|
||||
channel: 'stable'
|
||||
flutter-version-file: ./mobile/pubspec.yaml
|
||||
|
||||
- name: Generate translation file
|
||||
run: make translation
|
||||
working-directory: ./mobile
|
||||
|
||||
- name: Run tests
|
||||
working-directory: ./mobile
|
||||
run: flutter test -j 1
|
||||
|
@ -1,10 +1,10 @@
|
||||
// ignore_for_file: implementation_imports
|
||||
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:easy_localization/src/asset_loader.dart';
|
||||
import 'package:easy_localization/src/easy_localization_controller.dart';
|
||||
import 'package:easy_localization/src/localization.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:immich_mobile/constants/locales.dart';
|
||||
import 'package:immich_mobile/generated/codegen_loader.g.dart';
|
||||
|
||||
/// Workaround to manually load translations in another Isolate
|
||||
Future<bool> loadTranslations() async {
|
||||
@ -14,7 +14,7 @@ Future<bool> loadTranslations() async {
|
||||
supportedLocales: locales.values.toList(),
|
||||
useFallbackTranslations: true,
|
||||
saveLocale: true,
|
||||
assetLoader: const RootBundleAssetLoader(),
|
||||
assetLoader: const CodegenLoader(),
|
||||
path: translationsPath,
|
||||
useOnlyLangCode: false,
|
||||
onLoadError: (e) => debugPrint(e.toString()),
|
||||
|
Loading…
x
Reference in New Issue
Block a user