This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module InternalizationHelper | |
# let's imagine that some methods defined in your model like 'title_en' and 'title_ru' for different locales | |
# helper will create 'title' method depending on current I18n.locale | |
# Model.rb | |
# extend InternalizationHelper | |
# define_translations_for 'title', 'description', ... | |
def define_translations_for *methods | |
methods.each do |method_name| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var content_tag; | |
content_tag = function(tag, content, params){ | |
var tag, content, params, res; | |
var insert_params = ''; | |
for(var key in params){ | |
insert_params += ' '+key+'='+'"'+params[key]+'"'; | |
} | |
if(content){ | |
res = '<'+tag+insert_params+'>'+content+'</'+tag+'>'; | |
} else { |
NewerOlder