Appearance.localizationProvider = { key, table in
Bundle.main.localizedString(forKey: key, value: nil, table: table)
}
Localization
Introduction
If your app supports multiple languages, the StreamVideo SDK has support for localizations. For example, you can add more languages, or you can change translations for the existing texts used throughout the SDK.
Adding a New Language
- If you don’t have
strings
orstringsdict
files in your project, add those new files toLocalizable.strings
andLocalizable.stringsdict
. - Next add new language to the project.
- Copy the StreamVideoUI localization keys into your
strings
andstringsdict
files. - Set the
localizationProvider
to provide yourBundle
instead of the one provided byStreamVideoSwiftUI
SDK (as early as possible in the App life-cylce, for example in theAppDelegate
):
- Now, you’re ready to implement your
strings
andstringsdict
files for different languages.
We recommend naming your strings
and stringsdict
files: Localizable.strings
and Localizable.stringsdict
.
Override Existing Languages
Overriding the existing language works in the same as adding a new language.
Resources
Every string included in StreamVideo can be changed and translated to a different language. All strings used by UI components are in these two files: