Welcome Guest, Not a member yet? Register   Sign In
Language Bug
#2

(This post was last modified: 02-01-2020, 05:35 AM by zahhar.)

There is no bug.

CI4 returns key itself when this key cannot be found in referenced language file.

Docs say: "If the value doesn’t match a valid locale as defined in the App configuration file, the default locale will be used in it’s place." (https://codeigniter4.github.io/userguide...ation.html)

This is exactly your case. And it happens, because you added extra "Logout" prefix in your language file.

Create language file "app/Language/pt-BR/Logout.php", put the following content:

return [
"NoUser" => "User not found",
];

and use it: lang("Logout.NoUser", [], "pt-BR");

So you should use %Filename%.%Key% pattern in lang() function.
Also, if your key name is "Logout.NoUser", then you would call it "Logout.Logout.NoUser" Smile
Reply


Messages In This Thread
Language Bug - by ajmeireles - 01-28-2020, 07:04 PM
RE: Language Bug - by zahhar - 01-29-2020, 11:35 AM



Theme © iAndrew 2016 - Forum software by © MyBB