Class | String |
In: |
lib/fast_gettext/vendor/string.rb
|
Parent: | Object |
either we are on vanilla 1.8(call with hash raises ArgumentError) or someone else already patched % but did it wrong
PERCENT_MATCH_RE | = | Regexp.union( /%%/, /%\{([-\.\w]+)\}/, /%<([-\.\w]+)>(.*?\d*\.?\d*[bBdiouxXeEfgGcps])/ |
% | -> | _fast_gettext_old_format_m |
Default: "%s, %s" % ["Masao", "Mutoh"] Extended: "%{firstname}, %{lastname}" % {:firstname=>"Masao",:lastname=>"Mutoh"} == "Masao Mutoh" with field type such as d(decimal), f(float), ... "%<age>d, %<weight>.1f" % {:age => 10, :weight => 43.4} == "10 43.4"
This is the recommanded way for Ruby-GetText because the translators can understand the meanings of the keys easily.