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:

ColumnDescription
codeLocale code (e.g., en, fr, es, id, pt, sk)
nameEnglish name of the language
native_nameName in the language itself (e.g., Français, Español)
directionltr (left-to-right) or rtl (right-to-left)
is_defaultOnly one language can be default at a time
is_activeWhether the language is currently enabled
sort_orderDisplay 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-post instead 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:

  1. Create a new folder under app/Language/ using the locale code (e.g., app/Language/de/).
  2. Copy the English .php files from app/Language/en/ into the new folder and translate each string.
  3. Insert a new row into the languages table with the correct code, name, native_name, and direction.
  4. 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.