Rails::Pseudoloc
Provides automated pseudolocalization to Ruby on Rails applications.
Installation
Add this line to your application's Gemfile:
gem 'rails-pseudoloc'
And then execute:
$ bundle
Or install it yourself as:
$ gem install rails-pseudoloc
Usage
Rails 4
Create an initializer under config/initializers
that looks like this:
if ENV['PSEUDOLOC']
require 'rails/pseudoloc'
I18n.backend = Rails::Pseudoloc::Backend.new(I18n.backend)
end
Set the environment variable to turn on pseudoloc and then restart the Rails application. To turn it off, simply clear the environment variable and restart the Rails application.
Limitations
The gem currently does not pseudolocalize everything. Specifically it does not pseudolocalize anything that goes through the I18n#localize
method or l
helper. It also does not currently pseudolocalize strings consisting entirely of capital letters because I haven't gotten around to expanding out the translation table to include capital letters yet.
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request