lib/babelyoda.rb in babelyoda-2.0.0 vs lib/babelyoda.rb in babelyoda-2.0.1
- old
+ new
@@ -32,11 +32,11 @@
desc "Extract strings from sources"
task :extract_strings do
puts "Extracting strings from sources..."
dev_lang = spec.development_language
- spec.scm.transaction("Extract strings from sources") do
+ spec.scm.transaction("[Babelyoda] Extract strings from sources") do
Babelyoda::Genstrings.run(spec.source_files, dev_lang) do |keyset|
old_strings_filename = strings_filename(keyset.name, dev_lang)
old_strings = Babelyoda::Strings.new(old_strings_filename, dev_lang).read
old_strings.merge!(keyset)
old_strings.save!
@@ -46,11 +46,11 @@
end
desc "Extract strings from XIBs"
task :extract_xib_strings do
puts "Extracting .strings from XIBs..."
- spec.scm.transaction("Extract strings from XIBs") do
+ spec.scm.transaction("[Babelyoda] Extract strings from XIBs") do
spec.xib_files.each do |xib_filename|
xib = Babelyoda::Xib.new(xib_filename, spec.development_language)
next unless xib.extractable?(spec.development_language)
keyset = xib.strings
puts " #{xib_filename} => #{xib.strings_filename}"
@@ -116,11 +116,11 @@
end
desc "Fetches remote strings and merges them down into local .string files"
task :fetch_strings do
puts "Fetching remote translations..."
- spec.scm.transaction("Merge in remote translations") do
+ spec.scm.transaction("[Babelyoda] Merge in remote translations") do
spec.strings_files.each do |filename|
keyset_name = Babelyoda::Keyset.keyset_name(filename)
remote_keyset = spec.engine.load_keyset(keyset_name, nil, :unapproved, true)
remote_keyset.drop_empty!
spec.all_languages.each do |language|
@@ -134,33 +134,52 @@
desc "Incrementally localizes XIB files"
task :localize_xibs do
puts "Translating XIB files..."
- spec.scm.transaction("Localize XIB files") do
+ spec.scm.transaction("[Babelyoda] Localize XIB files") do
spec.xib_files.each do |filename|
xib = Babelyoda::Xib.new(filename, spec.development_language)
xib.import_strings(spec.scm)
spec.localization_languages.each do |language|
xib.localize_incremental(language, spec.scm)
end
end
end
- spec.scm.transaction("Update XIB SHA1 version refs") do
+ spec.scm.transaction("[Babelyoda] Update XIB SHA1 version refs") do
spec.xib_files.each do |filename|
spec.scm.store_version!(filename)
- spec.localization_languages.each do |language|
- spec.scm.store_version!(File.localized(filename, language))
- end
end
end
end
desc "Pull remote translations"
task :pull => [:fetch_strings, :localize_xibs] do
end
+
+ # desc "Verifies all local translations are present"
+ # task :verify do
+ # combined_keyset = Babelyoda::Keyset.new('babelyoda.verify')
+ # spec.strings_files.each do |filename|
+ # dev_lang_strings = Babelyoda::Strings.new(filename, spec.development_language).read
+ # combined_keyset.merge!(dev_lang_strings)
+ # spec.localization_languages.each do |language|
+ # lang_strings = Babelyoda::Strings.new(filename, language).read
+ # combined_keyset.merge!(lang_strings)
+ # end
+ # end
+ # puts "TOTAL KEYS: #{combined_keyset}"
+ # missing = {}
+ # spec.localization_languages.each do |language|
+ # missing[language] = Babelyoda::Keyset.new('babelyoda.verify.' + language)
+ # end
+ # puts "MISSING KEYS:"
+ # spec.localization_languages.each do |language|
+ # puts " #{language}: #{missing}"
+ # end
+ # end
namespace :remote do
desc "List remote keysets"
task :list do