Skip to content
asr2js and js2asr converter android string resource utils
JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
test
.editorconfig
.eslintrc
.gitignore
.travis.yml
README.md
asr2js.js
index.js
js2asr.js
package.json

README.md

travis npm

Download

The source is available for download from GitHub. Alternatively, you can install using npm:

npm install --save android-string-resource

You can then require() android-string-resource as normal:

const android-string-resource = require('android-string-resource');

Or you can direclty require() its functions:

const asr2js = require('android-string-resource/asr2js');

Usage

const xml = `<resources>
  <string name="key1">Hello</string>
  <string name="key2">An application to manipulate and process asr documents</string>
  <string name="key.nested">asr Data Manager</string>
</resources>`;

const js = {
  "key1": "Hello",
  "key2": "An application to manipulate and process asr documents",
  "key.nested": "asr Data Manager"
};

const asr2js = require('android-string-resource/asr2js');
asr2js(xml, (err, res) => {
  // res is like js
});

const js2asr = require('android-string-resource/js2asr');
js2asr(js, (err, res) => {
  // res is like xml
});
You can’t perform that action at this time.