PTC

Resource file formats PTC translates: PO, JSON, YAML, XLIFF

PTC translates PO, JSON, YAML, Android XML, Apple .strings, .stringsdict, .xcstrings and .plist, Java .properties, CSV and XLIFF. See an example of each.

On this page
  1. Gettext (.pot, .po)
  2. JSON (.json)
  3. YAML (.yaml, .yml)
  4. Android Strings (.xml)
  5. Apple Strings (.strings)
  6. Apple Stringsdict (.stringsdict)
  7. Apple String Catalogs (.xcstrings)
  8. Apple Property List (.plist)
  9. Java Properties (.properties)
  10. CSV (.csv)
  11. XLIFF (.xliff)
  12. Placeholders PTC detects and preserves
  13. Languages you can translate into
  14. Translate Your Resource Files with PTC

PTC (Private Translation Cloud) translates the resource files that store the text in your software - app labels, error messages, onboarding copy, and user content - while leaving keys, structure, and code untouched.

Pick a format below to jump to a working example of its source file, its translated form, and a link to the step-by-step guide for that format.

Gettext (.pot, .po)

Gettext splits translation across two files. The .pot template lists every translatable string in the source language, and each .po file pairs those strings with their translation for one target language.

Used for: WordPress themes and plugins, and Python internationalization.

Structure: every entry has a msgid (the original string) and a msgstr (its translation). PTC fills in each empty msgstr and never changes the msgid.

Source file

msgid "Hello, world!"
msgstr ""

Translated file

msgid "Hello, world!"
msgstr "¡Hola, mundo!"

How to translate PO and POT files

JSON (.json)

JSON stores translatable text as key-value pairs, where each key identifies a string and the value holds the text to translate. PTC translates the values and keeps every key intact.

Used for: web applications (React, Angular, Vue.js) and mobile apps (iOS, Android).

Source file

{
  "welcome_message": "Welcome to our app!",
  "error_message": "Something went wrong. Please try again."
}

Translated file

{
  "welcome_message": "¡Bienvenido a nuestra aplicación!",
  "error_message": "Algo salió mal. Inténtalo de nuevo."
}

JSON also stores related strings - such as a list of steps - in arrays. PTC translates each item and preserves the array order.

Source file

{
  "steps": [
    "Open the app.",
    "Log in to your account.",
    "Select your profile."
  ]
}

Translated file

{
  "steps": [
    "Abre la aplicación.",
    "Inicia sesión en tu cuenta.",
    "Selecciona tu perfil."
  ]
}

How to translate JSON files

YAML (.yaml, .yml)

YAML holds translatable text in a clean, indented set of key-value pairs. Each key names a string and its value carries the text. PTC translates the values and keeps the indentation and keys exactly as they were.

Used for: Ruby on Rails apps, static site generators (Jekyll, Hugo), and CI/CD pipeline configuration.

Source file

welcome_message: "Welcome to our app!"
error_message: "Something went wrong. Please try again."

Translated file

welcome_message: "¡Bienvenido a nuestra aplicación!"
error_message: "Algo salió mal. Inténtalo de nuevo."

How to translate Ruby on Rails apps

Android Strings (.xml)

Android wraps each translatable string in a <string> tag identified by a unique name. PTC translates the text inside the tags and keeps every name unchanged.

Used for: Android mobile apps (UI strings and messages).

Source file

<resources>
    <string name="welcome_message">Welcome to our app!</string>
    <string name="error_message">Something went wrong. Please try again.</string>
</resources>

Translated file

<resources>
    <string name="welcome_message">¡Bienvenido a nuestra aplicación!</string>
    <string name="error_message">Algo salió mal. Inténtalo de nuevo.</string>
</resources>

How to localize Android apps

Apple Strings (.strings)

An Apple .strings file is a simple key-value list where the key is the original text and the value holds the translation. Comments above an entry give translators context. Files use UTF-16 encoding by default and can be converted to UTF-8.

Used for: iOS and macOS applications (UI strings and system messages).

Source file

/* Welcome message shown on the home screen */
"welcome_message" = "Welcome to our app!";

/* Error message when something goes wrong */
"error_message" = "Something went wrong. Please try again.";

Translated file

/* Welcome message shown on the home screen */
"welcome_message" = "¡Bienvenido a nuestra aplicación!";

/* Error message when something goes wrong */
"error_message" = "Algo salió mal. Inténtalo de nuevo.";

How to localize iOS apps

Apple Stringsdict (.stringsdict)

A .stringsdict file handles plurals and other count-based wording that a flat .strings file cannot. It uses nested dictionaries to define a different string for each plural category, and PTC translates every plural form for the target language.

Used for: iOS and macOS apps that need plural forms, dynamic content, or gender-based wording.

Source file

<plist version="1.0">
<dict>
    <key>apples_count</key>
    <dict>
        <key>NSStringLocalizedFormatKey</key>
        <string>%#@apples@</string>
        <key>apples</key>
        <dict>
            <key>NSStringFormatSpecTypeKey</key>
            <string>NSStringPluralRuleType</string>
            <key>NSStringFormatValueTypeKey</key>
            <string>d</string>
            <key>one</key>
            <string>%d apple</string>
            <key>other</key>
            <string>%d apples</string>
        </dict>
    </dict>
</dict>
</plist>

Translated file

<plist version="1.0">
<dict>
    <key>apples_count</key>
    <dict>
        <key>NSStringLocalizedFormatKey</key>
        <string>%#@apples@</string>
        <key>apples</key>
        <dict>
            <key>NSStringFormatSpecTypeKey</key>
            <string>NSStringPluralRuleType</string>
            <key>NSStringFormatValueTypeKey</key>
            <string>d</string>
            <key>one</key>
            <string>%d manzana</string>
            <key>other</key>
            <string>%d manzanas</string>
        </dict>
    </dict>
