You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Azure Communication UI [open source library](https://github.com/Azure/communication-ui-library-ios) for Android and the sample application code can be found [here](https://github.com/Azure-Samples/communication-services-ios-quickstarts/tree/main/ui-library-quick-start)
13
+
Azure Communication UI [open source library](https://github.com/Azure/communication-ui-library-ios) for iOS and the sample application code can be found [here](https://github.com/Azure-Samples/communication-services-ios-quickstarts/tree/main/ui-library-quick-start)
14
+
15
+
### Language Detection
16
+
17
+
If your application supports localization, the UI Library will be displayed based on user's system preferred language if it's part of the `Available Languages` listed below. Otherwise will default our predefined English (`en`) strings.
14
18
15
19
### Available Languages
16
20
17
-
The following table of `languageCode` with out of the box translations. If you want to localize the composite, pass the `languageCode` into `LocalizationConfiguration` as options into `CallComposite`.
21
+
The following table of `locale` with out of the box translations. If you want to localize the composite, pass the `locale` into `LocalizationConfiguration` as options into `CallComposite`.
18
22
19
-
| Language |LanguageCode (Enum)|rawValue|
23
+
| Language |CommunicationUISupportedLocale |identifier|
`LocalizationConfiguration` is an options wrapper that sets all the strings for UI Library components using a `languageCode`. By default, all text labels use our English (`en`) strings. If desired, `LocalizationConfiguration` can be used to set a different `languageCode`. Out of the box, the UI library includes a set of `languageCode` usable with the UI components and composites.
65
+
`LocalizationConfiguration` is an options wrapper that sets all the strings for UI Library components using a `locale`. By default, all text labels use our English (`en`) strings. If desired, `LocalizationConfiguration` can be used to set a different `locale`. Out of the box, the UI library includes a set of `locale` usable with the UI components and composites.
48
66
49
-
#### Usage
50
-
51
-
To use the `LocalizationConfiguration`, specify a `languageCode` and pass it to the `CallCompositeOptions`. For the example below, we'll localize the composite to French (`fr`).
67
+
To use the `LocalizationConfiguration`, specify a `locale` Swift Locale struct (with or without a region code), and pass it to the `CallCompositeOptions`. For the example below, we'll localize the composite to French for France (`fr-FR`).
52
68
53
69
```swift
54
-
let localizationConfig =LocalizationConfiguration(languageCode: "fr")
70
+
// Creating swift Locale struct
71
+
var localizationConfig =LocalizationConfiguration(locale: Locale(identifier: "fr-FR"))
72
+
73
+
// Use intellisense CommunicationUISupportedLocale to get supported Locale struct
@@ -87,23 +108,29 @@ You can see below the right-to-left layout mirroring, by default without specify
87
108
88
109
### Customizing Translations
89
110
90
-
There are two options to customize the language translations that we provide. To override a particular string, you can find the list of localization keys here for the key-value pair. You can specify the `languageCode` to be one of the supported languages, and when a key isn't provided, will fall back to our supported translation string. If you specified an unsupported language, you should provide translations for all the keys for that language (using Localizable.strings file), and will fall back to English strings when a key isn't provided.
111
+
There are two options to customize the language translations that we provide. To override a particular string, you can find the list of localization keys here for the key-value pair. You can specify the `locale` to be one of the supported languages, and when a key isn't provided, will fall back to our supported translation string. If you specified an unsupported language, you should provide translations for all the keys for that language (using Localizable.strings file), and will fall back to English strings when a key isn't provided.
91
112
92
113
Let's say you wish to have the `ControlBar` with strings from our English (US) locale but you want to change the label of `JoinCall` button to "Start Meeting" (instead of "Join call") in Setup View.
93
114
94
115
#### Override using Localization.strings file
95
116
96
-
Enable Localization in the Project, below for the `languageCode` you want to override. Create a `Localizable.strings` file (or other filename with extension `.strings`) with the key-value pair for selected keys you want to override. In the example below, we're overriding the key `AzureCommunicationUI.SetupView.Button.JoinCall`.
117
+
Enable Localization in the Project, below for the `locale` you want to override. Create a `Localizable.strings` file (or other filename with extension `.strings`) with the key-value pair for selected keys you want to override. In the example below, we're overriding the key `AzureCommunicationUI.SetupView.Button.JoinCall`.
To specify you're overriding with Localization.strings, create a `LocalizationConfiguration` object to specify the `languageCode` and `localizationFilename`.
121
+
To specify you're overriding with Localization.strings, create a `LocalizationConfiguration` object to specify the `locale` and `localizationFilename`. Or when using the `locale` initializer, will look keys in Localizable.strings for `locale.collatorIdentifier` as the language in your project.
101
122
102
123
```swift
103
-
let localizationConfig =LocalizationConfiguration(languageCode: LanguageCode.fr.rawValue,
124
+
let localizationConfig =LocalizationConfiguration(locale: Locale(identifier: "fr"),
104
125
localizableFilename: "Localizable")
105
126
let callCompositeOptions =CallCompositeOptions(localization: localizationConfig)
106
127
let callComposite =CallComposite(withOptions: callCompositeOptions)
For VoiceOver to work properly for a localization, make sure the language is added into your app's Localizations. So the VoiceOver will detect the app supports the language specified in LocalizationConfiguration locale, and select the Speech voice for the language using the voice found in device's Settings -> Accessibility -> Speech. You can verify if the language is added to your project as shown below.
Copy file name to clipboardExpand all lines: articles/communication-services/quickstarts/ui-library/includes/get-started-call/ios.md
+10-5Lines changed: 10 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,11 +38,11 @@ Name the project `UILibraryQuickStart` and select `Storyboard` under the `Interf
38
38
2. Add the following to your Podfile:
39
39
40
40
```
41
-
platform :ios, '13.0'
41
+
platform :ios, '14.0'
42
42
43
43
target 'UILibraryQuickStart' do
44
44
use_frameworks!
45
-
pod 'AzureCommunicationUI', '1.0.0-beta.2'
45
+
pod 'AzureCommunicationUICalling', '1.0.0-beta.1'
46
46
end
47
47
```
48
48
@@ -79,7 +79,7 @@ Go to 'ViewController'. Here we'll drop the following code to initialize our Com
79
79
```swift
80
80
importUIKit
81
81
importAzureCommunicationCalling
82
-
importAzureCommunicationUI
82
+
importAzureCommunicationUICalling
83
83
84
84
classViewController: UIViewController {
85
85
@@ -230,12 +230,17 @@ let callCompositeOptions = CallCompositeOptions(theme: CustomThemeConfiguration(
230
230
231
231
### Apply localization configuration
232
232
233
-
You can change the language by creating a custom localization configuration and include it to your `CallCompositeOptions`. By default, all text labels use our English (`LanguageCode.en.rawValue`) strings. If desired, `LocalizationConfiguration` can be used to set a different `languageCode`. Out of the box, the UI library includes a set of `languageCode` usable with the UI components. `LocalizationConfiguration.supportedLanguages` provides a list of all supported languages.
233
+
You can change the language by creating a custom localization configuration and include it to your `CallCompositeOptions`. By default, all text labels use our English (`CommunicationUISupportedLocale.en`) strings. If desired, `LocalizationConfiguration` can be used to set a different `locale`. Out of the box, the UI library includes a set of `locale` usable with the UI components. `LocalizationConfiguration.supportedLanguages` provides a list of all supported languages.
234
234
235
235
For the example below, the composite will be localized to French (`fr`).
236
236
237
237
```swift
238
-
let localizationConfiguration =LocalizationConfiguration(languageCode: "fr")
238
+
// Creating swift Locale struct
239
+
var localizationConfiguration =LocalizationConfiguration(locale: Locale(identifier: "fr-FR"))
240
+
241
+
// Use intellisense CommunicationUISupportedLocale to get supported Locale struct
0 commit comments