Ukrainian translation polished; localized remaining hardcoded UI strings
This commit is contained in:
1 parent
6b6a881c7a
commit
5e446207c6
52 files changed
+2543
-417
No files matched your search
@@ -1,6 +1,9 @@
|
||||
import '../utils/platform_info.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:flutter_foreground_task/flutter_foreground_task.dart';
|
||||
|
||||
import '../l10n/app_localizations.dart';
|
||||
import '../utils/platform_info.dart';
|
||||
|
||||
class BackgroundService {
|
||||
bool _initialized = false;
|
||||
|
||||
@@ -34,13 +37,25 @@ class BackgroundService {
|
||||
}
|
||||
final running = await FlutterForegroundTask.isRunningService;
|
||||
if (running) return;
|
||||
final l10n = await _loadLocalizations();
|
||||
await FlutterForegroundTask.startService(
|
||||
notificationTitle: 'MeshCore running',
|
||||
notificationText: 'Keeping BLE connected',
|
||||
notificationTitle: l10n.background_serviceTitle,
|
||||
notificationText: l10n.background_serviceText,
|
||||
callback: startCallback,
|
||||
);
|
||||
}
|
||||
|
||||
Future<AppLocalizations> _loadLocalizations() async {
|
||||
final supported = AppLocalizations.supportedLocales;
|
||||
final system =
|
||||
WidgetsBinding.instance.platformDispatcher.locale;
|
||||
final match = basicLocaleListResolution(
|
||||
<Locale>[system],
|
||||
supported,
|
||||
);
|
||||
return AppLocalizations.delegate.load(match);
|
||||
}
|
||||
|
||||
Future<void> stop() async {
|
||||
if (!PlatformInfo.isAndroid) return;
|
||||
final running = await FlutterForegroundTask.isRunningService;
|
||||
|
||||
Reference in new issue
Block a user