Skip to content

Commit

Permalink
Show the original string also when the translation is empty.
Browse files Browse the repository at this point in the history
Currently the original (English) string is used when a particular
translation is not found. However, when a language file is updated or
generated by the make_language.rb script all strings are empty strings.
This patch facilitates running with a partially translated language file
without worrying about disappearing text.

Signed-off-by: Frédéric de Villamil <frederic@de-villamil.com>
  • Loading branch information
graaff authored and Frédéric de Villamil committed Mar 17, 2009
1 parent f6ec170 commit 54e4e5c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vendor/plugins/localization/lib/localization.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module Localization
@@lang = :default

def self._(string_to_localize, *args)
translated = @@l10s[@@lang][string_to_localize] || string_to_localize
translated = @@l10s[@@lang][string_to_localize] ? string_to_localize : @@l10s[@@lang][string_to_localize]
return translated.call(*args).to_s if translated.is_a? Proc
if translated.is_a? Array
translated = if translated.size == 3
Expand All @@ -18,7 +18,7 @@ def self._(string_to_localize, *args)
end

def self.__(string_to_localize, *args)
translated = @@l10s[@@lang][string_to_localize] || string_to_localize
translated = @@l10s[@@lang][string_to_localize] ? string_to_localize : @@l10s[@@lang][string_to_localize]
return translated.call(*args).to_s if translated.is_a? Proc
if translated.is_a? Array
translated = if translated.size == 3
Expand Down

0 comments on commit 54e4e5c

Please sign in to comment.