i18n easy Implementation using jQuery (Github or NPM)
Note- this is very easy plugin for localization using jQuery. You need to spend only 5 minute to setup and ready to go.
- Download saral-i18n.js under js folder. or run -
npm i jquery_saral_i18n
- Paste this script file in your project directory (problily in "js" or "script" folder).
- Go to your html page wheere you want to impliment. add this script into
section.
- Go to your project directory and create a folder called "locale". and inside locale, create en.json. (you can copy the locale folder from this repo.
- Now download demo.html and see how attribute has beed added to catch the key. see uses section.
or you can call i18n_placeholder="key" for input placeholder.
<input type="text" i18n="buttonTxt" i18n_placeholder="inputPlchdr">
<input type="radio" checked i18n="localtion2">
<input type="button" i18n="location1">
<input type="checkbox" i18n="location2">
<button i18n="buttonTxt"></button>
<select>
<option selected i18n="location1"></option>
<option i18n="location2"></option>
</select>
<textarea i18n="divTxt" rows="4" cols="45"></textarea>
<div i18n="divTxt">text from english</div>
<span i18n="spanTxt">text from english</span>
<input type="radio" checked i18n="localtion2">
<input type="button" i18n="location1">
<input type="checkbox" i18n="location2">
<button i18n="buttonTxt"></button>
<select>
<option selected i18n="location1"></option>
<option i18n="location2"></option>
</select>
<textarea i18n="divTxt" rows="4" cols="45"></textarea>
<div i18n="divTxt">text from english</div>
<span i18n="spanTxt">text from english</span>
- Sudhir K Gupta
- Github
Note - If you think that something need to be change, feel free to send pull request. I will merge into master.