Skip to content

Commit

Permalink
Translation: Do not translate empty keys
Browse files Browse the repository at this point in the history
Refs #283
  • Loading branch information
glebm committed Aug 20, 2018
1 parent 4c83cf3 commit fc529e7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/i18n/tasks/translators/base_translator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def dump_value(value)
# dump recursively
value.map { |v| dump_value v }
when String
replace_interpolations value
replace_interpolations value unless value.empty?
end
end

Expand All @@ -82,7 +82,11 @@ def parse_value(untranslated, each_translated)
# implode array
untranslated.map { |from| parse_value(from, each_translated) }
when String
restore_interpolations untranslated, each_translated.next
if untranslated.empty?
untranslated
else
restore_interpolations untranslated, each_translated.next
end
else
untranslated
end
Expand Down

0 comments on commit fc529e7

Please sign in to comment.