1
0
Fork 0
forked from OpenNeo/impress
impress/app/models/fragment_localization.rb

11 lines
277 B
Ruby

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