17 lines
404 B
Dart
17 lines
404 B
Dart
import 'package:aitrainer_app/util/app_localization.dart';
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
mixin Trans {
|
|
late BuildContext context;
|
|
void setContext(BuildContext context) {
|
|
this.context = context;
|
|
}
|
|
|
|
String t(String text) {
|
|
if (context == null) {
|
|
throw Exception("Translation: initialize the context");
|
|
}
|
|
return AppLocalizations.of(context)!.translate(text);
|
|
}
|
|
}
|