Sha256: 293fdf68fabcec3fe2f95f6e2f689e149c44aa839c944256bc8b81e492e41cf7
Contents?: true
Size: 802 Bytes
Versions: 12
Compression:
Stored size: 802 Bytes
Contents
# encoding: UTF-8 # Copyright 2012 Twitter, Inc # http://www.apache.org/licenses/LICENSE-2.0 module TwitterCldr module Js module Renderers module PluralRules class PluralRulesRenderer < TwitterCldr::Js::Renderers::Base self.template_file = File.expand_path(File.join(File.dirname(__FILE__), "../../..", "mustache/plurals/rules.coffee")) def rules ruby_str = TwitterCldr.get_locale_resource(@locale, :plurals)[@locale] rule_str = ruby_str.scan(/lambda\s*\{\s*\|n\|(.*?)\}/).first.first.strip js_str = PluralRulesCompiler.rule_to_js(rule_str) hash = eval(ruby_str) %Q({"keys": #{hash[@locale][:i18n][:plural][:keys].to_json}, "rule": #{js_str}}) end end end end end end
Version data entries
12 entries across 12 versions & 2 rubygems