Get a translation according to an integer value.

@param  string  $id
@param  int     $number
@param  array   $parameters
@param  string  $domain
@param  string  $locale
@return string
323060
public function transChoice($id, $number, array $parameters = array(), $domain = 'messages', $locale = null)
	{
		return $this->choice($id, $number, $parameters, $locale);
	}
1042056
public function transChoice($id, $number, array $parameters = [], $domain = null, $locale = null)
    {
        @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.2, use the trans() one instead with a "%%count%%" parameter.', __METHOD__), E_USER_DEPRECATED);

        if ($this->translator instanceof TranslatorInterface) {
            $trans = $this->translator->trans($id, ['%count%' => $number] + $parameters, $domain, $locale);
        } else {
            $trans = $this->translator->transChoice($id, $number, $parameters, $domain, $locale);
        }

        $this->log($id, $domain, $locale);

        return $trans;
    }
4096
private function getTranslationsForDomainAndIds($locale, $domain, $ids)
    {
        /** @var Translator $translator */
        $translator = $this->container->get('translator');

        $translations = [];
        foreach ($ids as $id) {
            $translations[$id] = $translator->trans($id, [], $domain, $locale);
        }

        return $translations;
    }
1371764
public function dt( $domain, $string )
	{
		if( isset( $this->_translations[$domain][$string][0] ) ) {
			return $this->_translations[$domain][$string][0];
		}

		return parent::dt( $domain, $string );
	}
792218
protected function getValue($string, $domain, $locale)
    {
        if (!$domain) {
            $domain = 'default';
        }

        if (!$locale) {
            $locale = 'default';
        }

        if (!isset($this->values[$locale][$domain][$string])) {
            return $string;
        }

        return $this->values[$locale][$domain][$string];
    }
130405
public static function get($number, $locale/*, bool $triggerDeprecation = true*/)
    {
        if (3 > \func_num_args() || \func_get_arg(2)) {
            @trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.2.', __CLASS__), E_USER_DEPRECATED);
        }

        if ('pt_BR' === $locale) {
            // temporary set a locale for brazilian
            $locale = 'xbr';
        }

        if (\strlen($locale) > 3) {
            $locale = substr($locale, 0, -\strlen(strrchr($locale, '_')));
        }

        if (isset(self::$rules[$locale])) {
            $return = self::$rules[$locale]($number);

            if (!\is_int($return) || $return < 0) {
                return 0;
            }

            return $return;
        }

        /*
         * The plural rules are derived from code of the Zend Framework (2010-09-25),
         * which is subject to the new BSD license (http://framework.zend.com/license/new-bsd).
         * Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
         */
        switch ($locale) {
            case 'az':
            case 'bo':
            case 'dz':
            case 'id':
            case 'ja':
            case 'jv':
            case 'ka':
            case 'km':
            case 'kn':
            case 'ko':
            case 'ms':
            case 'th':
            case 'tr':
            case 'vi':
            case 'zh':
                return 0;

            case 'af':
            case 'bn':
            case 'bg':
            case 'ca':
            case 'da':
            case 'de':
            case 'el':
            case 'en':
            case 'eo':
            case 'es':
            case 'et':
            case 'eu':
            case 'fa':
            case 'fi':
            case 'fo':
            case 'fur':
            case 'fy':
            case 'gl':
            case 'gu':
            case 'ha':
            case 'he':
            case 'hu':
            case 'is':
            case 'it':
            case 'ku':
            case 'lb':
            case 'ml':
            case 'mn':
            case 'mr':
            case 'nah':
            case 'nb':
            case 'ne':
            case 'nl':
            case 'nn':
            case 'no':
            case 'oc':
            case 'om':
            case 'or':
            case 'pa':
            case 'pap':
            case 'ps':
            case 'pt':
            case 'so':
            case 'sq':
            case 'sv':
            case 'sw':
            case 'ta':
            case 'te':
            case 'tk':
            case 'ur':
            case 'zu':
                return (1 == $number) ? 0 : 1;

            case 'am':
            case 'bh':
            case 'fil':
            case 'fr':
            case 'gun':
            case 'hi':
            case 'hy':
            case 'ln':
            case 'mg':
            case 'nso':
            case 'xbr':
            case 'ti':
            case 'wa':
                return ((0 == $number) || (1 == $number)) ? 0 : 1;

            case 'be':
            case 'bs':
            case 'hr':
            case 'ru':
            case 'sh':
            case 'sr':
            case 'uk':
                return ((1 == $number % 10) && (11 != $number % 100)) ? 0 : ((($number % 10 >= 2) && ($number % 10 <= 4) && (($number % 100 < 10) || ($number % 100 >= 20))) ? 1 : 2);

            case 'cs':
            case 'sk':
                return (1 == $number) ? 0 : ((($number >= 2) && ($number <= 4)) ? 1 : 2);

            case 'ga':
                return (1 == $number) ? 0 : ((2 == $number) ? 1 : 2);

            case 'lt':
                return ((1 == $number % 10) && (11 != $number % 100)) ? 0 : ((($number % 10 >= 2) && (($number % 100 < 10) || ($number % 100 >= 20))) ? 1 : 2);

            case 'sl':
                return (1 == $number % 100) ? 0 : ((2 == $number % 100) ? 1 : (((3 == $number % 100) || (4 == $number % 100)) ? 2 : 3));

            case 'mk':
                return (1 == $number % 10) ? 0 : 1;

            case 'mt':
                return (1 == $number) ? 0 : (((0 == $number) || (($number % 100 > 1) && ($number % 100 < 11))) ? 1 : ((($number % 100 > 10) && ($number % 100 < 20)) ? 2 : 3));

            case 'lv':
                return (0 == $number) ? 0 : (((1 == $number % 10) && (11 != $number % 100)) ? 1 : 2);

            case 'pl':
                return (1 == $number) ? 0 : ((($number % 10 >= 2) && ($number % 10 <= 4) && (($number % 100 < 12) || ($number % 100 > 14))) ? 1 : 2);

            case 'cy':
                return (1 == $number) ? 0 : ((2 == $number) ? 1 : (((8 == $number) || (11 == $number)) ? 2 : 3));

            case 'ro':
                return (1 == $number) ? 0 : (((0 == $number) || (($number % 100 > 0) && ($number % 100 < 20))) ? 1 : 2);

            case 'ar':
                return (0 == $number) ? 0 : ((1 == $number) ? 1 : ((2 == $number) ? 2 : ((($number % 100 >= 3) && ($number % 100 <= 10)) ? 3 : ((($number % 100 >= 11) && ($number % 100 <= 99)) ? 4 : 5))));

            default:
                return 0;
        }
    }
