Skip to content

Commit 9d1ea9e

Browse files
authored
Update android.md
1 parent 4722c36 commit 9d1ea9e

File tree

1 file changed

+68
-24
lines changed
  • articles/communication-services/how-tos/ui-library-sdk/includes/localization

1 file changed

+68
-24
lines changed

articles/communication-services/how-tos/ui-library-sdk/includes/localization/android.md

Lines changed: 68 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -14,47 +14,91 @@ Azure Communication UI [open source library](https://github.com/Azure/communicat
1414

1515
### Available Languages
1616

17-
The following is table of `CommunicationUISupportedLocale` with out of the box translations. If you want to localize the composite, pass the `Locale` from `CommunicationUISupportedLocale` into `LocalizationConfiguration` as options into `CallComposite`.
17+
The following is table of `CallCompositeSupportedLocale` with out of the box translations. If you want to localize the composite, pass the `Locale` from `CallCompositeSupportedLocale` into `CallCompositeLocalizationOptions` as options into `CallComposite`.
1818

19-
|Language| CommunicationUISupportedLocale|
19+
|Language| CallCompositeSupportedLocale|
2020
|---------|---------|
21-
|German| CommunicationUISupportedLocale.DE|
22-
|Japanese| CommunicationUISupportedLocale.JA|
23-
|English| CommunicationUISupportedLocale.EN_US|
24-
|Chinese (Traditional)| CommunicationUISupportedLocale.ZH_TW|
25-
|Spanish |CommunicationUISupportedLocale.ES|
26-
|Chinese (Simplified) |CommunicationUISupportedLocale.ZH_CN|
27-
|Italian |CommunicationUISupportedLocale.IT|
28-
|English (United Kingdom) |CommunicationUISupportedLocale.EN_UK|
29-
|Korean |CommunicationUISupportedLocale.KO|
30-
|Turkish |CommunicationUISupportedLocale.TR|
31-
|Russian |CommunicationUISupportedLocale.RU|
32-
|French |CommunicationUISupportedLocale.FR|
33-
|Dutch |CommunicationUISupportedLocale.NL|
34-
|Portuguese |CommunicationUISupportedLocale.PT_BR|
21+
|German| CallCompositeSupportedLocale.DE|
22+
|Japanese| CallCompositeSupportedLocale.JA|
23+
|English| CallCompositeSupportedLocale.EN_US|
24+
|Chinese (Traditional)| CallCompositeSupportedLocale.ZH_TW|
25+
|Spanish |CallCompositeSupportedLocale.ES|
26+
|Chinese (Simplified) |CallCompositeSupportedLocale.ZH_CN|
27+
|Italian |CallCompositeSupportedLocale.IT|
28+
|English (United Kingdom) |CallCompositeSupportedLocale.EN_UK|
29+
|Korean |CallCompositeSupportedLocale.KO|
30+
|Turkish |CallCompositeSupportedLocale.TR|
31+
|Russian |CallCompositeSupportedLocale.RU|
32+
|French |CallCompositeSupportedLocale.FR|
33+
|Dutch |CallCompositeSupportedLocale.NL|
34+
|Portuguese |CallCompositeSupportedLocale.PT_BR|
3535

3636
### Localization Provider
3737

38-
`LocalizationConfiguration` is an options wrapper that sets all the strings for Mobile UI Library components using a `CommunicationUISupportedLocale`. By default, all text labels use English strings. If desired `LocalizationConfiguration` can be used to set a different language by passing a `Locale` object from `CommunicationUISupportedLocale`. Out of the box, the UI library includes a set of `Locale` usable with the UI components and composites.
38+
`CallCompositeLocalizationOptions` is an options wrapper that sets all the strings for Mobile UI Library components using a `CallCompositeSupportedLocale`. By default, all text labels use English strings. If desired `CallCompositeLocalizationOptions` can be used to set a different language by passing a `Locale` object from `CallCompositeSupportedLocale`. Out of the box, the UI library includes a set of `Locale` usable with the UI components and composites.
3939

40-
You can also obtain list of `Locale` by the static function `CommunicationUISupportedLocale.getSupportedLocales()`.
40+
You can also obtain list of `Locale` by the static function `CallCompositeSupportedLocale.getSupportedLocales()`.
4141

4242
:::image type="content" source="media/android-localization.png" alt-text="Android localization":::
4343

4444
#### Usage
4545

46-
To use the `LocalizationConfiguration`, specify a `CommunicationUISupportedLocale` and pass it to the `CallCompositeOptions`. For the example below, we'll localize the composite to French.
46+
To use the `CallCompositeLocalizationOptions`, specify a `CallCompositeSupportedLocale` and pass it to the `CallCompositeBuilder`. For the example below, we'll localize the composite to French.
4747

48-
```Kotlin
49-
val callComposite: CallComposite = CallCompositeBuilder().localization(LocalizationConfiguration(CommunicationUISupportedLocale.FR).build()
48+
#### [Kotlin](#tab/kotlin)
49+
50+
```kotlin
51+
import com.azure.android.communication.ui.calling.models.CallCompositeLocalizationOptions
52+
import com.azure.android.communication.ui.calling.models.CallCompositeSupportedLocale
53+
54+
// CallCompositeSupportedLocale provides list of supported locale
55+
val callComposite: CallComposite =
56+
CallCompositeBuilder().localization(
57+
CallCompositeLocalizationOptions(CallCompositeSupportedLocale.FR)
58+
).build()
59+
```
60+
61+
#### [Java](#tab/java)
62+
63+
```java
64+
import com.azure.android.communication.ui.calling.models.CallCompositeLocalizationOptions;
65+
import com.azure.android.communication.ui.calling.models.CallCompositeSupportedLocale;
66+
67+
// CallCompositeSupportedLocale provides list of supported locale
68+
CallComposite callComposite =
69+
new CallCompositeBuilder()
70+
.localization(new CallCompositeLocalizationOptions(CallCompositeSupportedLocale.FR))
71+
.build();
5072
```
5173

5274
### Layout Direction
5375

54-
Certain cultures (Arabic, Hebrew, etc.) may need for localization to have right-to-left layout. You can specify the `layoutDirection` as part of the `LocalizationConfiguration`. The layout of the composite will be mirrored but the text will remain in the direction of the string.
76+
Certain cultures (Arabic, Hebrew, etc.) may need for localization to have right-to-left layout. You can specify the `layoutDirection` as part of the `CallCompositeLocalizationOptions`. The layout of the composite will be mirrored but the text will remain in the direction of the string.
77+
78+
#### [Kotlin](#tab/kotlin)
79+
80+
```kotlin
81+
import com.azure.android.communication.ui.calling.models.CallCompositeLocalizationOptions
82+
import com.azure.android.communication.ui.calling.models.CallCompositeSupportedLocale
83+
84+
// CallCompositeSupportedLocale provides list of supported locale
85+
val callComposite: CallComposite =
86+
CallCompositeBuilder().localization(
87+
CallCompositeLocalizationOptions(CallCompositeSupportedLocale.FR, LayoutDirection.LTR)
88+
).build()
89+
```
90+
91+
#### [Java](#tab/java)
92+
93+
```java
94+
import com.azure.android.communication.ui.calling.models.CallCompositeLocalizationOptions;
95+
import com.azure.android.communication.ui.calling.models.CallCompositeSupportedLocale;
5596

56-
```Koltin
57-
val callComposite: CallComposite = CallCompositeBuilder().localization(LocalizationConfiguration(CommunicationUISupportedLocale.FR,LaytoutDirection.RTL)).build()
97+
// CallCompositeSupportedLocale provides list of supported locale
98+
CallComposite callComposite =
99+
new CallCompositeBuilder()
100+
.localization(new CallCompositeLocalizationOptions(CallCompositeSupportedLocale.FR, LayoutDirection.LTR))
101+
.build();
58102
```
59103

60104
|`LayoutDirection.RTL` | `LayoutDirection.LTR` |

0 commit comments

Comments
 (0)