Skip to content
This repository has been archived by the owner on Dec 14, 2021. It is now read-only.
/ l10ns Public archive
forked from tinganho/l10ns

Internationalization workflow and formatting

License

Notifications You must be signed in to change notification settings

Sparted/l10ns

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Archived

L10ns - Effective translation workflow

Dependencies

Build from sources

  • git clone https://github.com/Sparted/l10ns && cd l10ns
  • bundle install
  • npm install
  • ./node_modules/.bin/bower install
  • ./node_modules/.bin/grunt data
  • ./node_modules/.bin/grunt webp
  • ./node_modules/.bin/grunt compass
  • ./node_modules/.bin/grunt dot

Join the chat at https://gitter.im/tinganho/l10ns

Build Status Version Download Gratipay

Today's translation problems

  • Syncing translation keys between source code and storage.
  • Accessing a simple translation web interface.
  • Compiling translations.
  • Searching a translation.
  • Problem translating gender context.
  • Problem translating multiple plural forms.
  • Problem translating ordinals.
  • Problem translating number/currency formats.
  • Problem translating date formats.

L10ns deals with the entire translation problem mentioned above. It manage syncing translation keys between your source code and your localization storage. You can compile translations and open a translation interface by a CLI method. It supports ICU's message format and reads data directly from CLDR for translating multiple complex translations.

Installation

npm install l10ns -g

Getting started

Create a new project folder test and initialize a new translation project. The initialization guide will lead you through creating a project.

$ mkdir test
$ cd test
$ l10ns init

Now, create a source file test.js with (at least) the following code:

var requireLocalizations = require('path/to/output');
var l = requireLocalizations('en-US');
var firstname = l('SIGN_UP__FIRSTNAME');
var lastname = l('SIGN_UP__LASTNAME');

Now, let's update translation keys from source. It will traverse your source code and look for all l() calls:

$ l10ns update

Let's check which translation keys have been added:

$ l10ns log
@1 SIGN_UP__FIRSTNAME | NO TRANSLATION
@2 SIGN_UP__LASTNAME | NO TRANSLATION

Edit the last translation using log reference:

$ l10ns set @1 "Firstname" # using default language
$ l10ns set @1 -l zh-CN "名" # using Chinese

Translation are now saved to a localization file. To compile to your source programming language:

$ l10ns compile

Let's set up a web interface for translator to use:

$ l10ns interface

Documentation

For more information please checkout our official documentation.

License

Copyright (c) 2014 Tingan Ho Licensed under the MIT license.

About

Internationalization workflow and formatting

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 98.4%
  • SCSS 1.4%
  • Other 0.2%