Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Tolk is a web interface for doing i18n translations packaged as an engine for Rails 3.1 applications
Ruby JavaScript
branch: master

This branch is 4 commits ahead, 10 commits behind rkyrychuk:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
app
config
db
doc
lib
log
public
script
test
vendor
.gitignore
CHANGELOG
Gemfile
Gemfile.lock
MIT-LICENSE
README.md
Rakefile
init.rb
tolk.gemspec

README.md

Tolk

Tolk is a Rails 3.2 engine designed to facilitate the translators doing the dirty work of translating your application to other languages.

Installation & Setup

To install add the following to your Gemfile:

  gem 'tolk', :git => 'git://github.com/jobandtalent/tolk.git', :branch => 'master'

To setup just run:

  rake tolk:setup

and mount the engine in your routes.rb file

  mount Tolk::Engine => "/tolk"

Usage

Tolk treats I18n.default_locale as the master source of strings to be translated. If you want the master source to be different from I18n.default_locale, you can override it by setting Tolk::Locale.primary_locale_name. Developers are expected to make all the changes to the master locale file ( en.yml by default ) 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 :

  rake 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.

If you already have data in your non primary locale files, you will need to import those to Tolk as a one time thing (this is also ran with setup) :

  rake tolk:import

Upon visiting http://your_app.com/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 :

  rake tolk:dump_all

This will generate yml files for all non primary locales and put them in #{Rails.root}/config/locales/ directory by default.

Something went wrong with that request. Please try again.