Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/nsisodiya/langstring

LangString
https://github.com/nsisodiya/langstring

Last synced: 28 days ago
JSON representation

LangString

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 World

LangString.langCode = "de-DE";
console.log(str + ""); // Hallo Welt
```

# Demo
http://jsfiddle.net/nsisodiya/gguL9aax/