|
1 | 1 | {% set product_url_format = "https://localhost:9443" %} |
2 | 2 | {% include "../../../../../includes/guides/branding/localization/localization-overview.md" %} |
3 | 3 |
|
4 | | -## Add or remove locales |
| 4 | +{% include "../../../../../includes/guides/branding/localization/add-remove-locales.md" %} |
5 | 5 |
|
6 | | -You can add or remove language support to customize the user interface for different regions and languages. |
7 | | - |
8 | | -{% raw %} |
9 | | - |
10 | | -### Authentication, Recovery & Accounts endpoints {#add-remove-locales-in-authentication-recovery-accounts-endpoints} |
11 | | - |
12 | | -{% endraw %} |
13 | | - |
14 | | -Configure localization for authentication, recovery, and accounts endpoints using traditional properties files. |
15 | | - |
16 | | -#### Add a locale to endpoints |
17 | | - |
18 | | -Follow these steps to add a new language to your authentication, recovery, and accounts endpoints: |
19 | | - |
20 | | -##### Step 1: Create locale-specific resource files |
21 | | - |
22 | | -1. Navigate to the following directories based on the endpoint you want to configure: |
23 | | - |
24 | | - - **Authentication endpoint**: `<IS_HOME>/repository/deployment/server/webapps/authenticationendpoint/WEB-INF/classes/org/wso2/carbon/identity/application/authentication/endpoint/i18n/` |
25 | | - - **Recovery endpoint**: `<IS_HOME>/repository/deployment/server/webapps/accountrecoveryendpoint/WEB-INF/classes/org/wso2/carbon/identity/mgt/recovery/endpoint/i18n/` |
26 | | - - **Accounts endpoint**: `<IS_HOME>/repository/deployment/server/webapps/accounts/WEB-INF/classes/org/wso2/carbon/identity/application/authentication/endpoint/i18n/` |
27 | | - |
28 | | -2. Duplicate the `Resources.properties` file in the same location. |
29 | | - |
30 | | -3. Rename the duplicated file with the required locale suffix: |
31 | | - - For British English: `Resources_en_GB.properties` |
32 | | - - For French (Standard): `Resources_fr.properties` |
33 | | - |
34 | | - !!! note |
35 | | - |
36 | | - Refer to [Web browser language identification codes](https://www.localeplanet.com/icu/){target="_blank"} for more information on locale suffixes. |
37 | | - |
38 | | -4. Update the values for each key in the new file: |
39 | | - |
40 | | - ```properties |
41 | | - login=<Value in the required locale> |
42 | | - ``` |
43 | | - |
44 | | -5. Save the file. |
45 | | - |
46 | | -##### Step 2: Configure language options |
47 | | - |
48 | | -1. Navigate to `<IS_HOME>/repository/deployment/server/webapps/authenticationendpoint/WEB-INF/classes/`. |
49 | | - |
50 | | -2. Open the `LanguageOptions.properties` file. |
51 | | - |
52 | | -3. Add information about the new language in the following format: |
53 | | - |
54 | | - ```properties |
55 | | - <language switcher name>=<language code>,<language name>,<text direction> |
56 | | - ``` |
57 | | - |
58 | | - !!! note |
59 | | - |
60 | | - The `<text direction>` parameter is optional. The default text direction is "ltr" (Left-to-Right). |
61 | | - |
62 | | -4. Save the file. |
63 | | - |
64 | | -##### Step 3: Test the configuration |
65 | | - |
66 | | -1. Go to your browser settings and add the language you configured above to your preferred languages list. |
67 | | - |
68 | | -2. Restart the WSO2 Identity Server. |
69 | | - |
70 | | -3. Open a browser and navigate to test the endpoints: |
71 | | - |
72 | | - - **Authentication**: [https://localhost:9443/myaccount/](https://localhost:9443/myaccount/) (triggers login screen) |
73 | | - - **Recovery**: [https://localhost:9443/accountrecovery/](https://localhost:9443/accountrecovery/) |
74 | | - - **Accounts**: [https://localhost:9443/accounts/](https://localhost:9443/accounts/) |
75 | | - |
76 | | -4. You should see the screens displaying content in the configured language. |
77 | | - |
78 | | -#### Remove a locale from endpoints |
79 | | - |
80 | | -To remove a language from your authentication, recovery, and accounts endpoints: |
81 | | - |
82 | | -1. Delete the corresponding `Resources_<locale>.properties` files from authentication, recovery, and accounts endpoint directories. |
83 | | - |
84 | | -2. Remove the language entry from the `LanguageOptions.properties` file. |
85 | | - |
86 | | -3. Restart the server for changes to take effect. |
87 | | - |
88 | | -{% raw %} |
89 | | - |
90 | | -### My Account {#add-remove-locales-in-myaccount} |
91 | | - |
92 | | -{% endraw %} |
93 | | - |
94 | | -Configure localization for the My Account application. |
95 | | - |
96 | | -#### Add a locale to My Account |
97 | | - |
98 | | -To add a new language (for example, Arabic - `ar-SA`) to My Account: |
99 | | - |
100 | | -1. Navigate to `<IS_HOME>/repository/deployment/server/webapps/myaccount/extensions/i18n/`. |
101 | | - |
102 | | -2. Create a `meta.json` file with the following content: |
103 | | - |
104 | | - ```json |
105 | | - { |
106 | | - "ar-SA": { |
107 | | - "enabled": true, |
108 | | - "code": "ar-SA", |
109 | | - "flag": "sa", |
110 | | - "name": "Arabic (Saudi Arabia)", |
111 | | - "namespaces": [ |
112 | | - "common", |
113 | | - "myAccount", |
114 | | - "extensions" |
115 | | - ], |
116 | | - "paths": { |
117 | | - "common": "extensions/i18n/ar-SA/portals/common.json", |
118 | | - "myAccount": "extensions/i18n/ar-SA/portals/myAccount.json", |
119 | | - "extensions": "extensions/i18n/ar-SA/portals/extensions.json" |
120 | | - } |
121 | | - } |
122 | | - } |
123 | | - ``` |
124 | | - |
125 | | -3. Copy the `en-US` bundle from `<IS_HOME>/repository/deployment/server/webapps/myaccount/resources/i18n/`. |
126 | | - |
127 | | -4. Rename the copied bundle to `ar-SA` and place it inside `<IS_HOME>/repository/deployment/server/webapps/myaccount/extensions/i18n/`. |
128 | | - |
129 | | -5. Translate the content in the JSON files within the new language bundle. |
130 | | - |
131 | | -6. The new language will now appear in the language switcher. |
132 | | - |
133 | | -#### Remove a locale from My Account |
134 | | - |
135 | | -You can remove language support using different options based on your requirements. |
136 | | - |
137 | | -##### Remove from all places in My Account |
138 | | - |
139 | | -To remove a language from language switcher, branding, email templates, and all other places: |
140 | | - |
141 | | -1. Navigate to `<IS_HOME>/repository/deployment/server/webapps/myaccount/extensions/i18n/`. |
142 | | - |
143 | | -2. Create or update the `meta.json` file with the following content: |
144 | | - |
145 | | - ```json |
146 | | - { |
147 | | - "pt-PT": { |
148 | | - "enabled": false |
149 | | - } |
150 | | - } |
151 | | - ``` |
152 | | - |
153 | | -##### Remove from language switcher only in My Account |
154 | | - |
155 | | -To hide a language from the language switcher while keeping it available in other places: |
156 | | - |
157 | | -1. Update the `meta.json` file with the following content: |
158 | | - |
159 | | - ```json |
160 | | - { |
161 | | - "pt-PT": { |
162 | | - "enabled": true, |
163 | | - "showOnLanguageSwitcher": false |
164 | | - } |
165 | | - } |
166 | | - ``` |
167 | | - |
168 | | -{% raw %} |
169 | | - |
170 | | -### Console {#add-remove-locales-in-console} |
171 | | - |
172 | | -{% endraw %} |
173 | | - |
174 | | -Configure localization for the Console application. |
175 | | - |
176 | | -#### Add a locale to Console |
177 | | - |
178 | | -To add a new language (for example, Arabic - `ar-SA`) to Console: |
179 | | - |
180 | | -1. Navigate to `<IS_HOME>/repository/deployment/server/webapps/console/extensions/i18n/`. |
181 | | - |
182 | | -2. Create a `meta.json` file with the following content: |
183 | | - |
184 | | - ```json |
185 | | - { |
186 | | - "ar-SA": { |
187 | | - "enabled": true, |
188 | | - "code": "ar-SA", |
189 | | - "flag": "sa", |
190 | | - "name": "Arabic (Saudi Arabia)", |
191 | | - "namespaces": [ |
192 | | - "applications", |
193 | | - "users", |
194 | | - ...rest of the namespaces |
195 | | - ], |
196 | | - "paths": { |
197 | | - "applications": "extensions/i18n/ar-SA/portals/applications.json", |
198 | | - "users": "extensions/i18n/ar-SA/portals/users.json", |
199 | | - ...rest of the paths |
200 | | - } |
201 | | - } |
202 | | - } |
203 | | - ``` |
204 | | - |
205 | | -3. Copy the `en-US` bundle from `<IS_HOME>/repository/deployment/server/webapps/console/resources/i18n/`. |
206 | | - |
207 | | -4. Rename the copied bundle to `ar-SA` and place it inside `<IS_HOME>/repository/deployment/server/webapps/console/extensions/i18n/`. |
208 | | - |
209 | | -5. Translate the content in the JSON files within the new language bundle. |
210 | | - |
211 | | -6. The new language will now appear in the language switcher. |
212 | | - |
213 | | -#### Remove a locale from Console |
214 | | - |
215 | | -You can remove language support using different options based on your requirements. |
216 | | - |
217 | | -##### Remove from all places in Console |
218 | | - |
219 | | -To remove a language from language switcher, branding, email templates, and all other places: |
220 | | - |
221 | | -1. Navigate to `<IS_HOME>/repository/deployment/server/webapps/console/extensions/i18n/`. |
222 | | - |
223 | | -2. Create or update the `meta.json` file with the following content: |
224 | | - |
225 | | - ```json |
226 | | - { |
227 | | - "pt-PT": { |
228 | | - "enabled": false |
229 | | - } |
230 | | - } |
231 | | - ``` |
232 | | - |
233 | | -##### Remove from language switcher only in Console |
234 | | - |
235 | | -To hide a language from the language switcher while keeping it available in other places: |
236 | | - |
237 | | -1. Update the `meta.json` file with the following content: |
238 | | - |
239 | | - ```json |
240 | | - { |
241 | | - "pt-PT": { |
242 | | - "enabled": true, |
243 | | - "showOnLanguageSwitcher": false |
244 | | - } |
245 | | - } |
246 | | - ``` |
247 | | - |
248 | | -## Configure Text Direction (RTL & LTR) |
249 | | - |
250 | | -WSO2 Identity Server supports both Right-to-Left (RTL) and Left-to-Right (LTR) text directions. **LTR serves as the default text direction** for most languages and doesn't require explicit configuration. RTL languages like Arabic, Hebrew, and Persian automatically adjust the interface layout and content flow when configured. |
251 | | -
|
252 | | -!!! Note |
253 | | -
|
254 | | - The text direction is not currently configurable for the **Console**. |
255 | | -
|
256 | | -{% raw %} |
257 | | -
|
258 | | -### Authentication, Recovery & Accounts endpoints {#configure-text-direction-in-authentication-recovery-accounts-endpoints} |
259 | | -
|
260 | | -{% endraw %} |
261 | | -
|
262 | | -To configure text direction for authentication, recovery, and accounts endpoints: |
263 | | -
|
264 | | -1. Navigate to `<IS_HOME>/repository/deployment/server/webapps/authenticationendpoint/WEB-INF/classes/`. |
265 | | -
|
266 | | -2. Open the `LanguageOptions.properties` file. |
267 | | -
|
268 | | -3. Configure the language entry based on text direction: |
269 | | -
|
270 | | - **For LTR languages (default):** |
271 | | -
|
272 | | - ```properties |
273 | | - lang.switch.en_US=en,English,ltr |
274 | | - ``` |
275 | | -
|
276 | | - or simply (LTR is assumed if not specified): |
277 | | -
|
278 | | - ```properties |
279 | | - lang.switch.en_US=en,English |
280 | | - ``` |
281 | | -
|
282 | | - **For RTL languages:** |
283 | | -
|
284 | | - ```properties |
285 | | - lang.switch.ar_AE=ar,Arabic - العربية,rtl |
286 | | - ``` |
287 | | -
|
288 | | -4. Save the file and restart the server for changes to take effect. |
289 | | -
|
290 | | -!!! tip |
291 | | -
|
292 | | - The RTL/LTR configuration applies to all three endpoints (authentication, recovery, and accounts) since they share the same `LanguageOptions.properties` file. |
293 | | -
|
294 | | -{% raw %} |
295 | | -
|
296 | | -### My Account {#configure-text-direction-in-myaccount} |
297 | | -
|
298 | | -{% endraw %} |
299 | | -
|
300 | | -To configure text direction for languages in My Account: |
301 | | -
|
302 | | -1. Navigate to `<IS_HOME>/repository/deployment/server/webapps/myaccount/extensions/i18n/`. |
303 | | -
|
304 | | -2. Update your `meta.json` file to include the `direction` property: |
305 | | -
|
306 | | - **For LTR languages (default):** |
307 | | -
|
308 | | - ```json |
309 | | - { |
310 | | - "en-US": { |
311 | | - "enabled": true, |
312 | | - "code": "en-US", |
313 | | - "flag": "us", |
314 | | - "name": "English (United States)", |
315 | | - "direction": "ltr", |
316 | | - "namespaces": [ |
317 | | - "common", |
318 | | - "myAccount", |
319 | | - "extensions" |
320 | | - ], |
321 | | - "paths": { |
322 | | - "common": "extensions/i18n/en-US/portals/common.json", |
323 | | - "myAccount": "extensions/i18n/en-US/portals/myAccount.json", |
324 | | - "extensions": "extensions/i18n/en-US/portals/extensions.json" |
325 | | - } |
326 | | - } |
327 | | - } |
328 | | - ``` |
329 | | -
|
330 | | - **For RTL languages:** |
331 | | -
|
332 | | - ```json |
333 | | - { |
334 | | - "ar-SA": { |
335 | | - "enabled": true, |
336 | | - "code": "ar-SA", |
337 | | - "flag": "sa", |
338 | | - "name": "Arabic (Saudi Arabia)", |
339 | | - "direction": "rtl", |
340 | | - "namespaces": [ |
341 | | - "common", |
342 | | - "myAccount", |
343 | | - "extensions" |
344 | | - ], |
345 | | - "paths": { |
346 | | - "common": "extensions/i18n/ar-SA/portals/common.json", |
347 | | - "myAccount": "extensions/i18n/ar-SA/portals/myAccount.json", |
348 | | - "extensions": "extensions/i18n/ar-SA/portals/extensions.json" |
349 | | - } |
350 | | - } |
351 | | - } |
352 | | - ``` |
353 | | -
|
354 | | -3. Save the file and restart the server for changes to take effect. |
| 6 | +{% include "../../../../../includes/guides/branding/localization/configure-text-direction.md" %} |
0 commit comments