php-i18n icon indicating copy to clipboard operation
php-i18n copied to clipboard

Simple i18n class for PHP with caching and and ini, json and yaml support

Results 11 php-i18n issues
Sort by recently updated
recently updated
newest added

Keys are now case-insensitive making the matching of keys in the language files and in code more forgiving regarding differences in upper- and lowercase writing. Also when using the helper...

Is there a solution, how I can switch language during script execution? I have the case where I send Emails/Notifications to the users by a cron script, depending on the...

help-wanted

I have an ini file that looks like this: ``` [general] ... yes = "Yes" no = "No" ``` When I reload my page, there is this error: ``` Warning:...

help-wanted
bug

``` Fatal error: Uncaught Error: Call to undefined function i18n\spyc_load_file() in /home/pablo/GitHub/trauma-emr-proto/i18n/I18n.php:302 Stack trace: #0 /home/pablo/GitHub/trauma-emr-proto/i18n/I18n.php(149): i18n\I18n->load('/home/pablo/Git...') #1 /home/pablo/GitHub/trauma-emr-proto/index.php(139): i18n\I18n->init() #2 {main} thrown in /home/pablo/GitHub/trauma-emr-proto/i18n/I18n.php on line 302 ```

help-wanted
bug
easy

When a term doesn't exists I'm getting an exception "Fatal error: Uncaught Error: Undefined class constant". It happens when two lang files exist but one has missing translations.

In the doc, there is this example: `echo L::last_modified("today");` That seems to output a text with the "today" replaced using some kind of variable name, but in the sample lang...

For example like this: 1- Add to lang_en.ini stringswithvar = "Test1: %1$s" stringswithvars = "Test_number: %1$s Test_string: %2$s" 2.- Add to lang_en.json "stringswithvar": "Test1: %1$s" "stringswithvars": "Test_number: %1$s Test_string:%2$s" 3.-...

help-wanted
documentation
easy

The documentation says : ` $i18n->setForcedLang('en'); // force english, even if another user language is available ` But in `i18n.class.php` the variable `$forcedLang` is never used. Maybe in the init()...

I have noticed that translating characters which contains "&" sign should be properly scaped Example: `\"%word1%,word2%\"` to output `"%word1%,word2%` But maybe this information will be useful in the docs

help-wanted
documentation
easy

How do I add variables to the value and how do I use them? for example: greeting = "Hello $name"