Language strings support in localization |
I find it pretty hard to come up with unique language keys for every text strings. Its very useful if we have language string support in localization.
for example: lang('My text string'); Also its better we cant have alternative method for lang() method. like __(). its more cleaner and minimalitic. Thanks.
You are not required to always put your translations in a language file. You can do it directly:
PHP Code: lang('The {0} is {1}.', ['fox', 'here]); // echoes "The fox is here." For the Code: __()
CI4 has a great online manual, you should always first look there and only afterwards flooding this forum.
https://codeigniter4.github.io/CodeIgnit...ation.html I don't recommend and i don't support idea of "__()". That function has no general meaning, purpose, understanding what it stands for, will make more confusion than useability. That would be really bad to implement in CI4.
I'm with davis.lasis on this one.
lang() is only 4 letters. I don't see how __() is an improvement. Also, double underscores an reserved for magic methods: https://www.php.net/manual/en/language.oop5.magic.php
CodeIgniter 4 tutorials (EN/FR) - https://includebeer.com
/*** NO support in private message - Use the forum! ***/
|
Welcome Guest, Not a member yet? Register Sign In |