Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
I18n backend, based on redis, with frontend panel for translations
tag: v0.2.4

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
app
config
lib
spec
.gitignore
.rspec
.rvmrc
Gemfile
Gemfile.lock
MIT-LICENSE
README.textile
Rakefile
VERSION
translation_panel.gemspec

README.textile

TranslationPanel

Using with Redis:

  • Run redis-server
  • Set up redis connection settings and register RedisTranslator::Backend as
    i18n backend in initializers:

    I18n.backend = TranslationPanel::RedisBackend.new(Redis.new)
    # or in chain with another backend
  • Create predicate method translation_panel? in ApplicationController,
    define in it, when panel can be shown and when translates can be saved. By
    default always.

    def translation_panel?
      params[:translator].present?
    end

Dependencies

TranslationPanel uses assets, scss, coffeescript, as all its work in Rails 3.1.

If you want to use panel with Rails 3.0, you need to use sprockets gem. Also you
need at least i18n-0.6.0 for proper work with i18n keys

Pluralization

Redis backenâ support pluralization.

1. You need to use Simple backend with included I18n::Pluralization in chain:


    I18n::Backend::Simple.include I18n::Backend::Pluralization
    redis_backend = TranslationPanel::RedisBackend.new(Redis.new)
    I18n.backend = I18n::Backend::Chain.new(redis_backend, I18n::Backend::Simple.new)

2. You need to add in config/locales/*.yml files rules for pluralization:


    i18n:
      plural:
        keys:
          - one
          - other
Something went wrong with that request. Please try again.