Multi-Language
For official documentation of Codeigniter you can follow https://codeigniter4.github.io/userguide/outgoing/localization.html.
Please follow the below steps to add a new language.
-
Set default language from the
app/Config/App.php
.
$defaultLocale= 'en';
and in supported language$supportedLocales = ['en', 'es', 'de', 'it', 'ru'];
and setpublic $baseURL = 'https://yourdomain.com/';
-
All the files of each language are located in
app/Language
. You can create a new language folder by referring to the English language. -
You need to add a new language in the topbar dropdown in the file
app/Views/partials/topbar.php
andapp/Views/partials/horizontal.php
file. -
It is managed by the backend in the file
app/Controllers/Language.php
.
You can use<?= lang('Files.Search') ?>
to translate "Search" keyword in supported languages.