Skip to content
Apps By Cube Localization Team 7 min read

Localizing JSON, XLIFF, PO and RESX Files: Formats Explained

JSON, XLIFF, PO and RESX all store the same thing, pairs of keys and text, but each has its own rules for plurals, comments, placeholders and escaping.…

Localizing JSON, XLIFF, PO and RESX Files: Formats Explained

Short answer: JSON, XLIFF, PO and RESX all store the same thing, pairs of keys and text, but each has its own rules for plurals, comments, placeholders and escaping. JSON is common in web apps, XLIFF is the industry exchange standard, PO comes from gettext, and RESX belongs to .NET. Choose the one your framework uses, then protect its syntax during translation.

Every localized product eventually becomes a pile of resource files. Developers rarely think about them until something breaks: a translated JSON file fails to parse, an Arabic plural is missing, or a placeholder comes back renamed. Most of these problems have nothing to do with language and everything to do with format. This guide explains the four formats software teams send to translators most often, what each one looks like, where it goes wrong and how to prepare it so translations come back clean.

Why the file format matters for translation

A resource file mixes two kinds of content: text that should be translated and structure that must never change. The structure includes keys, attributes, placeholders, markup and escape characters. Translators work in computer-assisted translation (CAT) tools or a translation management system that parses the file, shows only the translatable text and protects the rest. That only works if the parser understands your file.

Problems usually come from three places:

  • The parser is not configured for your conventions, so placeholders such as %1$s or {{name}} are shown as plain text that a translator can edit or delete.
  • The format cannot express what the language needs, such as six Arabic plural forms in a file that only allows singular and plural.
  • Context is missing, because the format supports comments but nobody wrote any.
Flat lavender illustration of a developer and a translator looking at the same resource file on a large screen, with code brackets on one side and translated text on the other
The same file has to make sense to a parser, a developer and a translator.

The four formats at a glance

Comparison of six things to get right in localization files: keys, placeholders, plurals, comments, escaping and encoding
Six details decide whether a resource file survives translation.
FormatTypical useComments for translatorsPlural supportMain trap
JSONWeb and JavaScript apps (i18next, react-intl, vue-i18n)Not native; needs a convention or separate fileVia library conventions or ICU messagesEscaping and invalid syntax
XLIFFExchange format; Apple and Angular exportsYes, notes per unitDepends on the producing toolVersion differences (1.2 vs 2.x)
PO (gettext)PHP, Python, C, WordPress, Linux appsYes, extracted comments and referencesYes, native plural forms per languageWrong plural header for the target
RESX.NET applicationsYes, a comment element per entryNo native supportNon-text resources mixed with strings
Every format, one workflow

JSON

JSON is the default for most web front ends. A flat or nested object maps keys to strings:

{
  "cart": {
    "title": "Your cart",
    "items": "{count, plural, one {# item} other {# items}}",
    "greeting": "Hi {{name}}, welcome back"
  }
}

What goes wrong. JSON has no standard plural or comment syntax, so every library invents its own. i18next uses suffixed keys such as items_one and items_other; other libraries embed ICU MessageFormat inside the string. A translator who sees raw ICU text without guidance may translate the keywords plural or other, which breaks the message. Unescaped double quotes in the translation make the whole file invalid.

How to prepare it. Tell your vendor which library and placeholder style you use, so the parser can lock {{name}} or {count}. If you use suffixed plural keys, make sure the target file will contain every plural category the language needs. For Arabic that means zero, one, two, few, many and other, as defined by CLDR. Keep context in a separate descriptions file or in the TMS if your library has no comment convention.

XLIFF

XLIFF (XML Localization Interchange File Format) was designed for translation exchange. Each unit holds a source, a target and optional notes:

<trans-unit id="checkout.pay" maxwidth="20">
  <source>Pay now</source>
  <target></target>
  <note>Button on the payment screen. Keep short.</note>
</trans-unit>

