Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixes #4178 - updating i18n extracting rake task and makefile

  • Loading branch information...
commit ab5c02365e8cb9ac66e72c6ba2d9c2a90350bd9f 1 parent 858708c
@lzap lzap authored domcleal committed
Showing with 9 additions and 5 deletions.
  1. +6 −2 lib/tasks/locale.rake
  2. +3 −3 locale/Makefile
View
8 lib/tasks/locale.rake
@@ -1,5 +1,7 @@
require "fileutils"
+DOMAIN = ENV['DOMAIN'] || 'foreman'
+
desc 'Locale specific tasks: locale:find'
namespace :locale do
@@ -29,12 +31,14 @@ namespace :locale do
task :find_code => ["gettext:find", "gettext:po_to_json"]
desc 'Extract strings from model and from codebase'
- task :find => [:find_model, :find_code] do
+ find_dependencies = [:find_model, :find_code]
+ find_dependencies.shift if ENV['SKIP_MODEL']
+ task :find => find_dependencies do
# do not commit PO string merge into git (we are using transifex.com)
`git checkout -- locale/*/*.po`
# find malformed strings
- errors = File.open("locale/foreman.pot") {|f| f.grep /(%s.*%s|#\{)/}
+ errors = File.open("locale/#{DOMAIN}.pot") {|f| f.grep /(%s.*%s|#\{)/}
if errors.count > 0
errors.each {|e| puts "MALFORMED: #{e}"}
puts "Malformed strings found: #{errors.count}"
View
6 locale/Makefile
@@ -44,14 +44,14 @@ uniq-po:
done
tx-pull:
- tx pull -f -r foreman.foreman
+ tx pull -f
-git commit -a -m "i18n - extracting new, updating rails, pulling from tx"
update-rails:
- ../script/update-rails-locales.sh
+ -[ -x ../script/update-rails-locales.sh ] && ../script/update-rails-locales.sh
extract-strings:
- bundle exec rake locale:find
+ bundle exec rake locale:find DOMAIN=$(DOMAIN) SKIP_MODEL=1
tx-update: update-rails tx-pull extract-strings
# merging po files is unnecessary when using transifex.com (amend that)
Please sign in to comment.
Something went wrong with that request. Please try again.