Currently, the main Quantum config file (config/config.php) includes language-related settings such as multilang, langs, lang_default, and lang_segment.
To improve maintainability and separation of concerns, these settings should be moved into a dedicated config/lang.php file.
Tasks:
-
Create a new file: config/lang.php
-
Move the following keys from config/config.php into it:
- multilang
- langs
- lang_default
- ang_segment
-
Ensure the new config file structure follows the same commenting and formatting style used in other Quantum config files.
-
Update the framework to load lang.php config automatically when language functionality is used.
-
Remove the moved keys from config/config.php.
Example:
New config/lang.php sample:
<?php
return [
/**
* ---------------------------------------------------------
* Multilingual support
* ---------------------------------------------------------
*
* Enables or disables multi-language support
*/
'multilang' => true,
/**
* ---------------------------------------------------------
* Supported languages
* ---------------------------------------------------------
*/
'langs' => ['en', 'ru', 'am'],
/**
* ---------------------------------------------------------
* Default language
* ---------------------------------------------------------
*/
'lang_default' => 'en',
/**
* ---------------------------------------------------------
* URL segment for language
* ---------------------------------------------------------
*
* Defines which segment in the URL indicates the language
*/
'lang_segment' => 1,
];
Currently, the main Quantum config file (config/config.php) includes language-related settings such as
multilang,langs,lang_default, andlang_segment.To improve maintainability and separation of concerns, these settings should be moved into a dedicated
config/lang.phpfile.Tasks:
Create a new file:
config/lang.phpMove the following keys from
config/config.phpinto it:Ensure the new config file structure follows the same commenting and formatting style used in other Quantum config files.
Update the framework to load
lang.phpconfig automatically when language functionality is used.Remove the moved keys from
config/config.php.Example:
New
config/lang.phpsample: