Translations
Translations are registered with the translations
extension. It takes an array of languages, where each language consists of an array of key/value pairs.
Kirby::plugin('your/plugin', [
'translations' => [
'en' => [
'your.plugin.export' => 'Export',
],
'de' => [
'your.plugin.export' => 'Exportieren',
]
]
]);
You can now use these translations in your plugin, for example in a panel field:
panel.plugin('your/plugin', {
fields: {
export: {
template: "<k-button>{{ $t('your.plugin.export') }}</k-button>"
}
}
});