*/ public function customTranslations(string $language): array { switch ($language) { case 'en-AU': case 'en-GB': case 'en-US': // Note the special characters used in plural and context-sensitive translations. return [ 'Individual' => 'Fish', 'Individuals' => 'Fishes', '%s individual' . I18N::PLURAL . '%s individuals' => '%s fish' . I18N::PLURAL . '%s fishes', 'Unknown given name' . I18N::CONTEXT . 'â¦' => '?fish?', 'Unknown surname' . I18N::CONTEXT . 'â¦' => '?FISH?', ]; case 'fr': case 'fr-CA': return [ // These are new translations: 'Example module' => 'Exemple module', 'This module does not do anything' => 'Ce module ne fait rien', // These are updates to existing translations: 'Individual' => 'Poisson', 'Individuals' => 'Poissons', '%s individual' . I18N::PLURAL . '%s individuals' => '%s poisson' . I18N::PLURAL . '%s poissons', 'Unknown given name' . I18N::CONTEXT . 'â¦' => '?poission?', 'Unknown surname' . I18N::CONTEXT . 'â¦' => '?POISSON?', ]; case 'some-other-language': // Arrays are preferred, and are faster. // If your module uses .MO files, then you can convert them to arrays like this. return (new Translation('path/to/file.mo'))->asArray(); default: return []; } } }