Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: ccdc033811
Fetching contributors…

Cannot retrieve contributors at this time

32 lines (17 sloc) 1.42 kb
Tolk is a Rails engine designed to facilitate the translators doing the dirty work of translating your application to other languages.
* Installation & Setup
To install :
$ script/plugin install git://
To setup :
1) Define the primary locale inside your application's configuration file :
# environment.rb
Locale.primary_locale_name = 'en'
2) Generate a new migration and copy relevant parts of tolk/db/schema.rb to self.up() and migrate
* Usage
Tolk treats <tt>Locale.primary_locale_name</tt> as the main source of strings to be translated. Developers are expected to make all the changes to that file ( en.yml in our case ) and treat all the other locale.yml files as readonly files.
As tolk stores all the keys and translated strings in the database, you need to ask Tolk to update it's database from the primary yml file :
$ script/runner 'Tolk.sync!'
The above will fetch all the new keys from en.yml and put them in the database. Additionally, it'll also get rid of the deleted keys from the database and reflect updated translations - if any.
Upon visiting http://<your app>/tolk - you will be presented with different options like creating new locale or providing translations for the existing locales. Once done with translating all the pending strings, you are can write back the new locales to filesystem :
$ script/runner 'Tolk.dump_all'
This will write
Jump to Line
Something went wrong with that request. Please try again.