Retourne le contenu généré pour le fichier des traductions (en français).

@param  string  $singular
@param  string  $plural
@param  boolean $feminine
@return array
513269
protected function getLangContent($singular, $plural, $feminine)
    {
        if (!$stub = $this->getLangStub()) {
            return '';
        }

        $lcfSingular     = lcfirst($singular);
        $lcfPlural       = lcfirst($plural);
        $startsWithVowel = starts_with($lcfSingular, ['a', 'e', 'i', 'o', 'u']);
        $lcfDefArticle   = ($startsWithVowel ? "l’" : ($feminine ? 'la ' : 'le '));
        $ucfDefArticle   = ucfirst($lcfDefArticle);
        $lcfUndefArticle = ($feminine ? 'une' : 'un');

        return strtr($stub, [
            '{{storeSuccess}}'     => "{$ucfDefArticle}$lcfSingular a été ".($feminine ? 'créée' : 'créé')." avec succès.",
            '{{updateSuccess}}'    => "{$ucfDefArticle}$lcfSingular a été ".($feminine ? 'mise' : 'mis')." à jour avec succès.",
            '{{enableSuccess}}'    => "{$ucfDefArticle}$lcfSingular a été ".($feminine ? 'activée' : 'activé')." avec succès.",
            '{{disableSuccess}}'   => "{$ucfDefArticle}$lcfSingular a été ".($feminine ? 'désactivée' : 'désactivé')." avec succès.",
            '{{sortSuccess}}'      => "L’ordre des $lcfPlural a été modifié avec succès.",
            '{{destroySuccess}}'   => "{$ucfDefArticle}$lcfSingular a été ".($feminine ? 'supprimée' : 'supprimé')." avec succès.",
            '{{destroyFailure}}'   => "Suppression impossible : {$lcfDefArticle}$lcfSingular est peut-être ".($feminine ? 'liée' : 'lié')." à d’autres enregistrements.",
            '{{countZero}}'        => ($feminine ? 'aucune' : 'aucun')." $singular",
            '{{countOne}}'         => "$lcfUndefArticle $singular",
            '{{countMany}}'        => ":count $plural",
            '{{breadcrumbsIndex}}' => ucfirst($lcfPlural),
            '{{listTitle}}'        => "Liste des $lcfPlural",
            '{{listSummary}}'      => "Liste des :count $lcfPlural de <strong>:firstItem à :lastItem</strong> sur un total de :total.",
            '{{listSummarySimple}}'=> ":count $lcfPlural de <strong>:firstItem à :lastItem</strong> sur :total",
            '{{statusActive}}'     => ($feminine ? trans('common::status.active_fem') : trans('common::status.active')),
            '{{statusInactive}}'   => ($feminine ? trans('common::status.inactive_fem') : trans('common::status.inactive')),
            '{{listEmpty}}'        => "Il n’y a ".($feminine ? 'aucune' : 'aucun')." $lcfSingular à afficher.",
            '{{createButton}}'     => ($feminine ? 'Nouvelle' : ($startsWithVowel ? 'Nouvel' : 'Nouveau'))." $lcfSingular",
            '{{editTooltip}}'      => "Modifier {$lcfDefArticle}$lcfSingular «&nbsp;:name&nbsp;».",
            '{{enableTooltip}}'    => "Activer {$lcfDefArticle}$lcfSingular «&nbsp;:name&nbsp;».",
            '{{disableTooltip}}'   => "Désactiver {$lcfDefArticle}$lcfSingular «&nbsp;:name&nbsp;».",
            '{{destroyTooltip}}'   => "Supprimer {$lcfDefArticle}$lcfSingular «&nbsp;:name&nbsp;».",
            '{{destroyConfirm}}'   => "Êtes-vous sûr de vouloir supprimer {$lcfDefArticle}$lcfSingular «&nbsp;:name&nbsp;»&nbsp;?",
            '{{createTitle}}'      => "Création d’{$lcfUndefArticle} ".($feminine ? 'nouvelle' : ($startsWithVowel ? 'nouvel' : 'nouveau'))." $lcfSingular",
            '{{createFormTitle}}'  => ($feminine ? 'Nouvelle' : ($startsWithVowel ? 'Nouvel' : 'Nouveau'))." $lcfSingular",
            '{{editTitle}}'        => "Modification d’{$lcfUndefArticle} $lcfSingular",
            '{{editFormTitle}}'    => "Modification d’{$lcfUndefArticle} $lcfSingular",
        ]);
    }
