Fix double quotes escaping.
This commit is contained in:
@@ -10,18 +10,18 @@ class StringsLocalization {
|
|||||||
|
|
||||||
static Future load(String l) async {
|
static Future load(String l) async {
|
||||||
localeCode = l;
|
localeCode = l;
|
||||||
var document = xml.parse(await loadStrings(l));
|
await rootBundle.loadString('assets/values-$localeCode/strings.xml').then((content) {
|
||||||
|
content.replaceAll('=\"', '=\\"');
|
||||||
|
content.replaceAll('\">', '\\">"');
|
||||||
|
var document = xml.parse(content);
|
||||||
strings.clear();
|
strings.clear();
|
||||||
document.findAllElements('string').forEach((node) {
|
document.findAllElements('string').forEach((node) {
|
||||||
strings[node.attributes[0].value] = node.text.toString();
|
strings[node.attributes[0].value] = node.text.toString();
|
||||||
});
|
});
|
||||||
|
});
|
||||||
return strings;
|
return strings;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future<String> loadStrings(String locale) async {
|
|
||||||
return await rootBundle.loadString('assets/values-$locale/strings.xml');
|
|
||||||
}
|
|
||||||
|
|
||||||
static String declineCurrency(int num, int code) {
|
static String declineCurrency(int num, int code) {
|
||||||
int residual = num % 100;
|
int residual = num % 100;
|
||||||
if (residual >= 20) {
|
if (residual >= 20) {
|
||||||
|
|||||||
10
pubspec.lock
10
pubspec.lock
@@ -1,5 +1,5 @@
|
|||||||
# Generated by pub
|
# Generated by pub
|
||||||
# See http://pub.dartlang.org/doc/glossary.html#lockfile
|
# See https://www.dartlang.org/tools/pub/glossary#lockfile
|
||||||
packages:
|
packages:
|
||||||
async:
|
async:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
@@ -21,7 +21,7 @@ packages:
|
|||||||
name: collection
|
name: collection
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.14.5"
|
version: "1.14.6"
|
||||||
flutter:
|
flutter:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description: flutter
|
description: flutter
|
||||||
@@ -82,7 +82,7 @@ packages:
|
|||||||
name: petitparser
|
name: petitparser
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.7.5"
|
version: "1.7.6"
|
||||||
sky_engine:
|
sky_engine:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description: flutter
|
description: flutter
|
||||||
@@ -108,7 +108,7 @@ packages:
|
|||||||
name: sqflite
|
name: sqflite
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.8.2"
|
version: "0.8.3"
|
||||||
stack_trace:
|
stack_trace:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -150,6 +150,6 @@ packages:
|
|||||||
name: xml
|
name: xml
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.6.0"
|
version: "3.0.0"
|
||||||
sdks:
|
sdks:
|
||||||
dart: ">=2.0.0-dev.23.0 <=2.0.0-edge.0d5cf900b021bf5c9fa593ffa12b15bcd1cc5fe0"
|
dart: ">=2.0.0-dev.23.0 <=2.0.0-edge.0d5cf900b021bf5c9fa593ffa12b15bcd1cc5fe0"
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ dependencies:
|
|||||||
path_provider: "^0.2.1+1"
|
path_provider: "^0.2.1+1"
|
||||||
sqflite: any
|
sqflite: any
|
||||||
image_picker: '^0.1.3' # use for ask permissions @ iOS
|
image_picker: '^0.1.3' # use for ask permissions @ iOS
|
||||||
xml: "^2.6.0"
|
xml: "^3.0.0"
|
||||||
flutter:
|
flutter:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user