Class: Nitro::Localization
- Inherits:
-
Object
- Object
- Nitro::Localization
- Defined in:
- lib/nitro/compiler/localization.rb
Class Method Summary collapse
-
.transform(text, compiler = nil) ⇒ Object
Transform localization macros.
Class Method Details
.transform(text, compiler = nil) ⇒ Object
Transform localization macros.
11 12 13 14 15 16 17 18 19 |
# File 'lib/nitro/compiler/localization.rb', line 11 def transform(text, compiler = nil) # handle symbols text.gsub!(/\[\[\:(.*?)\]\]/, '#{@lc[\1]}') # handle strings text.gsub!(/\[\[(.*?)\]\]/, '#{@lc["\1"]}') return text end |