268970
protected function getPluralIndex(callable $pluralForm, $number)
    {
        $nplurals = 0;
        $plural = 0;

        call_user_func_array($pluralForm, [&$nplurals, &$plural, $number]);

        if (is_bool($plural)) {
            $plural = $plural ? 1 : 0;
        }

        if ($plural < 0) {
            $plural = 0;
        }

        if ($plural > $nplurals - 1) {
            $plural = $nplurals - 1;
        }

        return $plural;
    }
1027432
public function dnpgettext($domain, $context, $original, $plural, $value)
    {
        $translation = $this->getTranslation($domain, $context, $original);
        $key = $this->getPluralIndex($domain, $value, $translation === false);

        if (isset($translation[$key]) && $translation[$key] !== '') {
            return $translation[$key];
        }

        return ($key === 0) ? $original : $plural;
    }
1331220
public static function pluralize($word)
    {
        $lowerCasedWord = strtolower($word);
        foreach (static::$uncountables as $uncountable) {
            if (substr($lowerCasedWord, (-1 * strlen($uncountable))) == $uncountable) {
                return $word;
            }
        }
        foreach (static::$irregulars as $plural => $singular) {
            if (preg_match('/(' . $plural . ')$/i', $word, $arr)) {
                return preg_replace(
                    '/(' . $plural . ')$/i',
                    substr($arr[0], 0, 1) . substr($singular, 1),
                    $word
                );
            }
        }
        foreach (static::$plurals as $rule => $replacement) {
            if (preg_match($rule, $word)) {
                return preg_replace($rule, $replacement, $word);
            }
        }

        return false;
    }
376312
public function name($plural = false)
    {
        if (Lang::has('panel::entities.'.$this->name)) {
            return trans_choice('panel::entities.'.$this->name, $plural ? 2 : 1);
        } else {
            return $plural ? str_plural(ucwords($this->name)) : ucwords($this->name);
        }
    }
881914
public static function pluralise($word)
    {
        // Run each rule over the word
        foreach (static::$pluralRules as $rule => $replacement) {
            if (preg_match($rule, $word)) {
                return preg_replace($rule, $replacement, $word);
            }
        }

        return $word;
    }
239710
public function make_plural_form_function($nplurals, $expression)
    {
        try {
            $handler = new PluralForms(rtrim($expression, ';'));

            return array($handler, 'get');
        } catch (\Exception $e) {
            // Fall back to default plural-form function.
            return $this->make_plural_form_function(2, 'n != 1');
        }
    }
1197335
def singularize(plural):
    
    if plural in UNCOUNTABLES:
        return plural
    for i in IRREGULAR:
        if i[1] == plural:
            return i[0]
    for i in SINGULARIZE_PATTERNS:
        if re.search(i[0], plural):
            return re.sub(i[0], i[1], plural)
    return plural
1096343
public static function export_entry(EntryTranslations &$entry)
    {
        if (null === $entry->singular || '' === $entry->singular) {
            return false;
        }
        $po = array();
        if (!empty($entry->translator_comments)) {
            $po[] = self::comment_block($entry->translator_comments);
        }
        if (!empty($entry->extracted_comments)) {
            $po[] = self::comment_block($entry->extracted_comments, '.');
        }
        if (!empty($entry->references)) {
            $po[] = self::comment_block(implode(' ', $entry->references), ':');
        }
        if (!empty($entry->flags)) {
            $po[] = self::comment_block(implode(', ', $entry->flags), ',');
        }
        if (!is_null($entry->context)) {
            $po[] = 'msgctxt ' . self::poify($entry->context);
        }
        $po[] = 'msgid ' . self::poify($entry->singular);
        if (!$entry->is_plural) {
            $translation = empty($entry->translations) ?
                '' :
                $entry->translations[0];
            $translation = self::match_begin_and_end_newlines($translation, $entry->singular);
            $po[] = 'msgstr ' . self::poify($translation);
        } else {
            $po[] = 'msgid_plural ' . self::poify($entry->plural);
            $translations = empty($entry->translations) ?
                array('', '') :
                $entry->translations;
            foreach ($translations as $i => $translation) {
                $translation = self::match_begin_and_end_newlines($translation, $entry->plural);
                $po[] = "msgstr[$i] " . self::poify($translation);
            }
        }

        return implode("\n", $po);
    }
