codeigniter4 / translations

System message translations for CodeIgniter4
https://codeigniter4.github.io/translations/
MIT License
197 stars 206 forks source link

Translations are not loaded from this repository #169

Closed kenjis closed 3 years ago

kenjis commented 3 years ago

144 changes the namespace.

    "autoload": {
        "psr-4": {
-           "Translations\\": ""
+           "CodeIgniter\\Language\\": "Language/"
        }
    },

It causes translations are not loaded from this repository, like https://github.com/codeigniter4/CodeIgniter4/issues/2120.

This is because the new namespace is:

prefix: CodeIgniter\Language
  path: vendor/composer/../codeigniter4/translations/Language/

When CI looks for Language/it/Validation.php, Language::requireFile() and Services::locator()->search() looks for codeigniter4/translations/Language/Language/it/Validation.php. And it can't find the lang file.

paulbalandan commented 3 years ago

@kenjis I forgot that CI4 autoloader ignores the CodeIgniter namespace from Composer. Can you check if fix solves the issue?

kenjis commented 3 years ago

Still does not work.

prefix: Translations
  path: vendor/composer/../codeigniter4/translations/Language/

So it looks for codeigniter4/translations/Language/Language/it/Validation.php.

paulbalandan commented 3 years ago

How about now?

kenjis commented 3 years ago

@paulbalandan Worked fine!