Language Management
Enable and configure the languages available on your Pubvana site.
TL;DR
Go to Admin → Languages. Enable or disable languages with the toggle, set one as the default, and reorder the list. Six languages are included out of the box: English, French, Spanish, Indonesian, Portuguese, and Slovak.
Details
The Languages Table
The languages database table stores all available languages. Each row has:
| Column | Description |
|---|---|
code | Locale code (e.g., en, fr, es, id, pt, sk) |
name | English name of the language |
native_name | Name in the language itself (e.g., Français, Español) |
direction | ltr (left-to-right) or rtl (right-to-left) |
is_default | Only one language can be default at a time |
is_active | Whether the language is currently enabled |
sort_order | Display order in the language switcher |
Admin UI
Admin → Languages shows the full language list. Actions available:
- Enable/Disable — toggle
is_active. Disabled languages are hidden from the Language Picker widget and their locale prefix routes return 404. - Set as Default — the default language uses unprefixed URLs (e.g.,
/blog/my-postinstead of/en/blog/my-post). Only one language can be default. - Reorder — drag rows to change
sort_order. The Language Picker widget respects this order.
Translation Files
Only languages that have corresponding translation files in app/Language/ are seeded. Each language folder contains PHP files mapping string keys to translated strings. All six included languages have full coverage of:
- Admin UI strings (form labels, buttons, notifications, error messages)
- Theme-facing strings (widget titles, pagination labels, comment prompts)
Adding a New Language
To add a language not in the seeded list:
- Create a new folder under
app/Language/using the locale code (e.g.,app/Language/de/). - Copy the English
.phpfiles fromapp/Language/en/into the new folder and translate each string. - Insert a new row into the
languagestable with the correctcode,name,native_name, anddirection. - Toggle the language active from Admin → Languages.
Runtime Behaviour
Active languages are registered with CI4's supportedLocales at boot time via a pre_system event hook. This ensures CI4's locale routing is aware of all active language codes before any route matching occurs.