https://github.com/yasinkuyu/localizationjs
Create multi-language structure with Javascript
https://github.com/yasinkuyu/localizationjs
i18n localization multilingual
Last synced: about 1 year ago
JSON representation
Create multi-language structure with Javascript
- Host: GitHub
- URL: https://github.com/yasinkuyu/localizationjs
- Owner: yasinkuyu
- License: mit
- Created: 2015-11-13T14:58:40.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-11-18T12:58:28.000Z (over 10 years ago)
- Last Synced: 2025-04-17T06:55:31.102Z (about 1 year ago)
- Topics: i18n, localization, multilingual
- Language: JavaScript
- Homepage:
- Size: 37.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## LocalizationJs
LocalizationJs is (native) Javascript base Localization library. Dynamically can define an unlimited number of languages.
### Install
bower install localization-js
###Simple Usage
//
// Define language elements
var locales = {
"tr_TR": {
"homepage": "Anasayfa",
"info": "Bilgi",
"help": "Yardım"
},
"en_US": {
"homepage": "Homepage",
"info": "Info",
"help": "Help"
}
};
var loc = new Localization();
loc.setLang("tr_TR"); //default
loc.set(locales);
console.log(loc.get("homepage"));
###Dynamically
"tr_TR": {
"homepage": "Anasayfa",
"info": "Bilgi",
"help": "Yardım"
},
"en_US": {
"homepage": "Homepage",
"info": "Info",
"help": "Help",
....
},
"en_GB": {},
"en_NZ": {},
"ar_EG: {}
-> loc.setLang("ar_EG");
###Language Codes
https://msdn.microsoft.com/en-us/library/ms533052(v=vs.85).aspx
###RTL Support (Right to Left)
"ar_EG": {
"rtl": true,
...
}
if(loc.get("rtl"))
{
console.log("Right to left language");
}
##Contribution
Fork & Pull Request
###License
The MIT License
Create multi-language structure with ASP.NET MVC
https://github.com/yasinkuyu/Localization
Created 2015 Yasin Kuyu - @yasinkuyu