cordova-plugin-localization-strings
Advanced tools
Comparing version 4.0.1 to 4.1.1
{ | ||
"name": "cordova-plugin-localization-strings", | ||
"version": "4.0.1", | ||
"version": "4.1.1", | ||
"description": "Cordova Plugin for handling localization strings on InfoPlist.strings and Localizable.strings on iOS, strings.xml on Android", | ||
@@ -34,4 +34,9 @@ "keywords": [ | ||
"engines": { | ||
"cordovaDependencies": { | ||
"4.0.0": { | ||
"cordova": ">=6.1.0" | ||
} | ||
}, | ||
"node": ">=10" | ||
} | ||
} | ||
} |
@@ -126,5 +126,5 @@ # Cordova Localization String Plugin | ||
This plugin relies on node >= 5.0.0, cordova >= 6.0.0. | ||
This plugin relies on node >= 10 for some of its dependencies, and cordova >= 6.1.0. | ||
Do remember to install the other dependencies via the --fetch when installing the plugin. | ||
Do remember to install these dependencies too via the `--fetch` when installing the plugin. | ||
@@ -131,0 +131,0 @@ ## Use Cases |
@@ -143,3 +143,4 @@ var fs = require('fs'); | ||
var resPath = getResPath(context); | ||
return path.normalize(path.join(resPath, 'values' + (lang !== 'en' ? '-' + lang : ''), 'strings.xml')); | ||
var defaultLocale = getDefaultLocale(); | ||
return path.normalize(path.join(resPath, 'values' + (lang !== defaultLocale ? '-' + lang : ''), 'strings.xml')); | ||
} | ||
@@ -152,2 +153,8 @@ | ||
function getDefaultLocale() { | ||
var config = fs.readFileSync('config.xml').toString(); | ||
var matches = config.match(new RegExp('<widget[^>]*?defaultlocale="(.*?)"[\\s\\S]*?>', 'i')); | ||
return (matches && matches[1]) || 'en'; | ||
} | ||
// process the modified xml and write to file | ||
@@ -154,0 +161,0 @@ function processResult(context, lang, langJson, stringXmlJson) { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
25361
366