Skip to content

Commit a6f45ff

Browse files
committed
Refactor localization guide to separate instructions for authentication and recovery endpoints, enhancing clarity on adding and removing locales
1 parent dbc4bb0 commit a6f45ff

File tree

1 file changed

+121
-12
lines changed

1 file changed

+121
-12
lines changed

en/identity-server/next/docs/guides/branding/localization.md

Lines changed: 121 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -167,22 +167,21 @@ To hide a language from the language switcher while keeping it available in othe
167167

168168
{% raw %}
169169

170-
### Authentication & Recovery endpoints {#add-remove-locales-in-authentication-recovery-endpoints}
170+
### Authentication endpoints {#add-remove-locales-in-authentication-endpoints}
171171

172172
{% endraw %}
173173

174-
The authentication and recovery endpoints use traditional properties files for localization.
174+
Configure localization for authentication endpoints using traditional properties files.
175175

176-
#### Add a locale to endpoints
176+
#### Add a locale to authentication endpoints
177177

178-
Follow these steps to add a new language to your authentication and recovery endpoints:
178+
Follow these steps to add a new language to your authentication endpoints:
179179

180180
##### Step 1: Create locale-specific resource files
181181

182-
1. Navigate to the following directories based on the endpoint you want to configure:
182+
1. Navigate to the authentication endpoint directory:
183183

184184
- **Authentication endpoint**: `<IS_HOME>/repository/deployment/server/webapps/authenticationendpoint/WEB-INF/classes/org/wso2/carbon/identity/application/authentication/endpoint/i18n/`
185-
- **Recovery endpoint**: `<IS_HOME>/repository/deployment/server/webapps/accountrecoveryendpoint/WEB-INF/classes/org/wso2/carbon/identity/mgt/recovery/endpoint/i18n/`
186185

187186
2. Duplicate the `Resources.properties` file in the same location.
188187

@@ -232,16 +231,92 @@ Follow these steps to add a new language to your authentication and recovery end
232231

233232
4. You should see the login screen displaying content in the configured language.
234233

235-
#### Remove a locale from endpoints
234+
#### Remove a locale from authentication endpoints
236235

237-
To remove a language from your endpoints:
236+
To remove a language from your authentication endpoints:
238237

239-
1. Delete the corresponding `Resources_<locale>.properties` files from both authentication and recovery endpoint directories.
238+
1. Delete the corresponding `Resources_<locale>.properties` files from the authentication endpoint directory.
240239

241240
2. Remove the language entry from the `LanguageOptions.properties` file.
242241

243242
3. Restart the server for changes to take effect.
244243

244+
{% raw %}
245+
246+
### Recovery endpoints {#add-remove-locales-in-recovery-endpoints}
247+
248+
{% endraw %}
249+
250+
Configure localization for recovery endpoints using traditional properties files.
251+
252+
#### Add a locale to recovery endpoints
253+
254+
Follow these steps to add a new language to your recovery endpoints:
255+
256+
##### Step 1: Create resource files for recovery endpoints
257+
258+
1. Navigate to the recovery endpoint directory:
259+
260+
- **Recovery endpoint**: `<IS_HOME>/repository/deployment/server/webapps/accountrecoveryendpoint/WEB-INF/classes/org/wso2/carbon/identity/mgt/recovery/endpoint/i18n/`
261+
262+
2. Duplicate the `Resources.properties` file in the same location.
263+
264+
3. Rename the duplicated file with the required locale suffix:
265+
- For British English: `Resources_en_GB.properties`
266+
- For French (Standard): `Resources_fr.properties`
267+
268+
!!! note
269+
270+
Refer to [Web browser language identification codes](https://www.localeplanet.com/icu/){target="_blank"} for more information on locale suffixes.
271+
272+
4. Update the values for each key in the new file:
273+
274+
```properties
275+
login=<Value in the required locale>
276+
```
277+
278+
5. Save the file.
279+
280+
##### Step 2: Configure language options for recovery endpoints
281+
282+
1. Navigate to `<IS_HOME>/repository/deployment/server/webapps/authenticationendpoint/WEB-INF/classes/`.
283+
284+
2. Open the `LanguageOptions.properties` file.
285+
286+
3. Add information about the new language in the following format:
287+
288+
```properties
289+
<language switcher name>=<language code>,<language name>,<text direction>
290+
```
291+
292+
!!! note
293+
294+
The `<text direction>` parameter is optional. The default text direction is "ltr" (Left-to-Right).
295+
296+
4. Save the file.
297+
298+
##### Step 3: Test the recovery endpoint configuration
299+
300+
1. Go to your browser settings and add the language you configured above to your preferred languages list.
301+
302+
2. Restart the WSO2 Identity Server.
303+
304+
3. Open a browser and navigate to the account recovery URL.
305+
306+
- For localhost: [https://localhost:9443/accountrecovery/](https://localhost:9443/accountrecovery/)
307+
308+
4. You should see the recovery screens displaying content in the configured language.
309+
310+
#### Remove a locale from recovery endpoints
311+
312+
To remove a language from your recovery endpoints:
313+
314+
1. Delete the corresponding `Resources_<locale>.properties` files from the recovery endpoint directory.
315+
316+
2. Remove the language entry from the `LanguageOptions.properties` file (shared with authentication endpoints).
317+
318+
3. Restart the server for changes to take effect.
319+
245320
## Configure Text Direction (RTL & LTR)
246321

247322
WSO2 Identity Server supports both Right-to-Left (RTL) and Left-to-Right (LTR) text directions. **LTR is 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 properly.
@@ -372,11 +447,11 @@ To configure text direction for languages in Console:
372447

373448
{% raw %}
374449

375-
### Authentication & Recovery endpoints {#configure-text-direction-in-authentication-recovery-endpoints}
450+
### Authentication endpoints {#configure-text-direction-in-authentication-endpoints}
376451

377452
{% endraw %}
378453

379-
To configure text direction for authentication and recovery endpoints:
454+
To configure text direction for authentication endpoints:
380455

381456
1. Navigate to `<IS_HOME>/repository/deployment/server/webapps/authenticationendpoint/WEB-INF/classes/`.
382457

@@ -404,6 +479,40 @@ To configure text direction for authentication and recovery endpoints:
404479

405480
4. Save the file and restart the server for changes to take effect.
406481

482+
{% raw %}
483+
484+
### Recovery endpoints {#configure-text-direction-in-recovery-endpoints}
485+
486+
{% endraw %}
487+
488+
To configure text direction for recovery endpoints:
489+
490+
1. Navigate to `<IS_HOME>/repository/deployment/server/webapps/authenticationendpoint/WEB-INF/classes/`.
491+
492+
2. Open the `LanguageOptions.properties` file (shared with authentication endpoints).
493+
494+
3. Configure the language entry based on text direction:
495+
496+
**For LTR languages (default):**
497+
498+
```properties
499+
lang.switch.en_US=en,English,ltr
500+
```
501+
502+
or simply (LTR is assumed if not specified):
503+
504+
```properties
505+
lang.switch.en_US=en,English
506+
```
507+
508+
**For RTL languages:**
509+
510+
```properties
511+
lang.switch.ar_AE=ar,Arabic - العربية,rtl
512+
```
513+
514+
4. Save the file and restart the server for changes to take effect.
515+
407516
!!! tip
408517

409-
The RTL/LTR configuration for authentication and recovery endpoints applies to both applications when you update the `LanguageOptions.properties` file in the authentication endpoint directory.
518+
The RTL/LTR configuration applies to both authentication and recovery endpoints since they share the same `LanguageOptions.properties` file.

0 commit comments

Comments
 (0)