Code Monkey home page Code Monkey logo

i18n_db's Introduction

Database-driven namespaced translations for Rails

This is a Rails-2.2+ i18n plugin written with a specific set of features in mind:

  • Only strings (with macro substitutions) are translated. E.g. everything that one would write directly in the view templates for a monolingual site, plus error messages etc.

  • Fallback to the primary language when a translation is missing.

  • Missing translations are tracked in the database.

  • Namespaces.

  • No support for model translations (like product names) at this stage. Feel free to add!

  • No support for pluralization initially.

  • Memcached for speed.

Each translated string can also be seen as an ActiveRecord instance, enabling easier construction of a web interface for translators (see i18n_db_admin). Deeply nested namespaces are supported and encouraged; otherwise, as we all know, the collection of translated phrases would turn into unmaintainable mess very quickly.

After loading, the translated strings are cached with standard Rails mechanisms and the default Simple Internationalization backend takes over and displays them.

Based on the code of globalize (for Rails 2.0) and i18n_yaml.

Please see i18n_db_admin for usage example.

i18n_db's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

rubysolo

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.