Localization (i18n)
The forum includes a basic translation system managed from the admin dashboard.
- Create translation files in
lang/(e.g.,lang/en.json,lang/it.json) - Each file is a JSON object of key => translated string
- Go to Admin → Languages to configure:
- Default Language: the language used by default
- Available Languages: derived from the installed
lang/*.jsonfiles; the page saves the list it finds
- Use
t('key')in views and index.php to output translated strings
The forum ships with English (lang/en.json). Additional languages can be added as lang/<code>.json and enabled in Admin → Languages (see views/admin_langs.php).
Translation File Format
Each language file is a JSON object mapping string keys to string values:
{
"site_name": "bulletinbored",
"home": "Home",
"login": "Login",
"logout": "Logout"
}
Uploaded language files are validated as a JSON object of string keys/values; a PHP file is no longer accepted (translation files are parsed as data, never executed).
Using Translations
In views and index.php:
<?= t('home') ?>
With parameters:
<?= t('reply_notification_subject', ['title' => $threadTitle]) ?>
Plugins and themes can ship their own translations and read them through scoped helpers:
// plugins/editbored/lang/en.json -> pt('editbored', 'bold')
<?= pt('editbored', 'bold') ?>
// themes/freshbored/lang/en.json -> tt('freshbored', 'some_key')
<?= tt('freshbored', 'some_key') ?>
A plugin reads plugins/<folder>/lang/<lang>.json; a theme reads themes/<folder>/lang/<lang>.json. The files are loaded into separate plugin:<name> and theme:<name> scopes before plugin init hooks run (src/bootstrap.php, lib/PluginManager.php, lib/ThemeManager.php).
Managing Languages
- Upload a new language as a single
.jsonfile from Admin → Languages (views/admin_langs.php). A ZIP is not accepted. - Install or update a language from the official remote repository: enter the language code and a repository download URL. Only URLs from the official language repository (GitHub
bulletinbored/langs) or the configured language mirror are allowed, and the downloaded content must be a valid JSON object (src/actions/admin/langs.php). - Delete installed language files from Admin → Languages (except the default language).