iOS Localization: Translate .strings and .stringsdict Files with PTC

PTC gives you Better Than Human AI translations for Apple’s .strings and .stringsdict files used in iOS and macOS app localization. Learn how to prepare the files and connect your project to PTC to get translations delivered to your repository.

Translating Your App for the First Time with PTC

To localize your iOS or macOS app, you’ll work with two types of files:

  • .strings for static UI text like labels, buttons, and alerts
  • .stringsdict for plural forms and dynamic text based on numbers or variables

The setup takes a few steps. You’ll prepare your code so Xcode can export the right strings, organize your localization files, connect your repository to PTC, and provide some basic context. After that, PTC handles the translations automatically and keeps them up to date.

Step 1: Prepare Your Code for Localization

 Prepare your code so Xcode knows what to include in localization and how to handle it.

To fully localize your app, you need to handle:

1. Static User Interface Text 

Use NSLocalizedString() for things like button labels, error messages, and fixed user interface (UI) text.

Correct:

swift

label.text = NSLocalizedString("LOGIN_BUTTON", comment: "Button label for login")

Incorrect:

label.text = "Submit"

Hardcoded strings won’t appear in the .strings file you’ll soon need to create, so PTC won’t see or translate them.

2. Plurals or Logic-Based Text 

If the text changes based on a number or rule (for example, 1 vs. 5 items), use a key that will be defined in a .stringsdict file. You’ll still call it using NSLocalizedString() and String(format:).

Correct:

swift

let count = 2
let message = String(format: NSLocalizedString("unread_messages", comment: "Shows number of unread messages"), count)

Later, you’ll define the pluralization logic for unread_messages in a .stringsdict file.

Incorrect:

swift

let count = 3
let message: String

if count == 1 {
    message = "You have 1 unread message"
} else {
    message = "You have \(count) unread messages"
}

This works in English, but breaks localization:

  • PTC won’t see these strings, so it can’t translate them
  • Many languages have more than two plural forms and they don’t follow the same rules as English
  • Your app won’t adapt properly for other languages

Step 2: Set Up Dynamic Content in Xcode

Just like with static and plural text, use NSLocalizedString in your code to mark dynamic content for translation. This includes names, numbers, or other variables. Avoid splitting up or concatenating sentences.

Correct:

swift

let userName = "John"
label.text = String(format: NSLocalizedString("WELCOME_USER", comment: "Welcome message with user name"), userName)
s"), count)

Incorrect:

swift

label.text = NSLocalizedString("HELLO", comment: "") + userName

This example splits the sentence into parts. Since different languages use different grammar or word order, you might end up with unnatural or incorrect translations.

Step 3:  Generate Your .strings File

You can create a .strings files in two ways, depending on your preferred workflow:

Option A: Use genstrings 

Start by making sure you have Xcode Command Line Tools installed (xcode-select --install)

Then, in Terminal, go to your project root and run:

# 1. Create the English localization folder
mkdir -p en.lproj

# 2. Generate the strings file (run this from your project root)
find . -name "*.swift" -exec genstrings -o en.lproj {} \;

This creates a file called Localizable.strings inside the en.lproj folder. It will contain all your NSLocalizedString() calls.

Option B: Use Xcode Export

  1. In Xcode, go to Product → Export Localizations.
  2. Select your source language (English) and click Save
  3. Choose a location and save the .xcloc file 

To extract the .strings file from .xcloc:

  1. Right-click the .xcloc file in Finder and select Show Package Contents
  2. Go to Contents → Localized Contents → en.xcloc → Localized Contents
  3. Find Localizable.strings and copy it
  4. Paste it into your project’s en.lproj folder

Step 4: Create a .stringsdict File

The .stringsdict file allows your app to handle plurals or logic-based variations in localized strings.

To create it:

  1. In Xcode, right-click your en.lproj folder in the Project Navigator
  2. Select New File and under  iOS → Resource, choose Strings Dict File
  3. Name it Localizable.stringsdict (the name must match your .strings file name)
  4. In the dialog that appears, make sure your app target is checked under Add to target. This ensures the file gets bundled with your app
  5. Click Create

Next, you need to manually add the plural strings. 

For example, if you have this code:

swift

​​let count = 2
let message = String(format: NSLocalizedString("unread_messages", comment: "Shows number of unread messages"), count)

