Sorry, I’m new here. I’m starting with the new version of Grocery CRUD Enterprise. I was using the old version (1.6.4) and because of that, I’m encountering various problems in the new one.
I found out that there is an error in the “validate.php” file in the “_get_language_mapping()” function
It happened to me that when I made an error in entering an item in the form, a text was displayed where the error description was in English, even though I had set “Czech”:
$crud->setLanguage('Czech');
I searched for what it could be and found that the translation was missing in the “vendor\vlucas\valitron\lang” directory. So I added the “cs.php” file. But the situation did not change.
So I searched further and found that there is an error in the “_get_language_mapping()” function regarding the evaluation of the “Czech” language.
The problem is that the abbreviation for this language is not “cz”, but “cs” and the incorrect abbreviation “cz” was not in the “if” statement where the check is performed.
So I added the line to the “$languageMapping” field:
'Czech' => 'cs',
And that’s how the error description started to be displayed in Czech ![]()