CodeIgniter Forums

Full Version: CodeIgniter4 Language Localization
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am creating a CI4 app with standalone modules. I want a scenario where a module is independent from another module and it can have its own resources as outlined in the structure below

MyModule
      |
      |--controllers
           |-module_controller.php
      |--models

           |-module_model.php
      |--configs

           |-module_configs.php
      |--libraries

           |-module_libraries.php
      |--views

           |-view_1.php

           |-view_2.php
           |-view_3.php

      |--lang
           |-en-US
             |-userprofile.php


or you can see the attachment which shows the directory structure of the module

I know with CI4 the default language files will be in the directory "Language/en-US/userprofile.php".
My question is, "How do I get the system to work with custom path for language files". In the scenario above, my language files will reside in a module directory as "MyModule/lang/en-US/userprofile.php" .

Thank you in advance
IIRC, CI4 will load translation sets form locales inside the Language subfolders of all the PSR-4 namespaces.
What are you are looking for is a bit different, and would be a feature request, I think.
Thank you @ciadmin. Yes I agree that can work as a future request so that we mantain the modular structure of the app in a decoupled manner.