This plugin allows apps to present localised content to users according to the language / locale settings on their device.
Stable on Android and iOS.
The API reference is here.
To use the plugin, create a _locales
directory within your web assets directory. Inside this, create a directory for each locale for which you can supply translations. See the API reference above for the format of the files to place in those directories, and for the documentation of functions in the chrome.i18n namespace.
This plugin can be used by Apache Cordova applications, but some of the automated installation steps must be done manually:
- The specific locale directories within
CCA_locales
must be lower-cased, with an underscores separating the country code from the language code, if it is present. For example,en
anden_us
will be read as locale directories, buten-us
,en_US
anden-US
will not.
- On iOS, placeholders within manifest.json and .css files are not replaced (if you want this, file an issue!)
- Renamed plugin to pubilsh to NPM
CCA_locales
->_locales
now that we build with gradle- Now works better in CADT (but paths need to be lower-case and use
_
s rather than-
s)
- Improved performance of CSS substitutions
- Fix to work with non-
file:///android_asset
start URLs
- Change from using okhttp's Base64 to Android's Base64
- Documentation updates.
- Fix incorrect file: URL building in ChromeI18n.java