Function to get language translated string and replace
the
540962
public static function __($short, $chunks){
		$translated = self::_($short);
		foreach($chunks as $k=>$v){
			$translated = str_replace('%'.$k.'%', $v, $translated);
			}
		return $translated;
		}
896482
def translate(self, text):
        

        # Reset substitution counter
        self.count = 0

        # Process text
        return self._make_regex().sub(self, text)
371873
private function getTranslatedString($string)
    {
        $languageId = Registry::getLang()->getBaseLanguage();

        return Registry::getLang()->translateString(
            $string,
            $languageId,
            false
        );
    }
1004371
function translate(cldr, locale, opts) {
  if (typeof cldr === 'string') return augment(interpolate(cldr, opts));

  opts = opts || {};

  var pluralize = lookup(locale, cldr._format || opts.pluralFormat, plural);
  if (Array.isArray(cldr)) cldr = convertArray(cldr, pluralize, opts);

  validate(cldr, pluralize);

  var paramsObj = {};
  var cases = toFunctions(cldr, pluralize, opts, paramsObj);
  var paramsKeys = Object.keys(paramsObj);

  var key = cldr._plural_key ||
            opts.pluralKey ||
            discoverKey(paramsKeys,
                        opts.discoverableKeys || {'smart_count':1, 'count':1, 'length':1, 'items':1, 'total':1},
                        opts.defaultPluralKey || 'smart_count');

  var validatePluralKey = opts.validatePluralKey !== false;
  var silentValidation = !!opts.validatePluralSilent;
  var decimal = number.decimal[locale] || number.decimal.en;
  var toLocaleString = opts.toLocaleString !== false;

  return augment(function(params) {
    if (typeof params === 'number') params = convertSmartCount(params, key);

    var count = parseInt(params[key], 10);
    if (validatePluralKey && isNaN(count)) {
      if (silentValidation) return [];
      throw new Error('expected "' + key + '" to be a number. got "' + (typeof params[key]) + '".');
    }

    if (toLocaleString) params = formatNumbers(params, decimal);

    return (cases[count] || cases[pluralize(count || 0)])(params);
  }, paramsKeys);
}
131796
def _translate_symbols(string):
    """"""
    res = []
    for s in re.split(r'([,.:\s=]+)', string):
        tex_str = _TEX_GREEK_DICTIONARY.get(s)
        if tex_str:
            res.append(tex_str)
        elif s.lower() in greek_letters_set:
            res.append("\\" + s.lower())
        elif s in other_symbols:
            res.append("\\" + s)
        else:
            if re.match(r'^[a-zA-Z]{4,}$', s):
                res.append(r'\text{' + s + '}')
            else:
                res.append(s)
    return "".join(res)
429010
function replace(file, options) {
  var contents = file.contents;
  var copied = 0;

  var processed = translate(options, contents, copied, file.path);

  var files = [];
  for (var lang in processed) {
    var params = {};
    params.ext = path.extname(file.path).substr(1);
    params.name = path.basename(file.path, path.extname(file.path));
    params.path = file.path.substring(file.base.length, file.path.lastIndexOf(path.sep));
    params.lang = lang;

    var filePath = options.filename;
    for (var param in params) {
      filePath = filePath.replace('${' + param + '}', params[param]);
    }
    filePath = path.join(file.base,filePath);

    var newFile = new gutil.File({
      base: file.base,
      cwd: file.cwd,
      path: filePath,
      contents: new Buffer(processed[lang], 'utf8')
    });
    files.push(newFile);
  }

	return files;
}
980647
function translateInLanguageFilter(key, locale) {
    for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
      args[_key - 2] = arguments[_key];
    }

    return translateInLanguage.apply(void 0, [locale, key].concat(args));
  }
1121587
public function translate($string)
    {
        $translated = gettext($string);
        if ($translated == $string)
        {
            $this->logUntranslatedString($string);
        }
        return $translated;
    }
1344068
String getText(String key, Object... args) {
        return messages.getLocalizedString(locale, key, args);
    }
688078
def translate(self) -> Optional[str]:
        """"""

        fallbacks = getattr(settings, 'LOCALIZED_FIELDS_FALLBACKS', {})

        language = translation.get_language() or settings.LANGUAGE_CODE
        languages = fallbacks.get(language, [settings.LANGUAGE_CODE])[:]
        languages.insert(0, language)

        for lang_code in languages:
            value = self.get(lang_code)
            if value:
                return value or None

        return None
1014815
function $t() {
    // get the current language from the store
    var locale = store.state[moduleName].locale;
    return translateInLanguage.apply(void 0, [locale].concat(Array.prototype.slice.call(arguments)));
  }
610071
def extract_translations(self, string):
        """"""

        tree = ast.parse(string)
        # ast_visit(tree)
        visitor = TransVisitor(
            self.tranz_functions,
            self.tranzchoice_functions)
        visitor.visit(tree)

        return visitor.translations
510811
function gettext($string)
    {
        global $PPHP;
        $req = grab('request');

        $default = $PPHP['config']['global']['default_lang'];
        $current = $req['lang'];

        $res = $string;
        try {
            if (self::$_gettext !== null) {
                $res = self::$_gettext->gettext($string);
            };
        } catch (\Exception $e) {
            echo $e->getMessage();
        };
        return $res;
    }
896815
static function &translate($in_string)
    {
        $out_string = &$in_string;
        
        $langage = ReporticoApp::getConfig("language");
        $translations = ReporticoApp::get("translations");
        
        if ($translations) {
            if (array_key_exists($langage, $translations)) {
                $langset = &$translations[$langage];
                if (isset($langset[$in_string])) {
                    $out_string = &$langset[$in_string];
                }

            }
        }
        

        return $out_string;
    }
269949
function translate($str, $tokens = [])
    {
        if (array_key_exists($str, $this->translation)) {
            $str = $this->translation[$str];
        }
        if (is_array($tokens) && sizeof($tokens) > 0) {
            $str = vsprintf($str, $tokens);
        }

        return $str;
    }
973926
protected function _translate($string, $context = null)
    {
        if (!(($translator = $this->_getTranslator()) instanceof StringTranslatorInterface)) {
            return $string;
        }

        return $translator->translate($string, $context);
    }
1035363
def gettext(self, string, domain=None, **variables):
        """"""
        t = self.get_translations(domain)
        return t.ugettext(string) % variables