24545
public function inflectNounByNumber($number, $singular, $plural, $genitivePlural)
    {
        $units = $number % 10;
        $tens = ((int) ($number / 10)) % 10;

        if ($number === 1) {
            return $singular;
        }

        if ($tens === 1 && $units > 1) {
            return $genitivePlural;
        }

        if ($units >= 2 && $units <= 4) {
            return $plural;
        }

        return $genitivePlural;
    }
172787
public static function pluralize($word) {
        foreach(self::$_exceptions as $exception) {
			if($exception['singular'] == $word){
				return $exception['plural'];
			}
        }

        return parent::pluralize($word);
	}
738722
public function defaultLabels($plural, $singular)
    {
        return [
            'name' => $plural,
            'singular_name' => $singular,
            'menu_name' => $plural,
            'all_items' => $plural,

            'add_new' => Translate::t('posttype.defaults.labels.add_new'),
            'add_new_item' => Translate::t('posttype.defaults.labels.add_new_item'),
            'edit' => Translate::t('posttype.defaults.labels.edit'),
            'edit_item' => Translate::t('posttype.defaults.labels.edit_item'),
            'new_item' => Translate::t('posttype.defaults.labels.new_item'),

            'not_found' => Translate::t('posttype.defaults.labels.not_found'),
            'not_found_in_trash' => Translate::t('posttype.defaults.labels.not_found_in_trash'),
            'parent_item_colon' => Translate::t('posttype.defaults.labels.parent_item_colon'),
            'search_items' => Translate::t('posttype.defaults.labels.search_items'),

            'view' => Translate::t('posttype.defaults.labels.view'),
            'view_item' => Translate::t('posttype.defaults.labels.view_item'),
        ];
    }
1237
private function get_plural_forms() {
        // lets assume message number 0 is header
        // this is true, right?
        $this->load_tables();

        // cache header field for plural forms
        if (!is_string($this->pluralheader)) {
            if ($this->enable_cache) {
                $header = $this->cache_translations[""];
            }
            else {
                $header = $this->get_translation_string(0);
            }
            if (preg_match("/plural\-forms: ([^\n]*)\n/i", $header, $regs))
                $expr = $regs[1];
            else
                $expr = "nplurals=2; plural=n == 1 ? 0 : 1;";
            $this->pluralheader = $expr;
        }
        return $this->pluralheader;
    }
625486
public static function jsonField($plural = false)
    {
        $field = explode('\\', get_called_class());
        $field = lcfirst(end($field));
        return $plural ? $field . "s" : $field;
    }
975542
public static function makePlural($singular)
    {
        $singulars = [
            'ey' => 'eys',
            'day' => 'days',
            "ch" => "ches",
            "s" => "ses",
            "x" => "xes",
            "y" => "ies",
        ];

        foreach ($singulars as $singularEnding => $pluralEnding) {
            if (preg_match("/" . $singularEnding . "$/i", $singular)) {
                return preg_replace("/" . $singularEnding . "$/i", $pluralEnding, $singular);
            }
        }

        return $singular . "s";
    }
849599
public static function pluralize(string $noun, ?int $count = null): string
	{
		if($count !== 1)
		{
			if(isset(static::$irregulars[$noun]))
			{
				$noun = static::$irregulars[$noun];
			}
			else
			{
				foreach(static::$pluralizationRules as $search => $replace)
				{
					if(preg_match($search, $noun))
					{
						$noun = preg_replace($search, $replace, $noun);

						break;
					}
				}
			}
		}

		return $noun;
	}
1287372
public function dngettext($domain, $original, $plural, $value)
    {
        return \dngettext($domain, $original, $plural, $value);
    }