Giter Site home page Giter Site logo

l100n's Introduction

l100n - unusual JavaScript library for pure client-side localization by css-selectors

Popular localization libraries are so "traditional". They are copying "big server brothers" and make localization in the old way. Wrap strings in _(function), import translation files and localize strings one by one. It's good then you're server and keeps your code clean, but in JavaScript it is soooo old-fag.

In JavaScript we have full access to DOM at all. We do not want to modify our HTML templates, we want pure-javascript localization engine working with css-selectors and jquery. This is l100n.

Example from demo.html:

// Set defaults
l100n.default_locale = "en";
l100n.locale = "ru";

// Set localizations strings
var demo_small_l10n_strings = {
    "demo-small-string": {
        selector: "#demo-small",
        en: "I am a small cocorodile",
        ru: "Я маленький крокодил"
    }
};
l100n.add_page("demo-small", demo_small_l10n_strings);

// Magic!
l100n.localize_page("demo-small", "en");            // Localize all page
l100n.localize("demo-small-string", null, "en");    // Localize one string by selector
l100n.localize_all_pages("en");                     // Localize all known pages

Описание на русском языке: http://vas3k.ru/dev/l100n

l100n's People

Contributors

vas3k avatar

Watchers

James Cloos avatar El'vina 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.