Setup
July 21, 2012 ยท View on GitHub
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 CreateTranslationTablesand 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
TranslationKeymodel thathas_many :translations,available_localesandaccepts_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_dbto 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_localesis populated and edit fields are shown correctly) - Visit
/translation_keysin your browser.
TODO
- specs
- search + ordering + pagination
Author
Michael Grosser
michael@grosser.it
License: MIT