Transifex

  • Documentation
  • File formats
  • XLSX (Excel)

XLSX (Excel)

  • File extensions: .xlsx, .xlsm, .xltx, .xltm
  • i18n type: XLSX

XLSX, XLSM, XLTX, and XLTM are the spreadsheet file formats used by Microsoft Excel; they can also be read by and edited in other compatible programs such as LibreOffice and Google Docs. With these formats, all source strings and translations are in the same file, which differs from the usual source and language files structure in Transifex. When you upload a spreadsheet file that already has translations in it, Transifex will add both the source strings and translations to the database. Similarly, when you download the file from Transifex, translations from all languages will be in it.

Structuring your spreadsheet

Spreadsheets used for localization typically organize their languages and strings in columns. Each column represents one language, with the header row of the column specifying the language. And below that, you have the strings/translations for that language. For example:

+=========+=========+
| English | French  |
+---------+---------+
| Hello   | Bonjour |
+=========+=========+

You can use either the languages' names or their ISO codes as values for the header/language row.

How Transifex finds the language row

Transifex is pretty forgiving about how you format your spreadsheet file. If you have rows above the languages row – for example, with instructions for your translators – Transifex will simply skip them. So this file, for example, would still be compatible with Transifex:

+=========+===========+
| Use formal language |
+---------+-----------+
| English | French    |
+---------+-----------+
| Hello   | Bonjour   |
+=========+===========+

And if your file has more than one sheet in it, and your strings aren’t in the first sheet, Transifex will still try to find them.

In general, Transifex will look for your strings this way:

  1. Go through every sheet and row in the file in order
  2. Find the row which looks like the one with the language names
  3. Consider that row and the ones below it in the sheet that it was found in as the ones that hold the actual content

Extra columns and duplicate phrases

Provide Context

By default Transifex does not allow duplicate strings in Excel sheets unless you distinguish each phrase with a unique context. You can have columns between the language columns for context purposes. You can name such a column in any way you want, but a good convention is to name it Context. Transifex won't treat it as a translatable string. The contents of the column are added as developer comments for the phrase and shown in the Editor to Translators. Each note can have up to 1,000 characters.

Below you can find an example where English is the source language and Context column is present.

+=========+=========================+==========+
| English | Context                 | French   |
+---------+-------------------------+----------+
| Hello   | Appears in welcome page | Bonjour  |
| Hello   | Appears in signup page  | Bonjour! |
| World   |                         | Monde    |
+=========+=========================+==========+

Define keys in XLSX

In order to set the value of a key in an XLSX source file, you need to create a new column in your source file named "key". This "key" column should be next to (before or after) the source language column or next to (before or after) the "context" column.

The "key" column will get uploaded into the key field in Transifex. The key is useful for filtering in the visual context tool as well as for filtering in Transifex Web Editor.

Below you can find an example where English is the source language and "key" column is present.

Version #1:

+=========+=========================+==========+
| English | key                     | French   |
+---------+-------------------------+----------+
| Hello   | Appears in welcome page | Bonjour  |
| Hello   | Appears in signup page  | Bonjour! |
| World   | key1                    | Monde    |
+=========+=========================+==========+

Version #2:

+===========================+========+==========+
| key                       | English| French   |
+---------------------------+--------+----------+
| Appears in welcome page   | Hello  | Bonjour  |
| Appears in signup page    | Hello  | Bonjour! |
| key1                      | World  | Monde    |
+===========================+========+==========+

Define character limit in an XLSX source file

You can define character limits for the translations by adding this numerical limit in a separate column in your XLSX file.

Character limits must be added to a column named "Character limit". The name of this column is case insensitive and will consider spaces, dashes and underscores. As an example the following column names are acceptable:

  • character Limit
  • character-limit
  • chAraCtER_liMit

This column is not required, so in case you don't include this, Transifex will still parse your file.

Duplicate phrases

You can use the context column to differentiate between the same source phrases which should be translated in different ways. For example, if you have the word "Hello" twice in your file (same key is used for both phrases), and you want to allow translators to translate it differently in each case, you should provide different context for each one of the strings above to differentiate.

If you have duplicate English phrases and both "key" and "Context" are the same, Transifex will complain and will ask you to fix the error.

Note: If both key and context values are present in the source file, then the key and context will participate in the hash generation process, otherwise (if key is missing) the source string + context will participate in the hash generation process instead.

Mismatches between languages in the file and the project

In Transifex, each project has a set of target languages that it's translated to. If there are any differences between the languages in the uploaded file and the project, Transifex will try to deal with this as gracefully as possible.

Here's a look at a few possible scenarios:

  • If the file you upload has languages that aren't in the project, those languages will be ignored. Strings from those columns won't be added to Transifex nor appear in the Editor. To add those translations to Transifex, first add the language to the project then re-upload the file. Any content that isn't added to Transifex will remain in the file, unchanged, when you download the file.
  • If the project has languages that aren't in the file, the upload will proceed without issues, though of course, no translations will be uploaded for those missing languages. You can still translate those languages in the Editor. And when you download the file, the extra languages will be added as new columns at the end of your spreadsheet.

If you are unhappy with the order the languages appear or with the style of the extra columns, you can edit the file offline to make it look as you want and upload it again as a source file.

Uploading/downloading options

If you upload a file through the Update Source File function in Transifex, all strings in the file will be extracted from the spreadsheet. This means both source strings and translations will be updated inside Transifex. If, however, you upload the file through the Upload File function, only strings from the selected language will be uploaded to Transifex. This gives you more control over which languages get updated.

When you download a file, however, all available translations from all languages will be included in the downloaded file. You can still choose to download only reviewed strings when downloading, in which case, only the reviewed translations will be used.