Skip to content

Commit 74bf330

Browse files
committed
Refactor localization guide to improve clarity on adding and removing locales
1 parent 01722a8 commit 74bf330

File tree

1 file changed

+90
-32
lines changed

1 file changed

+90
-32
lines changed
Lines changed: 90 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,130 @@
11
{% set product_url_format = "https://localhost:9443" %}
22
{% include "../../../../../includes/guides/branding/localization.md" %}
33

4-
## Configuring localization for authentication endpoints
4+
## Add/Remove locales
55

6-
WSO2 Identity Server provides internationalization support for its web applications (such as the authentication endpoint located in the `<IS_HOME>/repository/deployment/server/webapps/` directory). The following steps describe how you can configure this:
6+
You can add or remove language support to customize the user interface for different regions and languages.
77

8-
1. Navigate to `<IS_HOME>/repository/deployment/server/webapps/authenticationendpoint/WEB-INF/classes/org/wso2/carbon/identity/application/authentication/endpoint/i18n/`
8+
### Add a new locale
99

10-
2. Duplicate the `Resources.properties` file in the same location and rename it with the required locale suffix as follows:
10+
Follow these steps to add a new language to your authentication and recovery endpoints:
11+
12+
#### Step 1: Create locale-specific resource files
13+
14+
1. Navigate to the following directories based on the endpoint you want to configure:
15+
16+
- **Authentication endpoint**: `<IS_HOME>/repository/deployment/server/webapps/authenticationendpoint/WEB-INF/classes/org/wso2/carbon/identity/application/authentication/endpoint/i18n/`
17+
- **Recovery endpoint**: `<IS_HOME>/repository/deployment/server/webapps/accountrecoveryendpoint/WEB-INF/classes/org/wso2/carbon/identity/mgt/recovery/endpoint/i18n/`
18+
19+
2. Duplicate the `Resources.properties` file in the same location.
20+
21+
3. Rename the duplicated file with the required locale suffix:
1122
- For British English: `Resources_en_GB.properties`
1223
- For French (Standard): `Resources_fr.properties`
1324

1425
!!! note
1526

