-
- def with_format(format, &block)
- old_format = @template_format
- @template_format = format
- result = block.call
- @template_format = old_format
- return result
- end
-
-private
-
- def javascript_strings_for_key(key)
- js = ""
- value = I18n.t(key, :locale => "en")
-
- if value.is_a?(String)
- js << "i18n_strings['#{key}'] = '" << escape_javascript(t(key)) << "';\n"
- else
- value.each_key do |k|
- js << javascript_strings_for_key("#{key}.#{k}")
- end
- end
-
- return js
- end