File configurations

Choose how each file format is read: whether strings contain HTML, which Excel sheets and columns to translate, which HTML attributes and XML elements count. A configuration per format for each project and template, and another one for a single upload when you need it.

What a file configuration is

A file configuration holds the import options of one file format: what in a file of that format is text to translate, and how its tags are read. These formats have file configurations:

Format Files Options
HTML .html, .htm Attributes to translate, meta description, preformatted text
Excel .xlsx Strings contain HTML, tag patterns, sheets, header row, columns, target columns, context column
JSON .json Strings contain HTML, tag patterns
PO .po, .pot Strings contain HTML, tag patterns
Plain text .txt Strings contain HTML, tag patterns
Markdown .md Tag patterns
MDX .mdx Tag patterns
XML .xml (not Android string resources) Elements to skip, do-not-translate markers, inline elements, references

Other formats are read the same way every time; File formats says how.

Every format has a built-in Default configuration, the one a file is read with when nothing else is picked. The Markdown Default protects template code in {% … %} and {{ … }}, and HTML tags such as <b>; a tag is protected with its attributes, so an image's alt text is not translated. The MDX Default protects HTML and JSX tags, { } expressions and HTML entities such as &nbsp; inside text. JSON, PO, plain text and Excel also have a built-in Plain text strings configuration. Built-in configurations cannot be changed; duplicate one to make your own. Your organization can keep any number of its own per format, each under its own name.

Pick a project's configurations

Each project and template names one file configuration per format, in the File configurations card of its settings, under File import settings. The list is closed at first; its heading names the formats that have a pick, or says All Default. Click it to see one picker per format; a note under them says that other file types need no configuration and links to the supported formats. A format shows Default (built-in) until you pick another configuration, and picking it again goes back to it. Your organization's default carries an Org default label in the picker. The same card is on the New project page and on a template.

A project made from a template takes the template's configurations. A new project or template without a template starts with your organization's default for each format (below).

Each file keeps the options it was read with. A change of the project's configuration, or of the configuration itself, applies to files uploaded afterwards; files already in a project stay as they are.

Your organization's default

The File import settings tab lists the configurations in one table, grouped under their format. Each format is closed at first, with its organization default beside its name; click a format, or Expand all, to see its configurations. The search box finds configurations by name and opens the formats that have a match. Complete list of supported file types, under the table, opens the formats OpenLoc reads, including those that need no configuration.

Set as org default on a configuration makes it the starting pick of its format for new projects and templates made without a template; the configuration shows an Org default label. A built-in configuration can be the default too. Remove org default goes back to the built-in Default, which carries the Org default label while no other configuration is set. Changing the default leaves existing projects and templates as they are.

Pick another configuration for one file

The upload dialog on a project's Files tab shows a File configuration row for each file whose format has configurations, set to the project's configuration for that format. Pick another one to read just that file with it. A long list of files scrolls. An XML configuration picked for a .xml file that turns out to be Android string resources is ignored.

On the New project page, a file you drop asks for its file configuration when its format has a configuration of your organization. A format with only the built-in configurations uploads straight away, with the form's pick. The form's picks are saved to the draft before the upload; if that fails, Draft not saved appears with the reason and nothing is uploaded.

Create or change a configuration

Owners, admins and project managers manage file configurations, set the organization's defaults and pick configurations for projects and templates. Roles and permissions says who else can read them.

  1. In the left menu, open File configurations, then the File import settings tab.
  2. Click New file configuration. To start from an existing configuration, pick it under Copy from (optional), or click Duplicate on it in the list: the form starts with its format and options.
  3. Choose the Format and enter a Name. A copy keeps the format of the configuration it copies; the format of a saved configuration never changes.
  4. Set the Import options (below) and save.

A name is used once per format. If someone else saved the configuration while you were editing it, the save is refused: reload it and make your changes again.

Deleting a configuration is refused while a template uses it or while it is your organization's default: pick another configuration for those templates, or another default, first. Projects that use it go back to the format's Default.

Import options

Strings contain HTML

JSON, PO, plain text and Excel. When on, tags in the strings, such as <b>, become protected tags. Turn it off when the strings are plain text: a <b> is then ordinary text, and the translation is written exactly as typed. It covers tags only: text in attributes, such as title or alt, is not translated, and the options of HTML configurations do not apply to these strings.

Tag patterns

JSON, PO, plain text, Excel, Markdown and MDX. Each row is a regular expression (Go RE2 syntax) with an optional name. Text a pattern matches becomes a protected tag that translators cannot change, such as {{ user.name }}; the editor shows its code, shortened, instead of a number, and the translated file gets the source's original text back. A configuration has at most 20 patterns of at most 200 characters each, and a pattern that matches empty text is refused.

Add pattern adds an empty row. The arrow beside it lists common patterns to add in one click: Template output {{ … }}, Template tag {% … %}, Placeholder { … }, Square brackets [ … ] and printf placeholder %s, %1$d. HTML and XML configurations have no tag patterns.

Excel sheets and columns

These rules choose what to translate in a workbook whose row 1 does not hold language codes:

With rules, the upload dialog's column step starts from them, so a workbook of the same shape needs no choices. With no sheets, no columns, no header row, no target columns and no context column, the upload asks which columns to translate. A workbook with language codes in row 1 is read by its languages and ignores the rules.

With target columns, text already in a language's column is imported as that language's translation, to review, and each language's translations go back into that column, on the source text's row. A Translated file download of several of the file's languages, such as from the file's row on the Files tab, is one workbook with each of them in its column; one language alone fills only its column. Two languages that would share a column, such as French and French (Canada) when only French has one, cannot be downloaded together: download them one at a time, or give each its own column. A job in a regional variant, such as French (Canada), uses the column of its base language when it has none of its own. A language with no column cannot be exported to the workbook: the export says so, and the bilingual XLIFF export still works. A file keeps the columns it was uploaded with, so a language added to the configuration later applies to files uploaded after the change.

HTML

XML

Every element with text is translated, except what these lists leave out. Names are case-sensitive, as in XML.

Related