|
@@ -2,15 +2,24 @@ import 'dart:convert';
|
|
|
|
|
|
class MeasureLanguage {
|
|
|
static Map<String, dynamic> _map = {};
|
|
|
+ static bool _isLoad = false;
|
|
|
|
|
|
static void load(String mapJson) {
|
|
|
_map = jsonDecode(mapJson)["Language"];
|
|
|
+ _isLoad = true;
|
|
|
}
|
|
|
|
|
|
static String t(String code) {
|
|
|
if (_map.containsKey(code)) {
|
|
|
return _map[code]!;
|
|
|
} else {
|
|
|
+ if (!_isLoad) {
|
|
|
+ Future.delayed(const Duration(milliseconds: 200), () {
|
|
|
+ if (_map.containsKey(code)) {
|
|
|
+ return _map[code]!;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
return code;
|
|
|
}
|
|
|
}
|