3.0.3 • Published 7 years ago
lang-converter-siva v3.0.3
Latest vertion <3.0.3>
What the module has ?
Basically module uses a ngx-translate and transalates given string.
Also has source ,which has a basic structure of how to create feature ngModule.
How to use it ?
npm install @ngx-translate/core -g --save
npm install @ngx-translate/http-loader -g --save
How to use/install this module ?
npm install lang-converter-siva
For now copy lang-converter-siva from node_modules directly into your project's app folder and add it to imports,to work perfect.
Include lang-converter-siva module in your App component
In Component to change language content.
In component using the lang-converter-siva Html file Usage : langName attribue should be passed. >> <div app-lang-converter [langName]="replaceLangProp" > </div> typescript file should pass this replaceLangProp param: >> replaceLangProp = { selectedLang:"en", strToConvert:"HOME.TITLE", replaceParam:["test","test2","test3"], replaceStr:["Replace done !","Replace done 2nd text!" ,"Replace done for 3rd text!"] }; selectedLang >> en -> stands for english (There should be en.json available in folder,same for other language you use) strToConvert >> HOME.TITLE -> Key available in Json file replaceParam >> ["test","test2","test3"] -> Refer HOME.TITLE of en.json in assets folder replaceStr >> ["Replace done !","Replace done 2nd text!" ,"Replace done for 3rd text!"] -> String to get replaced in place of {{test}} Ex: >> "Hello world {{test}} {{test2}} {{test3}}" >>> Hello World Replaced Done Replace done 2nd text! Replace done for 3rd text!
Next Release plan:
Will attach simple steps creating UMD Module for same.