140771
public static String getLocalizedId(String id, Locale locale) {
        String locstr = locale == null ? "" : ("_" + locale.toString());
        return id + locstr;
    }
298338
public function findByIdAndLocale($id, $locale)
    {
        $item = $this->itemRepository->findByIdAndLocale($id, $locale);

        if ($item) {
            return $this->itemFactory->createApiEntity($item, $locale);
        } else {
            return null;
        }
    }
1154738
static public function getJid( $domain, $node = NULL, $resource = NULL ){
		$jid	= $domain;
		if( strlen( trim( $node ) ) ) 
			$jid	= $node.'@'.$domain;
		if( strlen( trim( $resource ) ) )
			$jid	.= "/".$resource;
		return $jid;
	}
491520
public function findByIdAndLocale($id, $locale)
    {
        try {
            $qb = $this->getShippingQuery($locale);
            $qb->andWhere('shipping.id = :shippingId');
            $qb->setParameter('shippingId', $id);

            return $qb->getQuery()->getSingleResult();
        } catch (NoResultException $exc) {
            return null;
        }
    }
345934
public function trans($id, array $parameters = [], $domain = 'messages', $locale = null)
    {
        $line = Arr::get($this->lines, $id);

        if (is_null($line)) {
            return $id;
        }

        return $this->makeReplacements($line, $parameters);
    }
211790
public function transMultiple($messages, $parameters = [], $domain = null, $locale = null)
    {
        foreach ($messages as $message) {
            yield  $this->translator->trans($message, $parameters, $domain, $locale);
        }
    }
1212185
function (translationId, interpolateParams) {
        // If we have a handler factory - we might also call it here to determine if it provides
        // a default text for a translationid that can't be found anywhere in our tables
        if ($missingTranslationHandlerFactory) {
          var resultString = $injector.get($missingTranslationHandlerFactory)(translationId, $uses, interpolateParams);
          if (resultString !== undefined) {
            return resultString;
          } else {
            return translationId;
          }
        } else {
          return translationId;
        }
      }
732855
public function trans($id, array $parameters = [], $domain = null, $locale = null)
    {
        if (null === $locale) {
            $locale = $this->getLocale();
        }

        if (null === $domain) {
            $domain = 'messages';
        }

        if (!isset($this->catalogues[$locale])) {
            $this->loadCatalogue($locale);
        }

        // Change translation domain to 'messages' if a translation can't be found in the
        // current domain
        if ('messages' !== $domain && false === $this->catalogues[$locale]->has((string) $id, $domain)) {
            $domain = 'messages';
        }

        return strtr($this->catalogues[$locale]->get((string) $id, $domain), $parameters);
    }
696434
protected function translate($key, $params = null, $language = null) {
		return Translation :: translate($key, $params, $language, $this -> getViewmodel());
	}
1045072
public function getPlaceById($id, array $extensions = [], $language = null)
    {
        $this->validateExtension($extensions);
        $extensions = implode(',', $extensions);

        $body = array_merge(
            ['placeid' => $id],
            !empty($extensions) ? ['extensions' => $extensions] : [],
            null !== $language ? ['language' => $language] : []
        );

        return $this->get(self::URL, $body);
    }
1336512
protected function getTranslation($id, $domain, $locale, $fallbacks) {
		// Is initialize of the catalog need ?
		if (! isset($this->initializedCatalogs[$locale][$domain])) {
			$this->initCatalogs($locale, $domain);
		}
		
		// Is failure occurred ?
		if (! isset($this->catalogs[$locale][$domain][$id])) {
			if (empty($fallbacks)) {
				return;
			}
			
			$fallbackLocale = array_shift($fallbacks);
			
			return $this->getTranslation($id, $domain, $fallbackLocale, $fallbacks);
		}
		
		return $this->catalogs[$locale][$domain][$id];
	}