Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #2 from hankthetank/patch-1

If the translation field in the database is not NULL the _() method thin...
  • Loading branch information...
commit 03819984ab3703fbda8e1efe9e3988e749ebcc2c 2 parents 2b2d632 + 5c309f3
@grosser authored
Showing with 3 additions and 0 deletions.
  1. +3 −0  lib/tasks/sync_po_to_db.rake
View
3  lib/tasks/sync_po_to_db.rake
@@ -30,6 +30,9 @@ task :sync_po_to_db => :environment do
next if key.translations.detect{|text| text.locale == locale}
#store translations
+ # make sure we store nil (NULL) values if msgstr is blank
+ # so that the _() method will see that the string is not translated
+ t.msgstr.blank? ? t.msgstr = nil : t.msgstr = t.msgstr
puts "Creating text #{locale}:#{t.msgstr}"
key.translations.create!(:locale=>locale, :text=>t.msgstr)
end
Please sign in to comment.
Something went wrong with that request. Please try again.