How to Translate CSV Files with PTC

In software localization, CSV files organize text for translation. With PTC (Private Translation Cloud), translating these files is fast and easy.

CSV (Comma-Separated Values) files are simple, flexible text files. If you’re developing an app or extension for platforms like Shopify or Magento (Adobe Commerce) and want to translate it, you’ll need to use CSV files to store the translatable text.

Types of text usually stored in CSV files include:

UI Labels in an App

For example: Username, Password, Login

Dynamic Content with Placeholders

For example: Welcome, {username}!

Error Messages

For example: Invalid username or password.

In this tutorial, you’ll learn how to prepare CSV files for translation and how to use PTC to translate the content.

Understanding the Structure of a CSV File

CSV files with translatable text organize data into rows, with each row representing a unique text string. Values are separated by a delimiter, usually a comma (,), but sometimes tabs (\t), semicolons (;), or other characters. Check and use the correct delimiter when creating or exporting the file. Most tools and coding languages let you explicitly set the delimiter and encoding.

Here’s an example of a typical CSV file structure:

  • A unique identifier for each text string, like welcome_message or button_submit, to track each piece of text across languages.
  • The original text that needs translation. For example, the label “Username” or the welcome message “Welcome to our app.”

Key

Source Text ( English)

welcome_message

Welcome to our app!

button_submit

Submit

error_invalid_login

Invalid username or password.

notification_update_available

A new update is available.

label_username

Username

label_password

Password

Making CSV Files Ready for Translation

To get started with localization, you need a properly structured CSV file containing all the text strings that require translation. If your platform doesn’t automatically generate resource files, you can manually create a CSV file using tools like Excel or Google Sheets.

For a smooth translation process, you also need to correctly set up plurals, placeholders, and special characters. Otherwise, you risk mistranslations, awkward phrasing, or broken text in your software. 

Here are a few elements you should pay special attention to:

Plurals

Some languages use multiple plural forms (e.g., for “0 items“, “1 item”, and “many items”). Use a separate row for each form.

Example:

item_singular: “1 item”
item_plural: “{count} items”

Best Practices:

Besides separate rows, use clear keys like item_singular and item_plural for context.

Placeholders

Placeholders hold dynamic data like names, dates, or numbers.

Example:

welcome_message: “Welcome, {username}!”
time_left: “You have {0} minutes left.”

Best Practices:

Consistent formatting, like {0}{username}, or %s, keeps these elements intact during translation.

Special Characters

Use escape characters (e.g., backslashes) to handle special characters like quotation marks, commas, or newline characters in your CSV file. This helps avoid formatting issues in translation.

Example:

Text with quotes: She said, \"Hello!\"
Text with commas: "High-quality, durable item"
Text with newlines: "Instructions:\n1. Open the app\n2. Log in"

Best Practices:

Save files in UTF-8 to ensure special characters display correctly. Use validation tools like CSVLint to validate your file and catch errors.

Translating Your CSV File with PTC

To make localization fast and easy, PTC integrates with your development workflow. Here’s how it works:

Integration with Code Repositories

PTC connects to your GitLab, GitHub, or Bitbucket repository, automatically detecting new or modified CSV files that need translation.

Better Than Human Translations

PTC’s proprietary language model considers the context of your project and generates Better Than Human Translations that require little to no editing.

Merge Request with Translations

PTC sends you a merge request with the translations. It then continues to monitor your repository and translates any new or updated strings, so your multilingual versions stay current with minimal effort.

Once PTC finishes translating, you’ll get translations in separate CSV files for each language, keeping your project more organized, especially as it grows:

Original File ( English)

Translated File ( Spanish)

Get Your CSV Files Ready for Global Reach with PTC

In this guide, you’ve learned how to prepare and translate CSV files to localize your software. By organizing text with unique keys and handling plurals, placeholders, and special characters, you set up files for accurate translation.

With PTC, translation is easy. PTC integrates with your software repository, detects CSV files, and creates AI-powered translations. With its automatic translation updates, your software stays up-to-date in all languages.

Smarter CSV file translation starts here

Start your free 30-day trial of PTC and see how easy it is to get Better Than Human Translations for your projects.

Scroll to Top