You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For vendor\laravel\framework\src\Illuminate\Translation\Translator.php, i dump $this->loaded
public function get($key, array $replace = [], $locale = null, $fallback = true)
{
$locale = $locale ?: $this->locale;
// For JSON translations, there is only one file per locale, so we will simply load
// that file and then we will be ready to check the array for the key. These are
// only one level deep so we do not need to do any fancy searching through it.
$this->load('*', '*', $locale);
$line = $this->loaded['*']['*'][$locale][$key] ?? null;
dump($line);
dump($this->loaded);
I see that in $this->loaded['* '], there is two value "*" and "validation" :
For vendor\laravel\framework\src\Illuminate\Translation\Translator.php, when i change $line = $this->loaded['*']['*'][$locale][$key] ?? null;
by $line = $this->loaded['*']['validation'][$locale][$key] ?? null;
empty is well translated, the message is Le champ utilisateurs est obligatoire quand la valeur de Unité responsable est vide.
So, Laravel problem or tcg Voyager problems ?
Expected behavior
Two errors message should be displayed. :
My custom message for "unité"
My custom message for "Contributeurs"
Screenshots
No response
Additional context
No response
The text was updated successfully, but these errors were encountered:
Laravel version
10.48.12
PHP version
8.3.3
Voyager version
1.7
Database
MariaDB 13.2
Description
I see a partial translation when using a validation rule required_if
Steps to reproduce
In the Bread, I use this validation rule for "unite_id" field :
I use this validation rule for "Contributeurs" relation field :
When i add datas, the message displayed is
Le champ Contributeurs 1 est obligatoire quand la valeur de Unité responsable est empty.
2 problems :
Do you think it's Laravel problem or tcg Voyager problems ?
For the first problem, in vendor\laravel\framework\src\Illuminate\Validation\Concerns\ReplacesAttributes.php, i add $this->translator->get()
For vendor\laravel\framework\src\Illuminate\Translation\Translator.php, i dump $this->loaded
I see that in $this->loaded['* '], there is two value "*" and "validation" :
For vendor\laravel\framework\src\Illuminate\Translation\Translator.php, when i change
$line = $this->loaded['*']['*'][$locale][$key] ?? null;
by
$line = $this->loaded['*']['validation'][$locale][$key] ?? null;
empty is well translated, the message is
Le champ utilisateurs est obligatoire quand la valeur de Unité responsable est vide.
So, Laravel problem or tcg Voyager problems ?
Expected behavior
Two errors message should be displayed. :
Screenshots
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: