Interface Localization (i18n)
Pyxis CMS is designed as a global system, allowing for dynamic changes to the interface language without modifying the source code.
How it works
Section titled “How it works”SetLocaleMiddleware: For every server request, a dedicated Middleware checks the current value in thesettingstable.- Dynamic Localization: The system injects the selected language into the Laravel application container using
app()->setLocale(). - Language Files (
lang/): All interface texts (navigation labels, form fields, notifications) are stored in standardized.phpfiles.
Developer Benefits
Section titled “Developer Benefits”By utilizing the __() helper and getNavigationLabel() methods, adding a new language to the entire panel is as simple as creating a new folder in the lang/ directory and translating the keys. This eliminates the issue of “hardcoded strings” in the core logic.