Then in your .stringsdict file, you need to manually add a rule for unread_messages:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" 
    "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  <key>unread_messages</key>
  <dict>
    <key>NSStringLocalizedFormatKey</key>
    <string>%#@unread@</string>
    <key>unread</key>
    <dict>
      <key>NSStringFormatSpecTypeKey</key>
      <string>NSStringPluralRuleType</string>
      <key>NSStringFormatValueTypeKey</key>
      <string>d</string>
      <key>zero</key>
      <string>No unread messages</string>
      <key>one</key>
      <string>You have 1 unread message</string>
      <key>other</key>
      <string>You have %d unread messages</string>
    </dict>
  </dict>
</dict>
</plist>

Step 5: Make Sure the Files Are In Your Xcode Project

If you generated the .strings file using genstrings, you should see your files added to your Xcode project.

If you used Xcode Export, you need to add the files to your Xcode project so they’re bundled into your app and tracked in version control:

  1. In Xcode, right-click your project in the Project Navigator
  2. Select Add Files to [YourProjectName]
  3. Select your en.lproj folder
  4. Make sure Add to target is checked for your app and click Add

 You should now see Localizable.strings and Localizable.stringsdict under en.lproj in Xcode.

Step 6: Commit Your Localization Files

Before PTC can read and translate your content, your .strings and .stringsdict files need to be committed to your repository.

  1. In Xcode, confirm the files are added to your project
  2. Use your Git tool (or terminal) to stage and commit the files
  3. Push the commit to the correct branch

Step 7: Sign Up for PTC and Connect Your Repository

PTC works by connecting directly to your repository. Once connected, it scans your .strings and .stringsdict files, translates them, and sends the translations via merge request.

To get started:

  1. Sign up for a trial account, which lets you use all PTC features for free for 30 days.
  2. Integrate PTC with your GitLab, GitHub, or Bitbucket repository
  3. Grant PTC read and write access so it can detect your .strings and .stringsdict resource files
  4. Review and confirm output paths for the translated files

Step 8: Provide Product Context and Choose Languages

PTC uses advanced AI to deliver Better Than Human Translations, but to do this, it needs just a bit of context. You’ll be asked to name your app, describe what it does, and explain who it’s for. This gives PTC the background it needs to translate strings with the right meaning for your app.

Providing information about your app during project setup in PTC

Next, choose the languages you want to translate into. Choose from over 33 supported languages—PTC delivers context-aware translations for each one.

Step 9: Review and Merge Your Translations

Once PTC processes your files, it will automatically create a merge request with your translated .strings and .stringsdict files for each target language.

  1. Review the pull/merge request containing your translations and check that filenames and structure match what your software expects
  2. Merge the translations 
  3. Pull the latest changes to your local repository

Step 10: Test Your Localization Setup

After merging the translations, test your app to make sure everything works correctly:

  1. Build and run your app to apply the updated .strings and .stringsdict files
  2. Test plural forms with different numbers to verify .stringsdict rules work correctly
  3. Check that both .strings and .stringsdict files are recognized and used by Xcode

Step 11: Translate and Update Your App Store Listing

Your app’s description text isn’t part of the .strings or .stringsdict files, so you need to translate it separately.

From the PTC dashboard:

  1. Go to Translations → Paste to translate
  2. Add your app’s name, subtitle, short and long descriptions, and keywords
  3. Select the target languages
  4. Copy the translations provided by PTC

Then, in App Store Connect:

  • Open your app and select the version you want to submit
  • Under Localizations, choose each language
  • Paste the translated text into the correct fields
  • Submit the version when you’re ready

This makes your app discoverable and appealing to users in their own language.

PTC Keeps Your iOS/macOS App Translations Up to Date

Once you integrate your Git repository with PTC, you don’t need to manage translations manually.

Whenever PTC detects new or updated strings in your .strings or .stringsdict files, it automatically creates a merge request with the latest translations. You can review and merge them just like any other code update.

If you update your App Store description, just paste the new version into Paste to translate and get the updated translations.

Your app stays fully localized — without adding extra steps to your development workflow.

Better Than Human Translations for Your iOS/macOS App

Sign up and start translating your .strings and .stringsdict files — free for 30 days.

Scroll to Top