i18n-message
v1.0.1
Published
Converting message.properties into json object
Downloads
9
Readme
i18n-message
Node.js module for processing .strings/.properties files used for localization
Installing with npm
npm install i18n-message
Usage
i18n-message can be used to read a .properties file and parse it into an object.
Note that specifying an encoding is optional. If an encoding is not specified, UTF-16 will be used as recommended by Apple. It's important to understand the encoding of the file being read/written and make sure it's specified properly (if it's something other than UTF-16).
#sample properties file
default.username.label = Username
// Include i18n-strings-files
const i18n = require('i18n-message');
const message = i18n('i18n/message.properties')
console.log(message.default.username.label);
// output: Username