This package offers you:
- Create .json language source files by given languages (through configuration .resxprocessor)
- Generate .json source files for languages with not specified resources (inherits resources from default language)
- Remove outdated keys from .json source files (keys which does not exists in main lang file anymore)
- Generate dist resources output based on sources ([name].[lang].js)
resxprocessor uses a number of open source projects to work properly:
- Inquirer.js - A collection of common interactive command line user interfaces.
- commander.js - node.js command-line interfaces made easy.
- colors.js - get colors in your node.js console.
resxprocessor requires Node.js v6+ to run.
$ npm install resxprocessor -g
-
Create config file at the very same folder as you going to use this package.
-
Give it a name
.resxprocessor
Configuration keys:
"tabSize": [number] - indent config (number of spaces in one tab) "srcFolder": [string] - folder to store/process src (.json) files "distFolder": [string] - folder to store/process dist (.js) files "resxPrefix": [string] - this prefix will be added to dist files names (like test[Prefix].[language].js) "jsNamespace": [string] - namespace for generated dist resources (generated obj will be applied to this namespace) "languages": Array[string] - list of languages to work with, "defaultLang": [string] - default language from the list you specified in "languages section" "currentLangNS": [string] - current language will be taken from this namespace
Configuration example:
{ "tabSize" : 4, "srcFolder" : "./resxSrc/", "distFolder" : "./resxDist/", "resxPrefix" : "Resx", "jsNamespace" : "ep.resources", "tsGlobInterface" : "EPResources", "languages" : [ "en", "ru", "de", "fr", "es", "it", "pl", "sk", "tr" ], "defaultLang" : "en", "currentLangNS": "ep.resxCulture" }
Be sure to run it on the same lavel as your config (.resxprocessor) is luying on.
- To use it in interactive mode execute:
$ resxprocessor
- To use it like "DO EVERYTHING GOOD" execute:
$ resxprocessor -d
if u run it in "DO EVERYTHING GOOD" mode you must take care of addition json source files and its content, lib only regenerates/sanitezes/sorts your src/dist files.
MIT