Code Monkey home page Code Monkey logo

i18n's Introduction

Ruby I18n

Build Status

Ruby Internationalization and localization solution.

Features:

  • translation and localization
  • interpolation of values to translations (Ruby 1.9 compatible syntax)
  • pluralization (CLDR compatible)
  • customizable transliteration to ASCII
  • flexible defaults
  • bulk lookup
  • lambdas as translation data
  • custom key/scope separator
  • custom exception handlers
  • extensible architecture with a swappable backend

Pluggable features:

  • Cache
  • Pluralization: lambda pluralizers stored as translation data
  • Locale fallbacks, RFC4647 compliant (optionally: RFC4646 locale validation)
  • Gettext support
  • Translation metadata

Alternative backends:

  • Chain
  • ActiveRecord (optionally: ActiveRecord::Missing and ActiveRecord::StoreProcs)
  • KeyValue (uses active_support/json and cannot store procs)

For more information and lots of resources see: http://ruby-i18n.org/wiki

Installation

gem install i18n

Tests

You can run tests both with

  • rake test or just rake
  • run any test file directly, e.g. ruby -Ilib:test test/api/simple_test.rb

You can run all tests against all Gemfiles with

  • ruby test/run_all.rb

The structure of the test suite is a bit unusual as it uses modules to reuse particular tests in different test cases.

The reason for this is that we need to enforce the I18n API across various combinations of extensions. E.g. the Simple backend alone needs to support the same API as any combination of feature and/or optimization modules included to the Simple backend. We test this by reusing the same API defition (implemented as test methods) in test cases with different setups.

You can find the test cases that enforce the API in test/api. And you can find the API definition test methods in test/api/tests.

All other test cases (e.g. as defined in test/backend, test/core_ext) etc. follow the usual test setup and should be easy to grok.

Authors

Contributors

https://github.com/svenfuchs/i18n/graphs/contributors

License

MIT License. See the included MIT-LICENSE file.

i18n's People

Contributors

carlosantoniodasilva avatar josevalim avatar tigrish avatar knapo avatar lawrencepit avatar jeremy avatar clemens avatar yaroslav avatar thedarkone avatar tenderlove avatar joshmh avatar norman avatar arthurnn avatar svenfuchs avatar spastorino avatar romuloceccon avatar ndbroadbent avatar nashbridges avatar mattetti avatar mseppae avatar bertg avatar abriening avatar amatsuda avatar pjg avatar sikachu avatar purzelrakete avatar paneq avatar radar avatar tricknotes avatar semaperepelitsa avatar

Watchers

James Cloos avatar Josh W Lewis 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.