Icons & Translations

Use these methods inside setup to register icons and translations that your plugin’s UI depends on.

registerIcon

Registers an inline SVG icon by name. Use the name in registerSource or registerFileAction.

1pluginApi.registry.registerIcon({
2 name: 'my-icon',
3 svg: '<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="10" fill="currentColor"/></svg>',
4});

registerL10n

Adds translation strings used by the plugin’s labels and UI.

1pluginApi.registry.registerL10n({
2 en: {
3 'my-source.label': 'My Source',
4 'my-source.empty': 'No files found',
5 },
6 de: {
7 'my-source.label': 'Meine Quelle',
8 'my-source.empty': 'Keine Dateien gefunden',
9 },
10});

Keys registered here can be accessed via uploaderApi.l10n('my-source.label') for translated text. The current locale name is available via pluginApi.config.get('localeName'). Keys are also used automatically when the label in registerSource matches a key. See Localization for the full list of built-in keys and locale definition format.