Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Rails/AR: engine to manage translations inside a database

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 app
Octocat-spinner-32 config
Octocat-spinner-32 lib
Octocat-spinner-32 Readme.md
Octocat-spinner-32 translation_db_engine.yml
Readme.md

A interface for database stored translation editing as rails engine.

Setup

rails plugin install git://github.com/grosser/translation_db_engine.git

Default

  • Setup FastGettext to run from database and include the db_models, see FastGettext Readme
  • rails generate migration CreateTranslationTables and paste in migrations to create models
  • Start translating! (it is as fast as mo/po based translations because of FastGettext`s caching)

Personalized

  • Setup whichever I18n framework supports a database
  • Create a TranslationKey model that has_many :translations, available_locales and accepts_nested_attributes_for :translations
  • Make available locales return the locales you need
  • Start translating!

Thereafter...

  • Setup authentification by copying and modifying translation_db_engine.yml into RAILS_ROOT/config
  • rake sync_po_to_db to load all translations from .po files into the database (given they lie in /locale), requires pomo po parser
  • (If not translations exist yet) Add initial translations through import or create them through the script/console (you NEED a translation for every locale so that available_locales is populated and edit fields are shown correctly)
  • Visit /translation_keys in your browser.

TODO

  • specs
  • search + ordering + pagination

Author

Michael Grosser
michael@grosser.it
License: MIT

Something went wrong with that request. Please try again.