iOS zxing scanner, iOS localization

This commit is contained in:
Ivan Murashov
2018-02-09 23:13:47 +03:00
parent 6068b7e3b2
commit 90bf053c7e
45 changed files with 348 additions and 314 deletions

View File

@@ -8,17 +8,15 @@ class StringsLocalization {
static String localeCode;
static Map<String, String> strings = new Map<String, String>();
static Future load(String locale) async {
localeCode = locale;
var document = xml.parse(await loadStrings(locale));
strings.clear();
document.findAllElements('string').forEach((node) {
strings[node.attributes[0].value] = node.text.toString();
});
return strings;
static Future load(String l) async {
localeCode = l;
var document = xml.parse(await loadStrings(l));
strings.clear();
document.findAllElements('string').forEach((node) {
print("${node.attributes} : ${node.text.toString()}");
strings[node.attributes[0].value] = node.text.toString();
});
return strings;
}
static Future<String> loadStrings(String locale) async {