Skip to content

Commit eee8f7f

Browse files
committed
RHIDP-8635-1 - Comprehensive documentation for developers on adding localization support to custom plugins
1 parent f0cb2d3 commit eee8f7f

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

modules/configuring-a-floating-action-button/con-localization-support-for-the-floating-action-button.adoc

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
You can enable translation key support for floating action buttons, so that users can onboard in their preferred language. In {product-short}, all existing and newly created floating action buttons support localization using dedicated translation keys.
55

6-
The *Global Floating Action* button plugin supports internationalization (i18n) through translation keys. You can use `labelKey` and `toolTipKey` properties to provide translation keys instead of static text.
6+
The Global Floating Action Button plugin supports internationalization (i18n) through translation keys. You can use `labelKey` and `toolTipKey` properties to provide translation keys instead of static text.
77

88
The plugin provides the following built-in translation keys organized under the `fab` namespace:
99

@@ -27,6 +27,14 @@ The plugin includes translations for the following supported languages:
2727
* French (fr)
2828
// * Spanish (es)
2929

30+
// [NOTE]
31+
// ====
32+
// To add localization support for a new floating action button item, you can add any arbitrary key name for the `labelKey` and `toolTipKey` properties and provide corresponding translations for those keys.
33+
34+
// If you add a new floating action button item, you can add localization support by adding an arbitary label key and tool tip key
35+
36+
// ====
37+
3038
To ensure backward compatibility while providing translation support when available, the following order is used to resolve string translations:
3139

3240
. If the `labelKey` is provided, the plugin will attempt to resolve the translation key

modules/configuring-a-floating-action-button/proc-configuring-floating-action-button-as-a-dynamic-plugin.adoc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ To configure a floating action button as a dynamic plugin, complete any of the f
205205
`frontend:mountPoints:importName`:: Enter the import name with an associated component to the mount point.
206206

207207
= Translation support
208-
The *Global Floating Action* button plugin supports internationalization (i18n) through translation keys. You can use `labelKey` and `toolTipKey` properties to provide translation keys instead of static text.
208+
The Global Floating Action Button plugin supports internationalization (i18n) through translation keys. You can use `labelKey` and `toolTipKey` properties to provide translation keys instead of static text.
209209

210210
Example for using translation keys in dynamic configuration:
211211
[source,yaml]
@@ -216,6 +216,9 @@ Example for using translation keys in dynamic configuration:
216216
dynamicPlugins:
217217
frontend:
218218
red-hat-developer-hub.backstage-plugin-global-floating-action-button:
219+
translationResources:
220+
- importName: globalFloatingActionButtonTranslations
221+
ref: globalFloatingActionButtonTranslationRef
219222
mountPoints:
220223
- mountPoint: application/listener
221224
importName: DynamicGlobalFloatingActionButton

0 commit comments

Comments
 (0)