Skip to content

Commit 1cdf284

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

File tree

2 files changed

+34
-14
lines changed

2 files changed

+34
-14
lines changed

assemblies/assembly-localization-in-rhdh.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ include::modules/customizing-the-appearance/proc-select-rhdh-language.adoc[level
99

1010
include::modules/customizing-the-appearance/con-language-persistence.adoc[leveloffset=+2]
1111

12-
include::modules/customizing-the-appearance/proc-overriding-translations.adoc[leveloffset=+1]
13-
1412
// include::modules/customizing-the-appearance/proc-enabling-localization-in-quickstarts.adoc[leveloffset=+1]
1513

1614
// include::modules/customizing-the-appearance/proc-enabling-localization-in-sidebar-items.adoc[leveloffset=+1]
1715

1816
//include::modules/customizing-the-appearance/proc-enabling-localization-in-floating-action-button.adoc[leveloffset=+1]
1917

20-
== Localization support for custom plugins
18+
== Localization support for plugins
19+
20+
include::modules/customizing-the-appearance/proc-overriding-translations.adoc[leveloffset=+2]
2121

2222
include::modules/customizing-the-appearance/ref-best-practices-for-localization.adoc[leveloffset=+2]
2323

modules/customizing-the-appearance/proc-overriding-translations.adoc

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,14 @@
22

33
[id="prov-overriding-translations_{context}"]
44
= Overriding translations
5-
In {product-very-short} 1.8, English and French are the supported languages. You can implement translations for other languages by using a JSON file to override the existing translation strings, and by updating the `i18n` section of your `{my-app-config-file}` configuration file to include the JSON translation override file.
5+
//In {product-very-short} 1.8, English and French are enabled by default. You can implement translations for other languages by using a JSON file to override the existing translation strings, and by updating the `i18n` section of your `{my-app-config-file}` configuration file to include the JSON translation override file.
6+
7+
//In {product-very-short} 1.8, English and French are enabled by default. You can implement translations for other languages by adding the language translation strings to a file that overrides the existing translation strings. You must also update the `i18n` section of your `{my-app-config-file}` configuration file to add the new `locale` and your translation override file.
8+
9+
//In {product-very-short} 1.8, English and French are enabled by default. You can add a translation strings file to your {product-short} deployment that you can use to override the default translation strings, or to implement translations for other languages.
10+
11+
In {product-very-short} 1.8, you can override plugin translation strings without modifying the plugin source code.
12+
613

714
.Prerequisites
815
* You have enabled localization in your {product-very-short} application.
@@ -11,35 +18,34 @@ In {product-very-short} 1.8, English and French are the supported languages. You
1118
// This feature is not being included in 1.8
1219
// . In the top user menu, go to *Settings* > *General*.
1320
// . Click on the download link in the *Translations* panel to download the default English translation strings.
14-
. Create the JSON file containing all your translation as shown in the following example:
21+
. Create a translation stings file containing all your translation as shown in the following example:
1522
+
1623
[id=i18n-enable]
1724
.`allTranslations.json` fragment with translation string overrides
1825
[source,json]
1926
----
2027
{
2128
"plugin.global-floating-action-button": {
29+
"en": {
30+
"fab.quay.label": "QUAY EN JSON",
31+
"fab.rbac.label": "RBAC EN JSON",
32+
"fab.rbac.tooltip": "RBAC EN tooltip JSON"
33+
},
2234
"fr": {
2335
"fab.quay.label": "QUAY French JSON",
2436
"fab.quay.tooltip": "QUAY french tooltip JSON",
2537
"fab.rbac.label": "RBAC French JSON",
2638
"fab.rbac.tooltip": "RBAC french tooltip JSON"
27-
},
28-
"en": {
29-
"fab.quay.label": "QUAY EN JSON",
30-
"fab.rbac.label": "RBAC EN JSON",
31-
"fab.rbac.tooltip": "RBAC EN tooltip JSON"
3239
}
3340
},
3441
"plugin.global-header": {
35-
"fr": {
36-
"applicationLauncher.developerHub": "Developer Hub French JSON"
37-
},
3842
"en": {
3943
"applicationLauncher.developerHub": "Developer Hub EN JSON"
44+
},
45+
"fr": {
46+
"applicationLauncher.developerHub": "Developer Hub French JSON"
4047
}
4148
}
42-
4349
}
4450
----
4551
. Log in to your cluster and create a config map for your translations override strings:
@@ -104,3 +110,17 @@ i18n:
104110
- /opt/app-root/src/translations/all-translations.json
105111
----
106112

113+
.Additional resources
114+
// * link:{customizing-book-link}#configuring-templates[Enabling floating button localization in {product-short}]
115+
// * link:{customizing-book-link}#configuring-templates[Enabling Quickstart localization in {product-short}]
116+
// * link:{customizing-book-link}#configuring-templates[Enabling sidebar menu items localization in {product-short}]
117+
118+
{context}
119+
120+
* xref:proc-enabling-localization-in-floating-action-button_configuring-a-floating-action-button[Enabling floating button localization in {product-short}]
121+
* xref:proc-enabling-localization-in-quickstarts_customizing-the-quickstarts[Enabling Quickstart localization in {product-short}]
122+
* xref:proc-enabling-localization-in-sidebar-menu-items_customizing-appearance[Enabling sidebar menu items localization in {product-short}]
123+
124+
// * xref:proc-enabling-localization-in-floating-action-button_{context}[fggdsg]
125+
// * xref:proc-enabling-localization-in-quickstarts_{context}[fggdsg]
126+
// * xref:proc-enabling-localization-in-sidebar-menu-items_{context}[fggdsg]

0 commit comments

Comments
 (0)