Language Files
SiteX CMS supports multiple languages through simple PHP translation files.
Language File Structure
lang/
├── en.php (English - default)
├── ro.php (Romanian)
├── de.php (German)
├── fr.php (French)
└── es.php (Spanish)
File Format
Each language file returns an associative array of translation keys:
<?php
// lang/en.php
return [
'home' => 'Home',
'articles' => 'Articles',
'blog' => 'Blog',
'categories' => 'Categories',
'read_more' => 'Read More',
'published_on' => 'Published on',
'by_author' => 'by',
'comments' => 'Comments',
'leave_comment' => 'Leave a Comment',
'search' => 'Search',
'no_results' => 'No results found',
'next_page' => 'Next',
'prev_page' => 'Previous',
// ... more keys
];
Using Translations
In templates, use the __() helper function:
<a href="/blog"><?= __('blog') ?></a>
<span><?= __('published_on') ?> <?= $article['date'] ?></span>
Adding a New Language
- Copy
lang/en.phptolang/xx.php(your language code) - Translate all values (keep the keys in English)
- Set the language in Settings → General → Language
Admin Panel Language
The admin panel uses the same translation system. Admin-specific keys are prefixed with admin_:
'admin_dashboard' => 'Dashboard',
'admin_new_article' => 'New Article',
'admin_settings' => 'Settings',