lib/titlezilla/translator.rb in titlezilla-0.1.3 vs lib/titlezilla/translator.rb in titlezilla-0.1.4
- old
+ new
@@ -46,10 +46,11 @@
title_namespace = namespace.dup
begin
title = lookup_with_namespace(key, title_namespace)
return title if title
title_namespace.pop
- end while title_namespace.size >= 0
+ end while title_namespace.size > 0
+ lookup_with_namespace(key, title_namespace)
end
def lookup_with_namespace(keys, namespace)
t_key = [:titles, namespace, keys].flatten.compact.join('.')
i18n_set?(t_key) ? I18n.t(t_key, context) : nil