self::number($exact, $lang), '@total' => self::number($total, $lang), '@keys' => $keys, ]; if ($total === 0) { return $this->translation->translate('No results for “@keys”. Try other words or a broader description.', $args); } if ($exact === 0) { $args['@n'] = $args['@total']; return $this->translation->formatPlural($total, 'No exact result, @n close result for “@keys”', 'No exact result, @n close results for “@keys”', $args); } if ($total === 1) { return $this->translation->translate('1 exact result for “@keys”', $args); } return $this->translation->formatPlural($exact, '@n exact result out of @total relevant results for “@keys”', '@n exact results out of @total relevant results for “@keys”', $args); } /** * Message of the search page before any search. * * The former text, kept; its French translation is corrected by * materio_sapi_update_11002() ("le champ"). */ public function help(int $materials, string $lang): TranslatableMarkup { return $this->translation->translate('Please use the search form to search from our @count materials.', [ '@count' => self::number($materials, $lang), ]); } /** * A number with the thousands separator of the language. * * French: narrow no-break space (8 073); otherwise a comma (8,073). */ public static function number(int $value, string $lang): string { return number_format($value, 0, '', $lang === 'fr' ? "\u{202F}" : ','); } }