Code Monkey home page Code Monkey logo

l10ns's Introduction

L10ns - Effective translation workflow

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.

l10ns's People

Contributors

tinganho avatar focusaurus avatar nmn avatar maininfection avatar bitdeli-chef avatar cadesalaberry avatar waffle-iron avatar gitter-badger avatar

Watchers

Pablo Estrada avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.