summaryrefslogtreecommitdiff
path: root/lib/tasks/i18n.rake
diff options
context:
space:
mode:
Diffstat (limited to 'lib/tasks/i18n.rake')
-rw-r--r--lib/tasks/i18n.rake15
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