-
olor
-
Auteur du sujet
-
Hors Ligne
-
Membre junior
-
-
chen guo
-
Messages : 127
-
-
-
|
My code on the website contains (% 2 $s) and (% 1 $d). The English part is consistent with other languages. I only modified the code behind “=>”.
/**
* Additional/updated translations.
*
* @param string $language
*
* @return string[]
*/
public function customTranslations(string $language) : array
{
// Here we are using an array for translations.
// If you had .MO files, you could use them with:
// return (new Translation('path/to/file.mo'))->asArray();
switch ($language) {
case 'da':
return $this->danishTranslations();
case 'fi':
return $this->finnishTranslations();
case 'fr':
case 'fr-CA':
return $this->frenchTranslations();
case 'he':
return $this->hebrewTranslations();
case 'lt':
return $this->lithuanianTranslations();
case 'nb':
return $this->norwegianBokmålTranslations();
case 'nl':
return $this->dutchTranslations();
case 'nn':
return $this->norwegianNynorskTranslations();
case 'sv':
return $this->swedishTranslations();
case 'cs':
return $this->czechTranslations();
case 'de':
return $this->germanTranslations();
case 'zh-Hans':
return $this->hansTranslations();
case 'zh-Hant':
return $this->hantTranslations();
default:
return [];
}
}
/**
* @return array
*/
protected function lithuanianTranslations() : array
{
// Note the special characters used in plural and context-sensitive translations.
return [
'Cousins' => 'Pusbroliai / Pusseserės',
'A tab showing cousins of an individual.' => 'Lapas rodantis asmens pusbrolius ir pusseseres.',
'No family available' => 'Šeima nerasta',
'Father\'s family (%s)' => 'Tėvo šeima (%s)',
'Mother\'s family (%s)' => 'Motinos šeima (%s)',
'%2$s has %1$d first cousin recorded'
. I18N::PLURAL . '%2$s has %1$d first cousins recorded' => '%2$s turi %1$d įrašyta pirmos eilės pusbrolį/pusseserę'
. I18N::PLURAL . '%2$s turi %1$d įrašytus pirmos eilės pusbrolius/pusseseres'
. I18N::PLURAL . '%2$s turi %1$d įrašytų pirmos eilės pusbrolių/pusseserių',
];
}
/**
* @return array
*/
protected function germanTranslations() : array
{
// Note the special characters used in plural and context-sensitive translations.
return [
'Cousins' => 'Cousins und Cousinen',
'A tab showing cousins of an individual.' => 'Ein Reiter, der Cousins und Cousinen der Person anzeigt.',
'No family available' => 'Es gibt keine Familie',
'Father\'s family (%s)' => 'Väterlicherseits (%s)',
'Mother\'s family (%s)' => 'Mütterlicherseits (%s)',
'%2$s has %1$d first cousin recorded'
. I18N::PLURAL . '%2$s has %1$d first cousins recorded' => '%2$s hat einen Cousin oder eine Cousine ersten Grades'
. I18N::PLURAL . '%2$s hat %1$d Cousins oder Cousinen ersten Grades',
];
}
/**
* @return array
*/
protected function danishTranslations() : array
{
// Note the special characters used in plural and context-sensitive translations.
return [
'Cousins' => 'Fætre og kusiner',
'A tab showing cousins of an individual.' => 'En fane der viser en persons fætre og kusiner.',
'No family available' => 'Ingen familie tilgængelig',
'Father\'s family (%s)' => 'Fars familie (%s)',
'Mother\'s family (%s)' => 'Mors familie (%s)',
'%2$s has %1$d first cousin recorded'
. I18N::PLURAL . '%2$s has %1$d first cousins recorded' => '%2$s har %1$d registreret fæter eller kusin'
. I18N::PLURAL . '%2$s har %1$d registrerede fæter eller kusiner',
];
}
/**
* @return array
*/
protected function frenchTranslations() : array
{
// Note the special characters used in plural and context-sensitive translations.
return [
'Cousins' => 'Cousins',
'A tab showing cousins of an individual.' => 'Onglet montrant les cousins d\'un individu.',
'No family available' => 'Pas de famille disponible',
'Father\'s family (%s)' => 'Famille paternelle (%s)',
'Mother\'s family (%s)' => 'Famille maternelle (%s)',
'%2$s has %1$d first cousin recorded'
. I18N::PLURAL . '%2$s has %1$d first cousins recorded' => '%2$s a %1$d cousin germain connu'
. I18N::PLURAL . '%2$s a %1$d cousins germains connus',
];
}
/**
* @return array
*/
protected function finnishTranslations() : array
{
// Note the special characters used in plural and context-sensitive translations.
return [
'Cousins' => 'Serkut',
'A tab showing cousins of an individual.' => 'Välilehti joka näyttää henkilön serkut.',
'No family available' => 'Perhe puuttuu',
'Father\'s family (%s)' => 'Isän perhe (%s)',
'Mother\'s family (%s)' => 'Äidin perhe (%s)',
'%2$s has %1$d first cousin recorded'
. I18N::PLURAL . '%2$s has %1$d first cousins recorded' => '%2$s:llä on %1$d serkku sivustolla'
. I18N::PLURAL . '%2$s:lla on %1$d serkkua sivustolla',
];
}
/**
* @return array
*/
protected function hebrewTranslations() : array
{
// Note the special characters used in plural and context-sensitive translations.
return [
'Cousins' => 'בני דודים',
'A tab showing cousins of an individual.' => 'חוצץ המראה בני דוד של אדם.',
'No family available' => 'משפחה חסרה',
'Father\'s family (%s)' => 'משפחת האב (%s)',
'Mother\'s family (%s)' => 'משפחת האם (%s)',
'%2$s has %1$d first cousin recorded'
. I18N::PLURAL . '%2$s has %1$d first cousins recorded' => 'ל%2$s יש בן דוד אחד מדרגה ראשונה'
. I18N::PLURAL . 'ל%2$s יש %1$d בני דודים מדרגה ראשונה',
];
}
/**
* @return array
*/
protected function norwegianBokmålTranslations() : array
{
// Note the special characters used in plural and context-sensitive translations.
return [
'Cousins' => 'Søskenbarn',
'A tab showing cousins of an individual.' => 'Fane som viser en persons søskenbarn.',
'No family available' => 'Ingen familie tilgjengelig',
'Father\'s family (%s)' => 'Fars familie (%s)',
'Mother\'s family (%s)' => 'Mors familie (%s)',
'%2$s has %1$d first cousin recorded'
. I18N::PLURAL . '%2$s has %1$d first cousins recorded' => '%2$s har %1$d registrert søskenbarn'
. I18N::PLURAL . '%2$s har %1$d registrerte søskenbarn',
];
}
/**
* @return array
*/
protected function norwegianNynorskTranslations() : array
{
// Note the special characters used in plural and context-sensitive translations.
return [
'Cousins' => 'Syskenbarn',
'A tab showing cousins of an individual.' => 'Fane som syner ein person sine syskenbarn.',
'No family available' => 'Ingen familie tilgjengeleg',
'Father\'s family (%s)' => 'Fars familie (%s)',
'Mother\'s family (%s)' => 'Mors familie (%s)',
'%2$s has %1$d first cousin recorded'
. I18N::PLURAL . '%2$s has %1$d first cousins recorded' => '%2$s har %1$d registrert syskenbarn'
. I18N::PLURAL . '%2$s har %1$d registrerte syskenbarn',
];
}
/**
* @return array
*/
protected function dutchTranslations() : array
{
// Note the special characters used in plural and context-sensitive translations.
return [
'Cousins' => 'Neven en Nichten',
'A tab showing cousins of an individual.' => 'Tab laat neven en nichten van deze persoon zien.',
'No family available' => 'Geen familie gevonden',
'Father\'s family (%s)' => 'Vader\'s familie (%s)',
'Mother\'s family (%s)' => 'Moeder\'s familie (%s)',
'%2$s has %1$d first cousin recorded'
. I18N::PLURAL . '%2$s has %1$d first cousins recorded' => '%2$s heeft %1$d neef of nicht in de eerste lijn'
. I18N::PLURAL . '%2$s heeft %1$d neven en nichten in de eerste lijn',
];
}
/**
* @return array
*/
protected function swedishTranslations() : array
{
// Note the special characters used in plural and context-sensitive translations.
return [
'Cousins' => 'Kusiner',
'A tab showing cousins of an individual.' => 'En flik som visar en persons kusiner.',
'No family available' => 'Familj saknas',
'Father\'s family (%s)' => 'Faderns familj (%s)',
'Mother\'s family (%s)' => 'Moderns familj (%s)',
'%2$s has %1$d first cousin recorded'
. I18N::PLURAL . '%2$s has %1$d first cousins recorded' => '%2$s har %1$d registrerad kusin'
. I18N::PLURAL . '%2$s har %1$d registrerade kusiner',
];
}
/**
* @return array
*/
protected function czechTranslations() : array
{
// Note the special characters used in plural and context-sensitive translations.
return [
'Cousins' => 'Bratranci',
'A tab showing cousins of an individual.' => 'Panel zobrazující bratrance osoby.',
'No family available' => 'Rodina chybí',
'Father\'s family (%s)' => 'Otcova rodina (%s)',
'Mother\'s family (%s)' => 'Matčina rodina (%s)',
'%2$s has %1$d first cousin recorded'
. I18N::PLURAL . '%2$s has %1$d first cousins recorded' => '%2$s má %1$d bratrance'
. I18N::PLURAL . '%2$s má %1$d bratrance'
. I18N::PLURAL . '%2$s má %1$d bratranců',
];
}
/**
* @return array
*/
protected function HansTranslations() : array
{
// Note the special characters used in plural and context-sensitive translations.
return [
'Cousins' => '堂表亲',
'A tab showing cousins of an individual.' => '显示个人表亲的标签。',
'No family available' => '没有表亲记录',
'Father\'s family (%s)' => '父亲的家庭 (%s)',
'Mother\'s family (%s)' => '母亲的家庭 (%s)',
'%2$s has %1$d first cousin recorded'
. I18N::PLURAL . '%2$s has %1$d first cousins recorded' => '%2$s 有 %1$d 个第一代堂表亲记录'
. I18N::PLURAL . '%2$s 有 %1$d 个第一代堂表亲',
];
}
/**
* @return array
*/
protected function HantTranslations() : array
{
// Note the special characters used in plural and context-sensitive translations.
return [
'Cousins' => '堂表亲',
'A tab showing cousins of an individual.' => '显示个人表亲的标签。',
'No family available' => '没有表亲记录',
'Father\'s family (%s)' => '父亲的家庭 (%s)',
'Mother\'s family (%s)' => '母亲的家庭 (%s)',
'%2$s has %1$d first cousin recorded'
. I18N::PLURAL . '%2$s has %1$d first cousins recorded' => '%2$s 有%1$d个第一代堂表亲'
. I18N::PLURAL . '%2$s 有 %1$d 个第一代堂表亲',
];
}
It is very strange that other languages can translate the correct results, and other labels in Chinese functions can also be translated correctly, except for the title with two wildcards, which only replaces the two values of individual and number, and the language has not been translated.
|