Skip to content

@defunkt /mustache_i18n.rb
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Mustache & i18n
class Stache18n
@@tags = {
'comment-and-close' => 'Comment and close',
'github' => 'GitHub',
'social-coding' => 'Social Coding'
}
def self.t
@@tags
end
end
puts Mustache.render(<<END, Stache18n)
<title>{{t.github}} - {{t.social-coding}}</title>
END
class Stache18n
@@tags = {
'comment-and-close' => 'Comment and close',
'github' => 'GitHub',
'social-coding' => 'Social Coding'
}
def self.t
new
end
def method_missing(tag)
@@tags[tag.to_s]
end
def respond_to?(tag)
@@tags[tag.to_s]
end
end
puts Mustache.render(<<END, Stache18n)
<title>{{t.github}} - {{t.social-coding}}</title>
END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.