diff options
author | elijah <elijah@riseup.net> | 2014-10-20 12:28:36 -0700 |
---|---|---|
committer | elijah <elijah@riseup.net> | 2014-10-20 12:28:36 -0700 |
commit | 6714b257880a393994e58922f8959eecdf7615c5 (patch) | |
tree | 0402e23917f3c21f2eb05f96c08128ce437561e8 /lib/tasks | |
parent | 22ad9db28f862d146c15b81634bece25c0460f05 (diff) |
updated i18n:bundle task so that transifex can pull in strings automatically from a stable url.
Diffstat (limited to 'lib/tasks')
-rw-r--r-- | lib/tasks/i18n.rake | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/tasks/i18n.rake b/lib/tasks/i18n.rake index 239d081..daa1834 100644 --- a/lib/tasks/i18n.rake +++ b/lib/tasks/i18n.rake @@ -8,18 +8,21 @@ namespace :i18n do # the small files into one big one. # # Also, transifex insists that the files be en_US and not just en. - # grrr. + # grrr. transifex is configured to automatically update from the + # file lib/en_US.yml. # - desc "combine locales/en/*.yml to cwd/en.yml" + desc "combine config/locales/*.en.yml to lib/en_US.yml" task :bundle do - en_yml = File.join(Rails.root, 'leap_web_en_US.yml') + en_yml = File.join(Rails.root, 'lib', 'en_US.yml') Dir.chdir('config/locales/') do if File.exists?(en_yml) - puts "File `#{en_yml}` already exists. Remove it first." - exit + File.unlink en_yml end File.open(en_yml, 'w') do |output| - output.write("en_US:\n\n ### Do NOT edit this file directly, as all changes will be overwritten by the bundle script. Instead, make changes in the appropriate file in config/locales/en and recreate this file with the i18n:bundle task.") + output.write("en_US:\n\n"+ + "### Do NOT edit this file directly, as all changes will be overwritten by `rake i18:bundle`\n"+ + "### Instead, make changes in the appropriate file in config/locales.\n"+ + "### Source strings in transifex are automatically updated from this file (via github url)") Dir.glob('*.en.yml').sort.each do |file| ## print separator to see where another file begins |