def pre_process(value, lang)
      # extract %{substitution_var} => @substitution_vars = ['substitution_var']
      #
      # This prevents the translator from seeing the substitution_var, in case it
      # tries to e.g. downcase it or whatever.
      @substitution_vars = []
      while value =~ /%\{([^\}]*)\}/
        value.sub! /%\{([^\}]*)\}/, "|#{@substitution_vars.count}|"
        @substitution_vars << $1
      end

      # extract '''pass through''' / ===pass through===  => @pass_through_vars = ['pass through']
      #
      # This allows string to be passed through without being translated
      # differs from @substitution_vars in that the underscore markup
      # will be stripped from the final result
      @pass_through_vars = []
      while value =~ /(?:(?:===)|(?:'''))(.*?)(?:(?:===)|(?:'''))/
        value.sub! /(?:(?:===)|(?:'''))(.*?)(?:(?:===)|(?:'''))/, "__#{@pass_through_vars.count}__"
        @pass_through_vars  << $1
      end

      vars = []
      index = 0
      while value =~ /(\{\d+\})/
        vars << $1
        value.sub!(/(\{\d+\})/, "[#{index}]")
        index += 1
      end
      
      value.gsub!("{{", "{{_")
      value.gsub!("}}", "_}}")

      value
    end
def pre_process(value, lang)
      # extract %{substitution_var} => @substitution_vars = ['substitution_var']
      #
      # This prevents the translator from seeing the substitution_var, in case it
      # tries to e.g. downcase it or whatever.
      @substitution_vars = []
      while value =~ /%\{([^\}]*)\}/
        value.sub! /%\{([^\}]*)\}/, "|#{@substitution_vars.count}|"
        @substitution_vars << $1
      end

      # extract '''pass through''' / ===pass through===  => @pass_through_vars = ['pass through']
      #
      # This allows string to be passed through without being translated
      # differs from @substitution_vars in that the underscore markup
      # will be stripped from the final result
      @pass_through_vars = []
      while value =~ /(?:(?:===)|(?:'''))(.*?)(?:(?:===)|(?:'''))/
        value.sub! /(?:(?:===)|(?:'''))(.*?)(?:(?:===)|(?:'''))/, "__#{@pass_through_vars.count}__"
        @pass_through_vars  << $1
      end

      vars = []
      index = 0
      while value =~ /(\{\d+\})/
        vars << $1
        value.sub!(/(\{\d+\})/, "[#{index}]")
        index += 1
      end
      
      value.gsub!("{{", "{{_")
      value.gsub!("}}", "_}}")

      value
    end
:nodoc: