Sha256: 7a9a3b65a1ddddd93eac678f07ca988c34352508f2c227b8373798b41219df31

Contents?: true

Size: 337 Bytes

Versions: 7

Compression:

Stored size: 337 Bytes

Contents

require 'glue/localization'

module Glue

class Localization

  class << self

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

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

      return text
    end

  end

end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
nitro-0.21.0 lib/nitro/compiler/localization.rb
nitro-0.21.2 lib/nitro/compiler/localization.rb
nitro-0.22.0 lib/nitro/compiler/localization.rb
nitro-0.23.0 lib/nitro/compiler/localization.rb
nitro-0.24.0 lib/nitro/compiler/localization.rb
nitro-0.25.0 lib/nitro/compiler/localization.rb
nitro-0.26.0 lib/nitro/compiler/localization.rb