Skip to content

Commit

Permalink
Wrap I18nUtil.synchronize_translations with a rake task and add a rak…
Browse files Browse the repository at this point in the history
…e i18n:populate:all.
  • Loading branch information
Shane Mingins authored and Shane Mingins committed Mar 15, 2009
1 parent 0666825 commit 6f4d776
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
13 changes: 8 additions & 5 deletions README.textile
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@ h2. Installation

<pre>
<code>
script/generate i18n_backend_database # add migration
rake db:migrate # migrate
rake i18n:populate:load_default_locales # populate default locales
rake i18n:populate:from_rails # populate the locales and translations tables from all Rails Locale YAML files.
rake i18n:populate:from_application # populate the translation tables from translation calls within the application.
script/generate i18n_backend_database # add migration
rake db:migrate # migrate

rake i18n:populate:load_default_locales # populate default locales
rake i18n:populate:from_rails # populate the locales and translations tables from all Rails Locale YAML files.
rake i18n:populate:from_application # populate the translation tables from translation calls within the application.
rake i18n:populate:synchronize_translations # create non-default locale translation records from default locale translations.
rake i18n:populate:all # run all populate tasks.
</code>
</pre>

Expand Down
8 changes: 8 additions & 0 deletions tasks/i18n.rake
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,17 @@ namespace :i18n do
I18nUtil.seed_application_translations
end

desc 'Create translation records from all default locale translations if none exists.'
task :synchronize_translations => :environment do
I18nUtil.synchronize_translations
end

desc 'Populate default locales'
task :load_default_locales => :environment do
load_default_locales(ENV['LOCALE_FILE'])
end

desc 'Runs all populate methods in this order: load_default_locales, from_rails, from_application, synchronize_translations'
task :all => ["load_default_locales", "from_rails", "from_application", "synchronize_translations"]
end
end

0 comments on commit 6f4d776

Please sign in to comment.