> ## Content Index
> Fetch the complete content index at: https://mertbulan.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# How to handle dynamic text with String Catalogs
- URL: https://mertbulan.com/how-to-handle-dynamic-text-with-string-catalogs/
- Published: 2024-04-20T16:01:35.000Z
- Updated: 2026-06-11T13:48:07.000Z
- Description: Using String Catalogs is a new way to localize your app, but how do you handle dynamic text?
- Author: Mert Bulan
- Tags: Swift, SwiftUI, programming, #Import 2026-06-11 15:00

While developing my new app, [Wunderbar](https://mertbulan.com/work/wunderbar), I wanted to localize the app for German and Turkish. I already knew that I could just create a Strings file for each language and use keys for the texts in the app. But then I remembered that Apple introduced a new way of localizing apps called [String Catalogs](https://developer.apple.com/videos/play/wwdc2023/10155?ref=mertbulan.com). I decided to give it a try.

It is very easy to use String Catalogs, you just need to create a new Strings Catalog file in Xcode, add the languages you want to support on Project > Info > Localizations, and then build your app. Xcode will automatically generate the keys for each language you added. The rest is just adding the translations for each key.

While testing my app, I realized that the texts that I used in Menu view were not listed in the Strings Catalog file because they were dynamicly generated from Enum values. First, I’ve tried to add the Enum values to the Strings Catalog file manually, but it didn’t work. Then after some research, I found out that I can use `LocalizedStringResource` function to handle dynamic text, and it worked like a charm.

```swift
Menu {
  ForEach(Language.allCases) { lang in
    Button("\(LocalizedStringResource(stringLiteral: lang.rawValue.capitalized))") {
      doSomething()
    }
  }
}

```

I hope this helps you too.