1627
Refer to [Web browser language identification codes](https://www.localeplanet.com/icu/){target="_blank"} for more information on locale suffixes.
1728

18-
3. Update the values for each key as follows:
19-
```
20-
login=<Value in the required locale>
21-
```
29+
4. Update the values for each key in the new file:
2230

23-
4. Save the file.
31+
```properties
32+
login=<Value in the required locale>
33+
```
34+
35+
5. Save the file.
36+
37+
#### Step 2: Configure language options
2438

25-
5. Navigate to `<IS_HOME>/repository/deployment/server/webapps/authenticationendpoint/WEB-INF/classes/` and open the `LanguageOptions.properties` file.
39+
1. Navigate to `<IS_HOME>/repository/deployment/server/webapps/authenticationendpoint/WEB-INF/classes/`.
2640

27-
6. Add information about the new language in the following format & save the file.
28-
```
29-
<language switcher name>=<language code>,<language name>,<text direction>`
30-
```
41+
2. Open the `LanguageOptions.properties` file.
42+
43+
3. Add information about the new language in the following format:
44+
45+
```properties
46+
<language switcher name>=<language code>,<language name>,<text direction>
47+
```
3148

3249
!!! note
3350

34-
- `<text direction>` is optional.
35-
- The default text direction is set to "ltr" (Left-to-Right). To enable support for Right-to-Left (RTL) languages, refer to the documentation on [Right-to-Left (RTL) Language Support]({{base_path}}/guides/branding/localization/#right-to-left-rtl-language-support) for detailed instructions.
51+
The `<text direction>` parameter is optional. The default text direction is "ltr" (Left-to-Right).
52+
53+
4. Save the file.
54+
55+
#### Step 3: Enable the locale in your browser
56+
57+
1. Go to your browser settings.
58+
59+
2. Add the language you configured above to your preferred languages list.
3660

37-
7. Go to the browser settings and add the language you configured above.
61+
#### Step 4: Test the configuration
3862

39-
8. Restart the server. To try out, do the following:
40-
1. Open up a browser.
41-
2. Type the My Account portal URL. (If you are running the server in your localhost, the URL is: [https://localhost:9443/myaccount/](https://localhost:9443/myaccount/)). You will see the login screen having the contents in the configured language.
63+
1. Restart the WSO2 Identity Server.
4264

43-
## Configuring localization for recovery endpoints
65+
2. Open a browser and navigate to the My Account portal URL.
4466

45-
You can enable localization for `accountrecoveryendpoint` by applying the same steps 1 through 8 in the previous [section](#configuring-localization-for-authentication-endpoints), for the following location:
67+
- For localhost: [https://localhost:9443/myaccount/](https://localhost:9443/myaccount/)
4668

47-
`<IS_HOME>/repository/deployment/server/webapps/accountrecoveryendpoint/WEB-INF/classes/org/wso2/carbon/identity/mgt/recovery/endpoint/i18n/`.
69+
3. You should see the login screen displaying content in the configured language.
4870

49-
Update the LanguageOptions.properties file located at: `<IS_HOME>/repository/deployment/server/webapps/authenticationendpoint/WEB-INF/classes/LanguageOptions.properties` to include the new language options.
71+
### Remove a locale
5072

51-
## Right-to-Left (RTL) Language Support
73+
To remove a language from your endpoints:
5274

53-
{{product_name}} supports Right-to-Left (RTL) languages like Arabic, Hebrew, and Persian, ensuring login and recovery screens dynamically adjust their layout and text direction for a seamless user experience. When an RTL language is selected, the interface, including text alignment and content flow, automatically mirrors to follow RTL formatting conventions.
75+
1. Delete the corresponding `Resources_<locale>.properties` files from both authentication and recovery endpoint directories.
5476

55-
If you need to enable Right-to-Left (RTL) support for a language in authentication and recovery endpoints, follow these steps:
77+
2. Remove the language entry from the `LanguageOptions.properties` file.
78+
79+
3. Restart the server for changes to take effect.
80+
81+
## RTL & LTR support
82+
83+
WSO2 Identity Server supports both Right-to-Left (RTL) and Left-to-Right (LTR) text directions. This ensures that languages like Arabic, Hebrew, and Persian display correctly with proper layout and content flow.
84+
85+
### Configure LTR support
86+
87+
LTR (Left-to-Right) is the **default text direction** for most languages. You don't need to explicitly configure LTR support.
88+
89+
To ensure a language uses LTR direction:
90+
91+
1. Open the `LanguageOptions.properties` file.
92+
93+
2. Add the language entry without the `rtl` suffix, or explicitly specify `ltr`:
94+
95+
```properties
96+
lang.switch.en_US=en,English,ltr
97+
```
98+
99+
or simply:
100+
101+
```properties
102+
lang.switch.en_US=en,English
103+
```
104+
105+
3. Save the file and restart the server.
106+
107+
### Configure RTL support
108+
109+
When you select an RTL language, the interface automatically adjusts text alignment and content flow to follow RTL formatting conventions.
110+
111+
To enable RTL support for a specific language:
56112
57113
1. Navigate to the following directory based on the endpoint you want to configure:
58114
59-
- Authentication endpoint: `<IS_HOME>/repository/deployment/server/webapps/authenticationendpoint/WEB-INF/classes/`
60-
- Recovery endpoint: `<IS_HOME>/repository/deployment/server/webapps/accountrecoveryendpoint/WEB-INF/classes/`
115+
- **Authentication endpoint**: `<IS_HOME>/repository/deployment/server/webapps/authenticationendpoint/WEB-INF/classes/`
116+
- **Recovery endpoint**: `<IS_HOME>/repository/deployment/server/webapps/accountrecoveryendpoint/WEB-INF/classes/`
61117
62118
2. Open the `LanguageOptions.properties` file.
63119
64-
3. Add the ,rtl suffix to the language entry in the file. For example, to enable RTL for Arabic, update the entry as follows:
120+
3. Add the `,rtl` suffix to the language entry. For example, to enable RTL for Arabic:
65121
66-
```text
122+
```properties
67123
lang.switch.ar_AE=ar,Arabic - العربية,rtl
68124
```
69125
70126
4. Save the file and restart the server for the changes to take effect.
71127
72-
This will apply RTL formatting for the specified language across authentication and recovery endpoints.
128+
!!! tip
129+
130+
The RTL/LTR configuration applies to both authentication and recovery endpoints when you update the `LanguageOptions.properties` file in the authentication endpoint directory.

0 commit comments

Comments
 (0)