• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CodeIgniter4 Language Localization

#1
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
Reply

#2
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.
Reply

#3
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.
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.