Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nsisodiya/langstring
LangString
https://github.com/nsisodiya/langstring
Last synced: 28 days ago
JSON representation
LangString
- Host: GitHub
- URL: https://github.com/nsisodiya/langstring
- Owner: nsisodiya
- License: mit
- Created: 2015-05-17T17:41:28.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-05-17T18:45:32.000Z (over 9 years ago)
- Last Synced: 2024-04-14T07:51:21.080Z (8 months ago)
- Language: JavaScript
- Size: 141 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# LangString
LangString, the most simple way for javascript internationalization.# Syntax
```html
```
```js
LangString.dict = {
"en-US": {
"HELLO_WORLD": "Hello World"
},
"de-DE": {
"HELLO_WORLD": "Hallo Welt"
}
};var str = new LangString("HELLO_WORLD");
LangString.langCode = "en-US";
console.log(str + ""); // Hello World
document.getElementById("text").innerHTML = str; // Hello WorldLangString.langCode = "de-DE";
console.log(str + ""); // Hallo Welt
```# Demo
http://jsfiddle.net/nsisodiya/gguL9aax/