CodeIgniter Forums
Advanced languages - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forum-28.html)
+--- Forum: CodeIgniter 4 Discussion (https://forum.codeigniter.com/forum-31.html)
+--- Thread: Advanced languages (/thread-73278.html)



Advanced languages - davis.lasis - 04-06-2019

Hi all,
I think that codeigniter should have languages files have 2 dimensional arrays instead of only 1.

For example if i need to have modular setup, each language file could handle all translations in file per module separated in array by keys. This would make language files more flexible, less files to load per translation, less files and changes per project update / commit.

What do you think?


RE: Advanced languages - vebo - 07-10-2019

I agree. In previous version it was. But changed . So had to remove 'string' return type to solve problem.

I know that it is not good to change in system file.

PHP Code:
    function lang(string $line, array $args = [], string $locale null): string
    
{
        return 
Services::language($locale)
                        ->
getLine($line$args);
    } 

"getLine()" function returns string and array both, but "lang()" function returns only string. I think it's need to update