2
votes

La traduction d'un titre dans Laravel ne fonctionne pas

J'ai reçu cette notification ( resources / views / vendor / notifications / email.blade.php ):

{ 
    "If you’re having trouble clicking the \":actionText\" button, 
    copy and paste the URL below into your web browser: [:actionURL] . 
    (:actionURL)": "Falls Du Probleme dabei hast, den \":actionText\" 
    Button anzuklicken, rufe folgende URL auf: [:actionURL](:actionURL)"
}

J'aimerais maintenant traduire celle-là en utilisant de.json dans resource/lang-directory:

@lang( "If you’re having trouble clicking the ":actionText" button, 
    copy and paste the URL below\n". 'into your web browser: 
    :actionURL', [ 'actionText' => $actionText, 'actionURL' => $actionUrl])

Toutes les autres traductions que j'ai créées de cette façon fonctionnent bien . Comment puis-je résoudre ce problème?


0 commentaires

3 Réponses :


2
votes

Supprimez simplement le point de concaténation et mettez tous les mots dans la même chaîne, comme ceci:

{

"If you’re having trouble clicking the \":actionText\" button, copy and paste the URL below\ninto your web browser: [:actionURL](:actionURL)" : "Caso não seja possível clicar no botão \":actionText\", copie e cole no seu navegador o endereço a seguir: [:actionUrl](:actionUrl) \n",

}


1 commentaires

Je viens de passer à Laravel 5.5, j'ai eu ce problème et cette réponse a résolu mon problème. Pourquoi la concaténation affecterait-elle la création de modèles?



0
votes

Si vous utilisez laravel 6,7, essayez de supprimer ": actionURL" exemple:

"If you’re having trouble clicking the \":actionText\" button, copy and paste the URL below\ninto your web browser: ": "Falls Du Probleme dabei hast, den \":actionText\" Button anzuklicken,\nrufe folgende URL auf: "


0 commentaires

0
votes

dans laravel 6 ou supérieur, vous pouvez l'utiliser dans le fichier lang.json:

"If you’re having trouble clicking the \":actionText\" button, copy and paste the URL below\ninto your web browser:": "translation into your favorite language"

pas besoin d'utiliser ['actionText' => $ actionText,] code > à la fin du message


0 commentaires