Skip to content
/ L Public

Lightweight localization solution using JSON format

Notifications You must be signed in to change notification settings

srohde/L

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

L

Lightweight localization solution using JSON format

Usage

Create your locales in a JSON file e.g. locales.json:

{
  "brazil":{
    "br": "Brasil",
    "de": "Brasilien",
    "en": "Brazil"
  },
  "greeting":{
    "br": "Oi {0}.",
    "de": "Hallo {0}.",
    "en": "Hello {0}."
  }
}

Syntax in CoffeeScript

L.changeLocale "en"
L.initFile "locales.json", ->
  console.log L.get("brazil") # will output "Brazil"
  console.log L.get("greeting", "Dude") # will output "Hello Dude."

Tests

Unit tests are build on top of Mocha and should:

$ make test

Docs

Docs are generated using docco and Pygments.

$ sudo easy_install Pygments
$ make docs

License

Apache License 2

About

Lightweight localization solution using JSON format

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published