Adminizer supports interface translations using the translation block in the configuration.
module.exports.adminpanel = {
translation: {
locales: ['en', 'de'],
path: 'config/locales',
defaultLocale: 'en'
}
};
locales – list of available localespath – relative path to translation filesdefaultLocale – locale used when none is specifiedIn Inertia mode, interface strings are translated on the server through req.i18n.__(...) before props are sent to React components. This includes shared UI props such as sidebar navbar item titles and section labels.
If you localize Adminizer UI through translation dictionaries, make sure the locale file includes shared keys used by common components:
Log outAdminpanelVisibleFirst, Last, Previous, NextThese keys are passed via shared uiMessages in Inertia mode and are used by menu/user controls and pagination UI.
Keep all locale files in src/translations/ synchronized by key set.
When new UI keys are added, update every locale file so non-default locales do not fall back to raw keys in the interface.
You can append locale keys programmatically before the first requests are processed.
import { Adminizer } from "adminizer";
Adminizer.i18n.appendLocale("ru", {
"My custom nav item": "Мой пункт меню"
});
If you already have an instance, the same API is available from it:
adminizer.i18n.appendLocale("ru", {
"My custom nav item": "Мой пункт меню"
});
You can also import I18n directly:
import { I18n } from "adminizer";
I18n.appendLocale("ru", {
"My custom nav item": "Мой пункт меню"
});