cordova-plugin-localization-strings
Advanced tools
Comparing version 4.1.3 to 4.2.0
{ | ||
"name": "cordova-plugin-localization-strings", | ||
"version": "4.1.3", | ||
"description": "Cordova Plugin for handling localization strings on InfoPlist.strings and Localizable.strings on iOS, strings.xml on Android", | ||
"keywords": [ | ||
"ecosystem:cordova", | ||
"cordova-android", | ||
"cordova-ios", | ||
"i18n", | ||
"internationalization", | ||
"l10n", | ||
"localization", | ||
"strings.xml", | ||
"InfoPlist.strings", | ||
"Localizable.strings" | ||
], | ||
"homepage": "https://github.com/kelvinhokk/cordova-plugin-localization-strings.git", | ||
"bugs": { | ||
"url": "https://github.com/kelvinhokk/cordova-plugin-localization-strings.git/issues" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/kelvinhokk/cordova-plugin-localization-strings.git" | ||
}, | ||
"license": "MIT", | ||
"dependencies": { | ||
"glob": "^7.2.0", | ||
"mkdirp": "^1.0.4", | ||
"underscore": "^1.13.2", | ||
"xcode": "^3.0.1", | ||
"xml2js": "^0.4.23" | ||
}, | ||
"engines": { | ||
"cordovaDependencies": { | ||
"4.0.0": { | ||
"cordova": ">=6.1.0" | ||
} | ||
}, | ||
"node": ">=10" | ||
} | ||
"name": "cordova-plugin-localization-strings", | ||
"version": "4.2.0", | ||
"description": "Cordova Plugin for handling localization strings on InfoPlist.strings and Localizable.strings on iOS, strings.xml on Android", | ||
"keywords": [ | ||
"ecosystem:cordova", | ||
"cordova-android", | ||
"cordova-ios", | ||
"i18n", | ||
"internationalization", | ||
"l10n", | ||
"localization", | ||
"strings.xml", | ||
"InfoPlist.strings", | ||
"Localizable.strings" | ||
], | ||
"homepage": "https://github.com/kelvinhokk/cordova-plugin-localization-strings.git", | ||
"bugs": { | ||
"url": "https://github.com/kelvinhokk/cordova-plugin-localization-strings.git/issues" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/kelvinhokk/cordova-plugin-localization-strings.git" | ||
}, | ||
"license": "MIT", | ||
"dependencies": { | ||
"glob": "^7.2.0", | ||
"mkdirp": "^1.0.4", | ||
"underscore": "^1.13.2", | ||
"xcode": "^3.0.1", | ||
"xml2js": "^0.4.23" | ||
}, | ||
"engines": { | ||
"cordovaDependencies": { | ||
"4.0.0": { | ||
"cordova": ">=6.1.0" | ||
} | ||
}, | ||
"node": ">=10" | ||
} | ||
} |
@@ -166,2 +166,20 @@ # Cordova Localization Strings Plugin | ||
### iOS Settings localizations | ||
This plugin can localizae iOS Settings bundles. | ||
Example usage: | ||
```json | ||
{ | ||
"settings_ios": { | ||
"Root": { | ||
"App version": "App version" | ||
} | ||
} | ||
} | ||
``` | ||
In the example shown, it would create a file such as "platforms/ios/<app name>/Resources/Settings.bundle/<language>.lproj/Root.strings" with | ||
the expected localizations for that language. | ||
### Push notifications messages | ||
@@ -168,0 +186,0 @@ |
@@ -48,4 +48,4 @@ var fs = require('fs'); | ||
function writeStringFile(plistStringJsonObj, lang, fileName) { | ||
var lProjPath = getTargetIosDir() + '/Resources/' + lang + '.lproj'; | ||
function writeStringFile(plistStringJsonObj, lang, fileName, bundle) { | ||
var lProjPath = getTargetIosDir() + "/Resources/" + (bundle ? bundle + "/" : "") + lang + ".lproj"; | ||
mkdirp(lProjPath).then(function () { | ||
@@ -84,2 +84,3 @@ var stringToWrite = jsonToDotStrings(plistStringJsonObj); | ||
var localizableStringsPaths = []; | ||
var settingsBundlePaths = []; | ||
@@ -128,2 +129,18 @@ return getTargetLang(context).then(function (languages) { | ||
} | ||
// to create Settings.bundle localizations | ||
if (_.has(langJson, "settings_ios")) { | ||
var localizableSettingsJson = langJson.settings_ios; | ||
if (!_.isEmpty(localizableSettingsJson)) { | ||
_.each(localizableSettingsJson, function (value, key) { | ||
var settingsFileName = key + ".strings"; | ||
var localizableSettingsStringsRoot = value; | ||
if (!_.isEmpty(localizableSettingsStringsRoot)) { | ||
writeStringFile(localizableSettingsStringsRoot, localeLang, settingsFileName, "Settings.bundle"); | ||
settingsBundlePaths.push("Settings.bundle" + localeLang + ".lproj/" + settingsFileName); | ||
} | ||
}); | ||
} | ||
} | ||
}); | ||
@@ -130,0 +147,0 @@ }); |
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
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
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
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
27384
384
258