I18N - Internationalisation
Plugins may use the vocabulary that is provided by the core, using vue's i18n feature. This can be accomplished by extracting the t function from SpPS.
const t = SpPS.data.t;
// Currenlty (v12) t is also available directly on the window object
const t = window.t;
Core Messages
Core messages can be called regulary:
t('global.cancel'); // -> 'Cancel'
Plugin Messages
Plugin messages get registered under the plugin path:
{
"pluginName": {
"celebration": "🎉 Congratulations!"
}
}
Will be located at
t('plugin.pluginName.celebration'); // -> "🎉 Congratulations!"