# App-level Language Setting (iOS)

Firework iOS SDK supports an in-app language setting that is independent of the system language. After you switch the language, SDK UI (video feed, story block, player, live stream, etc.) will be rendered in the selected language, and right-to-left (RTL) layout is automatically applied for RTL languages such as Arabic.

## Swift integration

```swift
import FireworkVideo

// You should pass language code to this API, such as "en", "ar", "pt-BR" and "hu" etc.
// For the language codes we support, please refer to "Language support table" below.
FWSAppLanguageManager.shared.changeAppLanguage("ar")
```

The selected language is persisted by the SDK automatically, so it will be restored the next time the app is launched.

Please refer to the [Language support table](#language-support-table) to learn the languages we supported.

{% hint style="info" %}
Generally, the `changeAppLanguage` API should be called in the following cases:

1. The App is launched (e.g. in the `application(_:didFinishLaunchingWithOptions:)` method of your `AppDelegate`, or in the initializer of your SwiftUI `App`).
2. Users change the app language manually.
3. Other cases that change app language.
   {% endhint %}

### Reset to system language

Pass `nil` (or an empty string) to fall back to the system language and clear the cached value:

```swift
FWSAppLanguageManager.shared.changeAppLanguage(nil)
```

### Read the current app language

`appLanguage` is a read-only property that reflects the current SDK language. It is `nil` when the SDK is following the system language.

```swift
let current = FWSAppLanguageManager.shared.appLanguage
```

### Listen for language changes

The SDK posts a notification whenever the app language changes. You can observe it to refresh your own UI:

```swift
NotificationCenter.default.addObserver(
    forName: FWSAppLanguageManager.NotificationName.AppLanguageChanged,
    object: nil,
    queue: .main
) { _ in
    // Reload your UI here if needed.
}
```

### After changing the language

SDK components that are already on screen will not pick up the new language automatically. After calling `changeAppLanguage`, you should **recreate any active SDK components**, such as `FWSVideoFeedView` / `FWSVideoFeedSwiftUIView`, `FWSStoryBlockView` / `FWSStoryBlockSwiftUIView`, `PlayerDeckView` / `PlayerDeckSwiftUIView`, `CircleStoryView` / `CircleStorySwiftUIView`, etc., so they re-render with the new language and RTL layout.

You can use the [`AppLanguageChanged` notification](#listen-for-language-changes) as the trigger to perform this from a single place.

{% hint style="info" %}
The SDK automatically dismisses the full-screen player and stops the floating player when the app language changes, so you don't need to handle them yourself.
{% endhint %}

## Project setup: add localizations to your iOS project

iOS only loads localized resources for languages that your app's project declares as supported. As depicted in the screenshot below, you must add every language you want the Firework SDK to display in to your Xcode project's **Localizations** list — otherwise iOS will fall back to the development language for that language code.

<figure><img src="/files/dbMWyV4WcqcFlprqH0gC" alt=""><figcaption></figcaption></figure>

## Language support table

| Language                      | Language code |
| ----------------------------- | ------------- |
| English                       | en            |
| Arabic                        | ar            |
| Arabic (Saudi Arabia)         | ar-SA         |
| Arabic (United Arab Emirates) | ar-AE         |
| German                        | de            |
| Italian                       | it            |
| Japanese                      | ja            |
| Polish                        | pl            |
| Portuguese (Brazil)           | pt-BR         |
| Russian                       | ru            |
| Spanish                       | es            |
| Spanish (Mexico)              | es-MX         |
| Spanish (Colombia)            | es-CO         |
| Vietnamese                    | vi            |
| Thailand                      | th            |
| Hungarian                     | hu            |
| Turkish                       | tr            |
| French                        | fr            |
| Portuguese                    | pt            |
| Indonesian                    | id            |
| Swedish                       | sv            |
| Romanian                      | ro            |
| Traditional Chinese (Taiwan)  | zh-TW         |
| Traditional Chinese           | zh-Hant       |

{% hint style="info" %}
For consistency with our Android SDK, you can pass `zh-TW` to `changeAppLanguage`; the iOS SDK maps it internally to `zh-Hant-TW`.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.firework.com/firework-for-developers/ios-sdk/integration-guide-for-ios-sdk/app-level-language-setting-ios.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
