---
title: Internationalization in Apple
description: Learn how to set up basic internationalization using field-level translation within your Apple project.
url: https://www.storyblok.com/docs/guides/apple/internationalization
---

# Internationalization in Apple

Learn how to create a basic implementation of field-level translation in an Apple project.

## Setup

In your space, open **Settings** → **Internationalization** → **Languages** and add `es` (Spanish).

-   In the article content type block schema, set the `title` and `content` fields as translatable.
-   Go to each article, select the Spanish language, and provide translated content. You can also use [AI Translations](https://www.storyblok.com/docs/editor-guides/ai-translations).

> [!NOTE]
> Learn more in the [internationalization concept](/docs/concepts/internationalization).

## Use the device locale

Update `ExampleApp.swift` to determine the language from the device locale.

Example/ExampleApp.swift

```swift
…
@main
struct ExampleApp: App {
    @State private var path = NavigationPath()

    private static let availableLanguages = ["es"]

    private let client = StoryblokClient(
        library: Block.self,
        accessToken: "YOUR_ACCESS_TOKEN",
        version: {
            #if DEBUG
            .draft
            #else
            .published
            #endif
        }(),
        region: .eu, // Choose the correct region from your Space.
        language: Locale.preferredLanguages
            .map { Locale(identifier: $0).language.languageCode?.identifier ?? $0 }
            .first { availableLanguages.contains($0) }
    )
…
```

First, an array with all language codes configured in the space is defined.

Next, [`Locale.preferredLanguages`](https://developer.apple.com/documentation/foundation/nslocale/preferredlanguages) lists the user’s preferred languages in order of preference, and the first match among the languages available in the space is passed to the [`StoryblokClient`](https://storyblok.github.io/storyblok-swift/documentation/storyblokclient/storyblokclient) initializer via its `language` parameter.

> [!TIP]
> Use the `fallbackLanguage` parameter of the [`StoryblokClient`](https://storyblok.github.io/storyblok-swift/documentation/storyblokclient/storyblokclient) initializer to specify which language to fall back to for fields that have not been translated yet.

To test the implementation, change the device language to Spanish under **Settings** → **General** → **Language & Region**, or add a Spanish localization to your project to enable a per-app language preference. The app now renders the translated article content.

> [!NOTE]
> Internationalization is highly implementation-specific. Instead of relying on the device locale, you may, for example, want to offer an in-app language picker and store the selection, passing it as the `language` parameter.

## Related resources

[Concept: Internationalization](/docs/concepts/internationalization)

[StoryblokClient Reference](https://storyblok.github.io/storyblok-swift/documentation/storyblokclient/storyblokclient)

[Apple Developer: Supporting Multiple Languages in Your App](https://developer.apple.com/documentation/xcode/supporting-multiple-languages-in-your-app)

## Pagination

-   [Previous: Content Modeling in Apple](/docs/guides/apple/content-modeling)
