Lovely.IO

The Next Generation of Front-Side

Package Info

Links
Size
922 Bytes (gzipped)
Tags
i18n, internationalisation, language, translation
Author
Simon Rodwell
License
MIT
Versions
CDN Links
Dependencies
  • None

i18n

A simple utility to help with the internationalisation of lovely.io projects.

It works by loading a language file that is specified in JSON

It has the following features:

Usage

Install it locally with lovely install i18n or hook up from http://cdn.lovely.io

Lovely(['i18n'], function(i18n) {
  i18n.setLanguage("en", function(){
      console.log(i18n._("Hello World"))
  })
});

Example Language Files

English

{
  "values":[
    ["Hello World", "Hello World"],
    ["Yes", "Yes"],
    ["No", "No"]
  ]
}

Japanese

{
  "values":[
    ["Hello World", "今日は世界"],
    ["Yes", "はい"],
    ["No", "いいえ"],
  ]
}

Language files demonstrating more complex functionality can be downloaded here:

Copyright And License

This project is released under the terms of the MIT license

Copyright (C) 2013 Simon Rodwell