What goes wrong. There are two main versions in use, 1.2 and 2.x, with different element names. Tools that produce XLIFF (Xcode localization exports, Angular's extraction tool and others) each add their own conventions. Inline placeholders may be represented as special elements; if they are converted to plain text along the way, they lose their protection.

How to prepare it. Send the file exactly as your tool exported it and say which tool produced it. Do not "clean up" XLIFF by hand. Use the note element for context and, where the producing tool supports it, length limits. When files come back, re-import them with the same tool and check the result in the build.

PO (gettext)

PO files come from the GNU gettext system and are widely used in PHP, Python and WordPress. The source text itself acts as the key:

#. Shown after the user deletes a file
#: src/files.py:88
msgid "File deleted"
msgstr ""

msgid "%d file"
msgid_plural "%d files"
msgstr[0] ""
msgstr[1] ""

What goes wrong. The number of msgstr[n] entries is controlled by the Plural-Forms header. If the header is copied from English, an Arabic file will only have two plural slots instead of six. Because the source text is the key, fixing a typo in English invalidates every translation of that string. Fuzzy entries (marked #, fuzzy) are often ignored at runtime, so text that looks translated may not appear.

How to prepare it. Generate target files from the POT template with the correct header for each language. Use extracted comments (#.) to explain short or ambiguous strings. Agree with your vendor how fuzzy entries should be handled before delivery.

RESX

RESX is the XML resource format used by .NET. Each entry has a name, a value and an optional comment:

<data name="LoginError" xml:space="preserve">
  <value>Incorrect password. {0} attempts left.</value>
  <comment>{0} is a number</comment>
</data>

What goes wrong. RESX files can contain images, file references and other non-text resources next to strings, and these must not be touched. There is no native plural mechanism, so developers often build sentences from pieces, which rarely translates well. Numbered placeholders like {0} are easy to lose or reorder incorrectly.

How to prepare it. Send only the neutral-language file and let the tool create the culture-specific files, such as Strings.ar.resx. Use the comment element to explain every placeholder. Where a sentence depends on a number, consider moving to a library that supports ICU plural rules.

A typical case: a team sends a set of resource files in mixed formats, some JSON with ICU plurals and some older PO files with an English plural header. Before translation, our engineers configure the parsers so every placeholder is locked, regenerate the PO headers for each target language, and add plural slots so Arabic gets all six forms. Linguists then see only translatable text, and the files go back through automated checks before delivery.

Other formats you will meet

  • Android XML (strings.xml) with <plurals> elements and apostrophes that must be escaped.
  • Apple string catalogs and .strings / .stringsdict files for iOS and macOS, managed through Xcode.
  • YAML in Ruby on Rails and some static site generators, where indentation is part of the syntax.
  • ARB in Flutter, a JSON-based format with metadata entries for descriptions and placeholders.

The same rules apply to all of them: know which parts are structure, lock them, and give translators context. Our guide to iOS and Android app localization covers the mobile formats in more detail.

A checklist before you send files

  1. Send the original files, not copies pasted into a spreadsheet.
  2. Tell the vendor which framework and placeholder syntax you use.
  3. Add comments for short, ambiguous or concatenated strings.
  4. Check that plural handling supports every category the target language needs.
  5. Remove dead keys so nobody pays to translate them.
  6. Agree on encoding (UTF-8 is the safe default) and line endings.
  7. Plan a validation step: parse every returned file in CI before merging. This is a core part of continuous localization.

Our engineers work with JSON, XML, XLIFF, PO, RESX and many other formats, and build custom parsers when a format is not supported by standard tools. Read about our localization engineering work, explore our web and software localization service, or get a quote by sending a sample file.

Flat lavender illustration of a developer smiling at a laptop showing a green build check next to an app screen in Arabic and English
Clean files in, clean files out: the build passes on the first try.

Frequently asked questions

Which localization file format is best?

There is no universal best. Use the format your framework supports natively, because conversion adds risk. What matters most is support for comments, placeholders and the plural rules of your target languages.

Should I convert my files to XLIFF before translation?

Usually not. Modern translation tools read JSON, PO, RESX and mobile formats directly. Converting to XLIFF yourself only helps if your vendor's tools cannot parse your native format, and a good vendor will handle that conversion for you.

Can translators work in a spreadsheet instead?

They can, but it removes placeholder protection, translation memory and automated checks. Copying text into and out of spreadsheets is one of the most common sources of broken files.

How do I handle Arabic plurals in JSON?

Use ICU MessageFormat or your library's plural key convention, and make sure the Arabic file includes all six CLDR categories. Libraries such as i18next resolve the right form at runtime based on the number.

What encoding should localization files use?

UTF-8 is the safe default for almost every modern format. Older Windows tools sometimes produce other encodings, so state your expectation clearly and validate files on return.