Supported Resource File Formats for Translation with PTC

PTC (Private Translation Cloud) supports various resource file formats that store translatable text like app labels, error messages, and user content.

For supported file formats, PTC provides two translation workflows:

  • Upload any supported file type to Free resource files translation and choose the languages you want to translate into. In minutes, you’ll get back the automatic translations, ready for you to download and add to your project.
  • With a PTC subscription, you connect PTC to your code repository and select a branch to manage translations. PTC automatically detects files needing translation, understands your project’s context, and delivers Better Than Human Translations. These translations are sent back as a merge request.

Below, you can find all the file formats that PTC supports, along with examples that will help you in preparing them for translation.

Gettext (POT, PO)

Technical Overview

File Extensions:

  • .pot (Portable Object Template): This file acts as a template, listing all the translatable strings in the original language.
  • .po (Portable Object): This file contains the actual translations in both the original and target languages.

Common Use Cases:

  • Open-source projects, like WordPress themes and plugins
  • Python internationalization

Structure:

Each .po file contains key elements:

  • msgid: The original string in the source language
  • msgstr: The corresponding translation in the target language

Encoding:

Example
po

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

How to prepare Gettext PO and POT files for translation with PTC

JSON (JavaScript Object Notation)

Technical Overview

File Extension:

  • .json

Common Use Cases:

  • Web applications (React, Angular, Vue.js)
  • Mobile apps (iOS, Android)

Structure:

  • Key-Value Pairs

JSON files often store text in simple key-value pairs. Each key represents the original string, and each value holds the translation.

Example
json

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

In a translated file, the values change to the target language:

json

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

JSON Array

json

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

File with translations:

json

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

How to prepare JSON files for translation with PTC

YAML (YAML Ain’t Markup Language)

Technical Overview

File Extension:

  • Ruby on Rails applications (for managing translatable strings)
  • Web applications and static site generators (e.g., Jekyll, Hugo)
  • Configuration files for CI/CD pipelines and software projects

Structure:

Example
yml

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

In a translated YAML file, the values change to the target language:

yml

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

How to prepare YAML files for translation with PTC

Android Strings (XML)

Technical Overview

File Extension:

  • Android mobile apps (UI strings and messages)

Structure:

Example

Source language file

xml

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

When translated, only the values inside the tags change, while the keys remain the same:

xml

<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 prepare Android XML files for translation with PTC

Apple Strings 

Technical Overview

File Extension:

  • iOS and macOS applications (UI strings, system messages, etc.)

Structure:

Example
strings

/* 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.";

In a translated file, the values change to reflect the target language, while the keys stay in the source language:

strings

/* 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.";

Apple Stringsdict

Technical Overview

File Extension:

  • iOS and macOS applications (handling plural forms, dynamic content, or gender-based language)

Structure:

Example
xml

<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>

In the translated version, only the values for the plural forms change to the target language, while the keys remain the same:

xml

<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>

Apple Property List

Technical Overview

File Extension:

  • iOS and macOS applications (UI text, configuration settings)

Structure:

Example
xml

<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>

In the translated file, the values change to reflect the target language:

xml

<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>

Java Properties

Technical Overview

File Extension:

  • Java-based web applications 
  • Desktop applications built with Java
  • Localization of UI elements, error messages, and system prompts

Structure:

Example
properties

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

In the translated version, the values change to reflect the target language, while the keys stay the same:

properties

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

CSV (Magento / Adobe Commerce)

Technical Overview

File Extension:

  • Magento and Adobe Commerce for managing product descriptions, UI labels, and other translatable strings
  • Importing and exporting large volumes of localization data in e-commerce platforms

Structure:

Example
csv

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

In the translated version, the second column changes to reflect the target language, while the keys remain the same:

csv

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

XLIFF (XML Localization Interchange File Format)

Technical Overview

File Extension:

  • Software and website localization
  • Translation management systems
  • Content management systems (CMS) and authoring tools

Structure: 

  • <source>: Contains the original string in the source language
  • <target>: Contains the corresponding translation in the target language.
  • <trans-unit>: Defines each translation unit, grouping the <source> and <target> pairs. Each <trans-unit> may have additional metadata, such as identifiers, context information, and status.

Encoding:

Example
<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>

Scroll to Top