mirror of
https://bitbucket.org/FransoletThomas/tablet-app.git
synced 2025-12-06 08:31:19 +00:00
22 lines
697 B
Dart
22 lines
697 B
Dart
import 'package:manager_api/api.dart';
|
|
import 'package:tablet_app/Helpers/translations.dart';
|
|
import 'package:tablet_app/Models/tabletContext.dart';
|
|
|
|
class TranslationHelper {
|
|
static String get(List<TranslationDTO>? translationDTO, TabletAppContext tabletAppContext) {
|
|
try {
|
|
return translationDTO!.where((element) => element.language == tabletAppContext.language).first.value!;
|
|
} catch (_) {
|
|
return "";
|
|
}
|
|
}
|
|
|
|
static String getFromLocale(String valueToGet, TabletAppContext tabletAppContext) {
|
|
try {
|
|
return translations.where((element) => element.language == tabletAppContext.language).first.data![valueToGet]!;
|
|
} catch (_) {
|
|
return "";
|
|
}
|
|
}
|
|
}
|