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 =2let 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 =3let message: Stringif 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)
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 foldermkdir-pen.lproj# 2. Generate the strings file (run this from your project root)find.-name"*.swift"-execgenstrings-oen.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
In Xcode, go to Product → Export Localizations.
Select your source language (English) and click Save
Choose a location and save the .xcloc file
To extract the .strings file from .xcloc:
Right-click the .xcloc file in Finder and select Show Package Contents
Go to Contents → Localized Contents → en.xcloc → Localized Contents
Find Localizable.strings and copy it
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:
In Xcode, right-click your en.lproj folder in the Project Navigator
Select New File and under iOS → Resource, choose Strings Dict File
Name it Localizable.stringsdict (the name must match your .strings file name)
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
Click Create
Next, you need to manually add the plural strings.
For example, if you have this code:
swift
let count =2let 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:
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:
In Xcode, right-click your project in the Project Navigator
Select Add Files to [YourProjectName]
Select your en.lproj folder
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.
In Xcode, confirm the files are added to your project
Use your Git tool (or terminal) to stage and commit the files
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.
Grant PTC read and write access so it can detect your .strings and .stringsdict resource files
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.
Review the pull/merge request containing your translations and check that filenames and structure match what your software expects
Merge the translations
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:
Build and run your app to apply the updated .strings and .stringsdict files
Test plural forms with different numbers to verify .stringsdict rules work correctly
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:
Go to Translations → Paste to translate
Add your app’s name, subtitle, short and long descriptions, and keywords
Select the target languages
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.
iOS Localization: Translate .strings and .stringsdict Files with PTC
Start typing and press enter to search
Manage Cookie Consent
We use cookies to optimize our website and services. Your consent allows us to process data such as browsing behavior. Not consenting may affect some features.
Functional
Always active
Required for our website to operate and communicate correctly.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes.The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
These cookies track your browsing to provide ads relevant to you.