Sha256: dcc437a699d4760dbb3f9278b2b6e458b74701debe6be5451a0dfbaabe0883f5

Contents?: true

Size: 354 Bytes

Versions: 2

Compression:

Stored size: 354 Bytes

Contents

require 'glue/localization'

module Nitro

class Localization

  class << self

    # Transform localization macros.
    
    def transform(text, compiler = nil)
      # handle symbols
      text.gsub!(/\[\[\:(.*?)\]\]/, '#{@lc[\1]}')

      # handle strings 
      text.gsub!(/\[\[(.*?)\]\]/, '#{@lc["\1"]}')

      return text
    end

  end

end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
nitro-0.41.0 lib/nitro/compiler/localization.rb
nitro-0.40.0 lib/nitro/compiler/localization.rb