Get the plural form to be used.

If $quantity is numeric and non-NULL, the plural form for provided $locale will be
chosen according to it.

In all other cases, NULL is returned.

@param mixed $quantity
@param Locale $locale
@return string
556337
protected function getPluralForm($quantity, Locale $locale)
    {
        if (!is_numeric($quantity)) {
            return null;
        } else {
            return $this->pluralsReader->getPluralForm($quantity, $locale);
        }
    }
1150214
public function getPriceFormatted($locale = null)
    {
        return $this->priceFormatter->format((float)$this->entity->getPrice(), null, $locale);
    }
309784
public function plural($string, $count = 1)
    {
        $localise = $this->getLocalise($this->locale);

        // Get language plural handles
        $suffix = $localise->getPluralSuffix((int) $count);

        if ($suffix || $suffix == 0) {
            $key = $string . '_' . $suffix;

            if ($this->exists($key)) {
                $string = $key;
            }
        }

        // If current locale do not have singular & plural string
        // We try to do same thing to default locale
        if (!$this->exists($string)) {
            // Find default localise
            $localise = $this->getLocalise($this->defaultLocale);

            // Get language plural handles
            $suffix = $localise->getPluralSuffix((int) $count);

            if ($suffix || $suffix == 0) {
                $key = $string . '_' . $suffix;

                if ($this->exists($key)) {
                    $string = $key;
                }
            }
        }

        // If more arguments exists, use sprintf()
        $args = func_get_args();

        unset($args[1]);

        if (count($args) > 1) {
            $args[0] = $string;

            $offset = $this->traceLevelOffset = $this->traceLevelOffset + 2;

            $result = call_user_func_array([$this, 'sprintf'], $args);

            $this->traceLevelOffset = $offset;

            return $result;
        }

        // Fallback to default translate
        $offset = $this->traceLevelOffset++;

        $result = $this->translate($string);

        $this->traceLevelOffset = $offset;

        return $result;
    }
288131
public static function localized_field($field, $locale = null)
    {
        if ($locale === null) {
            $locale = Translatable::get_current_locale();
        }
        if ($locale == Translatable::default_locale()) {
            return $field;
        }
        return $field . TRANSLATABLE_COLUMN_SEPARATOR . $locale;
    }
325337
private function locale2handle (string $locale): string
	{
		if (
			!preg_match('/^' . HandleValidator::$handlePattern . '$/', $locale) ||
			in_array(strtolower($locale), HandleValidator::$baseReservedWords, true)
		) {
			$localeParts = array_filter(preg_split('/[^a-zA-Z0-9]/', $locale));

			return $localeParts ? '_' . implode('_', $localeParts) : '';
		}

		return $locale;
	}
1301083
public static function pluralize($count = 1, $singular, $plural = null)
    {
        if ($count == 1) {
            return $singular;
        }

        return is_null($plural) ? Inflector::pluralize($singular) : $plural;
    }
53234
public function findUsagesByLocales( $locale = null )
    {
        if ( empty( $locale ) )
        {
            $locale = $this->getLocale();
        }

        return $this->getMapper()
                    ->findUsagesByLocales( (array) $locale );
    }
683336
protected function initLocale($locale)
    {
        $file = $this->localeDir . '/' . $locale . '.php';
        if (file_exists($file)) {
            $data = include $file;

            if (!is_array($data)) {
                $data = [];
            }
        } else {
            $data = [];
        }

        if (!isset($data['pluralForm']) || !is_callable($data['pluralForm'])) {
            $data['pluralForm'] = null;
        }
        if (!isset($data['texts'])) {
            $data['texts'] = [];
        }

        $this->data[$locale] = $data;
    }
1355686
public function getTranslationFile($locale)
    {
        if (isset($this->locales[$locale]) === false) {
            return null;
        }

        return $this->locales[$locale];
    }
45513
public function getLabel($locale = null)
    {
        $locale = null === $locale ? Yii::$app->language : $locale;

        return $this->provider->getLanguageLabel($locale);
    }
1211232
private static final String getNlsKey(String resourceBundle, Locale locale) {
        return new StringBuffer(resourceBundle).append("#").append(locale.toString()).toString();
    }
218468
public static function ordinalize($number, $locale = 'en')
    {
        $ordinal = new Ordinal($number, $locale);
     
        return (string) ($ordinal->isPrefix()) ? $ordinal.$number : $number.$ordinal;
    }
637987
public function getTotalRecurringPriceFormatted($locale = null)
    {
        return $this->priceFormatter->format((float)$this->entity->getTotalRecurringPrice(), null, $locale);
    }
1353649
public static function getRegion($locale)
    {
        $parts = explode('-', str_replace('_', '-', $locale));

        if (count($parts) === 1) {
            return '';
        }

        $region = end($parts);

        if (strlen($region) === 4) {
            return '';
        }

        if ($region === 'POSIX') {
            $region = 'US';
        }

        return strtoupper($region);
    }
1145515
public static function plural($count, $single, $plural = null)
	{
		if (\is_null($plural)) {
			$plural = $single.'s';
		}
		return $count == 1
			? $single
			: $plural;
	}
891044
function languageNameFromLocale( $locale )
    {
         $pos = strpos( $locale , "-");
         $languageName = substr( $locale , 0, $pos );
         return $languageName;
    }
673468
public function getTotalPriceFormatted($locale = null)
    {
        return $this->priceFormatter->format((float)$this->entity->getTotalPrice(), null, $locale);
    }