1
0
Fork 0
forked from OpenNeo/impress
impress/lib/fragment_localization.rb

12 lines
277 B
Ruby
Raw Permalink Normal View History

module FragmentLocalization
def localize_fragment_key(key, locale)
if key.is_a?(Hash)
{:locale => locale}.merge(key)
elsif key.is_a?(String)
"#{key} #{locale}"
else
raise TypeError, "unexpected fragment key type: #{key.class}"
end
end
end