Welcome Guest, Not a member yet? Register   Sign In
.mo file support in CodeIgniter
#1

(This post was last modified: 05-29-2021, 02:59 AM by stopz.)

I'm making Composer packages for CodeIgniter and next step is to translate them into few languages using .mo files.
Let me explain why .mo is important:

* Easier standard to work with across companies.

Approach i came up with is:

1. In router allow for CI {locale} definition.
2. In Config/App.php we set defaultLocale to 'en' but fill up supportedLocales with all .mo files that are present.
3. In Language/en/Sample.php whe have something like this:

PHP Code:
<?php

return [
    'GreetingText' => gettext('This text is in English but as it is requested from gettext it should read the .mo file for correct language set by CodeIgniter Request Service.')
]; 

I looked up system/Language/Language.php:134 which is a fallback to English language
-when requested one is not found-

thus this greeting should get triggered from lang('Sample.GreetingText');

Question/Problem: I can't find if CodeIgniter does set up Environment for .mo files and if not or what-not then does anyone get the picture i'm trying to achieve and have any suggestions of what could i try?
Reply


Messages In This Thread
.mo file support in CodeIgniter - by stopz - 05-29-2021, 12:40 AM
RE: .mo file support in CodeIgniter - by InsiteFX - 05-29-2021, 05:15 AM
RE: .mo file support in CodeIgniter - by stopz - 05-29-2021, 07:34 AM
RE: .mo file support in CodeIgniter - by stopz - 05-29-2021, 01:40 PM
RE: .mo file support in CodeIgniter - by InsiteFX - 05-29-2021, 08:56 PM



Theme © iAndrew 2016 - Forum software by © MyBB