Ri18n: Make your Ruby application international.
Ri18n is an internationalization and localization library for Ruby applications.
- 100 % ruby. Use ruby standard tools:
- Rake tasks for managing/updating tranlation files (PO files)
- Ruby Gems for creating translation packages
- Take inspiration from Gettext and be (partially) compatible with it:
- Use
_( ) function (and similars) for marking the strings to translate.
- Use PO format for storing translation messages.
-
Unicode oriented (utf-8). Intially Ri18n was utf-8 only.
There is now support for charset conversion.
Status:
Ri18n is in early developement stage but has already working internationalization
functionality.
Available features
- Reading and writing PO files.
- A gettext task (Rake) that gets the new strings in your source code and updates the PO files accordingly
- Following translator functions are defined:
- Normal translator
- _('string')
- Plural translator
- n_('%i file', '%i files', file_count)
- Translator with interpolation
- _i('Category is #{@category}')
- Plural forms are coded in the library and the right plural form is automatically choosed.
- Charset conversions: Automatic conversion on loading from the PO file charset encoding to the ruby application encoding (defined by the value of $KCODE; UTF-8, EUC-JP, Shift-JIS or none (ASCII))
Planned features/TODO
- Special support for translating strings in ERB files:
<%_string%>
shortcut for
<%= _('string') %>
- Support for packaging (gem) of localized versions of your application.
- Add a lot of small missing things needed for completeness.
Resources:
Related information
Contact:
Contributions of any kind are welcome.
This project is hosted by 