How to add a custom language pack
You can add German, French, Spanish or another language to KaevCMS. A basic language pack requires no CMS core edits or database migrations.
This example adds German (de). Replace de with your locale code for a different language.
1. Prepare the files
Open the lang folder in your KaevCMS installation. It sits next to app, config and public, not inside public.
Create:
KaevCMS/
└── lang/
├── en.json
├── ru.json
├── de.json ← interface translations
└── de/
└── language.php ← language descriptionKeep all existing files intact.
2. Create the language description
Create lang/de/language.php:
<?php
return [
'code' => 'de',
'name' => 'German',
'native_name' => 'Deutsch',
'direction' => 'ltr',
'fallback' => 'en',
'author' => 'Your name',
];codemust match the directory name (de).nameidentifies the language in English;native_nameis its name in that language.directionisltr(left-to-right) orrtl(right-to-left).authoridentifies the translator.fallbackis pack metadata. The actual site fallback language is selected in administration.
Language codes may have two or three letters, or a region suffix such as pt-BR. The directory, JSON filename and metadata code must match.
3. Translate the interface
Create lang/de.json. A minimal example:
{
"Home": "Startseite",
"News": "Neuigkeiten",
"Sign in": "Anmelden",
"Save changes": "Änderungen speichern"
}The left-hand text is the translation key. Keep keys unchanged and translate the values on the right.
For a complete interface translation, copy lang/en.json to lang/de.json and translate its values.
Save as valid UTF-8 JSON. Preserve placeholders such as :name, :count, and pluralization separators like |: they are used when messages are rendered.
TIP
You can start with only a few translated entries. Missing entries use the configured fallback language, so you can enable the pack before finishing everything.
4. Upload the pack to the server
Place the lang/de/ directory and lang/de.json file under your application's lang directory using a hosting file manager, SFTP or normal file deployment.
Security
language.php is an executable PHP file. Only install trusted, reviewed language packs. Never expose the language pack directory through the public document root.
5. Enable the language
- Open Administration → Settings → Languages.
- You should see Deutsch (de) labeled as a language pack.
- Enable the new language.
- Optionally choose it as the default site language. Keep English or Russian enabled as the fallback language while translations are incomplete.
- Click Save language settings.
German will then appear in the site's language selector. If it does not appear, verify file paths, matching locale codes and valid language.php metadata.
6. Translate remaining areas
The initial two files handle general interface strings. Some additional areas use separate resources:
| Area | Where translations live |
|---|---|
| Additional CMS labels | For example, lang/en/drivers.php, lang/en/audit.php, lang/en/rewards.php. You can add corresponding files under lang/de/. |
| Modules | Their own language directories, e.g. modules/donations/lang/en/messages.php; for German use modules/donations/lang/de/messages.php. Module names/descriptions can also reside in module.json. |
| News, pages and site settings | Add or edit localized content through administration. |
| Mail templates | Edit templates for the selected language under Mail settings. |
For PHP dictionaries, retain the translation-key structure and change only the values. Only use trusted PHP translation files. Keep backups of your custom files when upgrading KaevCMS.
Translation coverage
The percentage shown on the Languages settings page compares keys in de.json with en.json only. Even 100% does not guarantee complete translations of modules, mail templates or content.
