github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

svenfuchs / i18n forked from mattetti/i18n

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 144
    • 2
  • Source
  • Commits
  • Network (2)
  • Issues (1)
  • Downloads (6)
  • Wiki (5)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (2)
    • 0.2.x
    • master ✓
  • Tags (6)
    • v0.3.3
    • v0.3.2
    • v0.3.1
    • v0.3.0
    • v0.2.1
    • v0.2.0
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

Internationalization (i18n) library for Ruby — Read more

  cancel

rails-i18n.org/wiki

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

Fix typo :) 
Prem Sichanugrist (author)
Mon Jan 18 11:25:28 -0800 2010
svenfuchs (committer)
Tue Feb 09 05:27:49 -0800 2010
commit  2eb3df89794c999f1833ed5bd7b891bfc43f0f8f
tree    e370bf770d2a70adc6c1b781404aff15db1e0376
parent  db59a1a64b073fc5ce986dee99d543feb71a6af4
i18n /
name age
history
message
file .gitignore Sun Jan 17 03:39:59 -0800 2010 ignore vendor/cldr [svenfuchs]
file CHANGELOG.textile Thu Dec 10 15:18:35 -0800 2009 update changelog [clemens]
file MIT-LICENSE Mon Jun 23 08:02:05 -0700 2008 renamed license file and added minimum info to ... [svenfuchs]
file README.textile Tue Feb 09 05:27:49 -0800 2010 Fix typo :) [Prem Sichanugrist]
file Rakefile Sat Jan 23 05:33:40 -0800 2010 restructure tests because previous structure co... [svenfuchs]
directory benchmark/ Tue Dec 29 06:04:44 -0800 2009 Add interpolation compiler to benchmarks. [josevalim]
file contributors.txt Sun Jan 17 05:34:33 -0800 2010 add Krzysztof Knapik to the contributors list [svenfuchs]
file i18n.gemspec Sun Jan 10 07:36:43 -0800 2010 move test/fixtures/locales to test/locales [svenfuchs]
file init.rb Sat Nov 21 04:58:00 -0800 2009 Add an ActiveRecordMissing extension that store... [m4ssive]
directory lib/ Tue Feb 09 01:14:08 -0800 2010 fix sgettext [Lawrence Pit]
directory test/ Tue Feb 09 01:14:08 -0800 2010 fix sgettext [Lawrence Pit]
directory vendor/ Sat Jul 18 05:16:46 -0700 2009 experimental gettext support [svenfuchs]
README.textile

Ruby I18n

Ruby Internationalization and localization solution.

Features:

  • translation and localization
  • interpolation of values to translations (Ruby 1.9 compatible syntax)
  • pluralization (CLDR compatible)
  • 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: ActiveRecordMissing)

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

Installation

gem install i18n

Installation on Rails < 2.3.5 (deprecated)

Up to version 2.3.4 Rails will not accept i18n gems > 0.1.3. There is an unpacked
gem inside of active_support/lib/vendor which gets loaded unless gem ‘i18n’, ‘~> 0.1.3’.
This requirement is relaxed in 6da03653

The new i18n gem can be loaded from vendor/plugins like this:

def reload_i18n! raise “Move to i18n version 0.2.0 or greater” if Rails.version > “2.3.4” $:.grep(/i18n/).each { |path| $:.delete(path) } I18n::Backend.send :remove_const, “Simple” $: << Rails.root.join(‘vendor’, ‘plugins’, ‘i18n’, ‘lib’).to_s end

Then you can `reload_i18n!` inside an i18n initializer.

Tests

You can run tests both with

  • `rake test` or just `rake`
  • run any test file directly, e.g. `ruby test/api/simple_test.rb`
  • run all tests with `ruby test/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

  • Sven Fuchs
  • Joshua Harvey
  • Stephan Soller
  • Saimon Moore
  • Matt Aimonetti

Contributors

  • Akira Matsuda
  • Andrew Briening
  • Clemens Kofler
  • Frederick Cheung
  • Jeremy Kemper
  • José Valim
  • Lawrence Pit
  • Luca Guidi
  • M4SSIVE
  • Marko Seppae
  • Mathias Meyer
  • Michael Lang
  • Theo Cushion
  • Yaroslav Markin

License

MIT License. See the included MIT-LICENSE file.

Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server