</dict>
</plist>

How to localize iOS apps

Apple String Catalogs (.xcstrings)

String Catalogs are the modern Apple format that keeps every language in one JSON-based .xcstrings file. Each entry holds the source string plus a nested localization per language, and can carry developer notes, plural rules, and placeholders. PTC adds each target language as a new localization alongside the source.

Used for: any Apple platform app targeting iOS 15 / macOS 12 / tvOS 15 / watchOS 8 / visionOS 1 or later.

Source file

{
  "sourceLanguage" : "en",
  "strings" : {
    "welcome_message" : {
      "extractionState" : "extracted_with_value",
      "localizations" : {
        "en" : {
          "stringUnit" : {
            "state" : "translated",
            "value" : "Welcome to our app!"
          }
        }
      }
    }
  },
  "version" : "1.0"
}

Translated file

{
  "sourceLanguage": "en",
  "strings": {
    "welcome_message": {
      "extractionState": "extracted_with_value",
      "localizations": {
        "en": {
          "stringUnit": {
            "state": "translated",
            "value": "Welcome to our app!"
          }
        },
        "es": {
          "stringUnit": {
            "state": "translated",
            "value": "¡Bienvenido a nuestra app!"
          }
        }
      }
    }
  },
  "version": "1.0"
}

How to localize iOS apps

Apple Property List (.plist)

A .plist file stores simple key-value text in Apple's XML-based format. Unlike a Stringsdict, it carries plain strings with no plural logic, so it suits straightforward UI text and configuration values. PTC translates each value and keeps the keys.

Used for: iOS and macOS applications (UI text and configuration settings).

Source file

<plist version="1.0">
 <dict>
    <key>welcome_message</key>
    <string>Welcome to our app!</string>
    <key>error_message</key>
    <string>Something went wrong. Please try again.</string>
 </dict>
</plist>

Translated file

<plist version="1.0">
 <dict>
    <key>welcome_message</key>
    <string>¡Bienvenido a nuestra aplicación!</string>
    <key>error_message</key>
    <string>Algo salió mal. Inténtalo de nuevo.</string>
 </dict>
</plist>

How to localize iOS apps

Java Properties (.properties)

A Java .properties file lists one key=value pair per line, where the key identifies a string and the value holds the text. PTC translates the values and keeps the keys. Files use ISO-8859-1 by default and support UTF-8 for a wider character range.

Used for: Java web and desktop applications - UI elements, error messages, and system prompts.

Source file

welcome_message=Welcome to our app!
error_message=Something went wrong. Please try again.

Translated file

welcome_message=¡Bienvenido a nuestra aplicación!
error_message=Algo salió mal. Inténtalo de nuevo.

How to translate Java .properties files

CSV (.csv)

A CSV file holds one key-value pair per row: the first column is the key or original string, and the second column holds the translation. PTC translates the second column and keeps the keys and delimiters intact.

Used for: Magento and Adobe Commerce product descriptions and UI labels, and bulk import/export of localization data in e-commerce platforms.

Source file

"welcome_message","Welcome to our store!"
"error_message","Something went wrong. Please try again."

Translated file

"welcome_message","¡Bienvenido a nuestra tienda!"
"error_message","Algo salió mal. Inténtalo de nuevo."

How to translate CSV files

XLIFF (.xliff)

XLIFF is a standard exchange format that pairs each source string with its translation inside a <trans-unit>. PTC fills in each empty <target> and leaves the <source> and unit identifiers unchanged.

Used for: software and website localization, translation management systems, and CMS or authoring tools.

Source file

<xliff version="1.2">
  <file source-language="en">
    <body>
      <trans-unit id="1">
        <source>Hello, world!</source>
        <target></target>
      </trans-unit>
    </body>
  </file>
</xliff>

Translated file

<xliff version="1.2">
  <file source-language="en" target-language="es">
    <body>
      <trans-unit id="1">
        <source>Hello, world!</source>
        <target>¡Hola, mundo!</target>
      </trans-unit>
    </body>
  </file>
</xliff>

Placeholders PTC detects and preserves

Placeholders hold dynamic values such as names and dates. PTC detects them in your texts and keeps them unchanged during translation. Each resource file format has its own placeholder syntax, and PTC applies the rules of that format.

The formats PTC recognizes by default:

  • %service%
  • %{service}
  • :service:
  • ${service}
  • $service$
  • ''service''
  • [service]
  • @[service]
  • {{service}}, {{service_name}}
  • {service}, {service_name}

If your files use a placeholder format that PTC does not recognize, add your own pattern in the project's settings. When a text has so many placeholders that its meaning is unclear, PTC flags it and asks you for context.

Languages you can translate into

Translate your software into 40+ languages with PTC. This page lists all supported languages for your software localization project.

Arabic Bengali Bulgarian Chinese (Simplified) Czech Danish Dutch Estonian Finnish French German Greek Hebrew Hindi Hungarian Indonesian Irish Italian Japanese Korean Latvian Lithuanian Malay Norwegian Polish Portuguese Portuguese (Brazil) Romanian Russian Serbian Somali Spanish Slovak Slovenian Swedish Tagalog Thai Turkish Ukrainian Vietnamese Welsh

In each of these languages, PTC delivers precise translations with the right terminology and tone.

Translate Your Resource Files with PTC

Once you start a 30-day trial, translating your resource files with PTC is simple. Translate up to 20,000 words into 2 languages. When you’re ready for more, activate Pay-As-You-Go pricing for unlimited translations into unlimited languages - you only pay for what you translate.

You choose how to handle translations and provide context, and PTC delivers human-quality translations at machine speed and cost.

Learn more in our Getting Started Guide.

Last updated: