Conversation
| ## 🛠️ Technical Details | ||
|
|
||
| - Translations are stored in `.php` language files inside `application/language/`. | ||
| - Directory is long form of the language, **lowercase** ('english', 'german', 'french') |
There was a problem hiding this comment.
I've a doubt with lowercase, in v1.6.2 archive are UCfirst, but if you're sure, ignore it.
There was a problem hiding this comment.
You're right, I think I made a mistake there.
Funny thing is that 'english' is lowercase and the rest is UCfirst.
I just remember me having troubles with those language files after last update
There was a problem hiding this comment.
After renamed French folder to french IP say:
An Error Was Encountered
Unable to load the requested language file: language/French/ip_lang.php
Details
After change in db:
UPDATE `ip_settings` SET
`setting_id` = '19',
`setting_key` = 'default_language',
`setting_value` = 'french'
WHERE `setting_id` = '19';Same error
After change in db:
UPDATE `ip_users` SET
`user_id` = '1',
...
`user_language` = 'french',
...
WHERE `user_id` = '1';Same error
The message come from CI here
Stacktrace of invoices/view/3
#0 application/third_party/MX/Lang.php(66): CI_Lang->load()
#1 application/helpers/trans_helper.php(81): MX_Lang->load()
#2 application/core/Base_Controller.php(78): set_language()
#3 application/core/User_Controller.php(28): Base_Controller->__construct()
#4 application/core/Admin_Controller.php(21): User_Controller->__construct()
#5 application/modules/invoices/controllers/Invoices.php(24): Admin_Controller->__construct()
#6 vendor/codeigniter/framework/system/core/CodeIgniter.php(519): Invoices->__construct()
#7 index.php(319): require_once('...')
#8 {main}
by Adding
$e = new \Exception;dd($e->getTraceAsString());exit;in CI_Lang->load() function system/core/Lang.php Line 89
It solved by change
$new_language = ($language == 'system' ? $default_lang : $language);To
$new_language = strtolower($language == 'system' ? $default_lang : $language);in application/helpers/trans_helper.php Line 75
But maybe need more investigation and verification if would be set the lowercase for languages folders. (settings page, users languages ...)
There was a problem hiding this comment.
After little verification (and set language(s) to French in db):
Setting page lose system lang and for users/form/1 returned to System lang because (IMO) get_available_languages() in application/helpers/trans_helper.php Line 95 return french but when choose French in language selector and save, All it's ok (and in db it changed French to french 👍)
Notes:
IMO just apply strtolower with setup (updater) on all langs in db become transparent for users.
There was a problem hiding this comment.
Understand why after changed French to french by hand in db get an error Unable to load the requested language file.
Because IP get user lang in $_SESSION. Need to logout & login to apply new lang parameter.
I just remember me having troubles with those language files after last update
I checked with change (in admin) to an other lang Spanish and work fine, the bug will probably arrive when after update (langs lowercase) but in db no ;)
Maybe only need update languages in db for the old IP to solve the Red Screen Of Death if next version have folders language lowercase. For this see PR #1232
Fun fact: No problem with folder case (if it same name in db) only need to disconnect & reconnect.
* Setup upgrade 1.6.3: Set all langs to lowercase Why? see #1230 (comment) * Fix IP search bad user_language file on login (after setup) Get an error like: Unable to load the requested language file: language/French/ip_lang.php Reason: When user are logged in before call & complete setup, On next login, session return old params. Need destroy session to be set by new params from database (Here for langs) * [IP-939]: Processing e-invoices flow (and some bugfixes): `development` branch for version 1.6.3 (#1247) Prepare for 1.6.3 and 1.7.0 --------- Co-authored-by: Thomas Ingles <thomas@sudwebdesign.fr> --------- Co-authored-by: Niels Drost <47660417+nielsdrost7@users.noreply.github.com>
* Chore: improve docs (#1230) * Change README.md * Update README.md * Change CONTRIBUTING.md * Improve TRANSLATIONS.md * Improve TRANSLATIONS.md * Create INSTALLATION.md * Update CONTRIBUTING.md * Improve CONTRIBUTING.md * Update CONTRIBUTING.md * Improve README.md (community & support) * Improve CONTRIBUTING.md * Improve INSTALLATION.md * Update README.md * Create bug_report.yml * Create feature_request.yml * Create translations.yml * Update bug_report.yml * Update feature_request.yml * Update translations.yml * Update PULL_REQUEST_TEMPLATE.md * Improve PULL_REQUEST_TEMPLATE.md * Update test-frontend.yml * Update test-php.yml * Improve test-php.yml * docker php-fpm test and build * Create docker-nginx.yml * Create docker-mariadb.yml * Create docker-phpmyadmin.yml * Improvements INSTALLATION.md * Create TRANSLATIONS.md (#1262)
Improve Docs