My simple #PHP #library for localization
A light weight and path-based PHP localization library that translations are loaded up when needed.
My simple #PHP #library for localization
A light weight and path-based PHP localization library that translations are loaded up when needed.
For further actions, you may consider blocking this person and/or reporting abuse
MD ARIFUL HAQUE -
Rafael Pinto -
Ehtesham Ali -
Syahril Zulkefli -
Top comments (1)
I am not a big fan of using arrays as config if it only has one level. So as an exercise I thought about the most light weight way to have translations.
I came up with enums.
This setup allows you to use it as in following examples;
When the output requires multiple scopes, just create an array and get the string from the scope you want.
PS: this only works in PHP 8.3 because the trait uses dynamic class constant fetch.
Some comments have been hidden by the post's author - find out more