Everything you need to know about translating Excel XLSX spreadsheets and how to handle them in Phrase.
File Extensions | .xlsx |
API Extension | xlsx |
Import | Yes |
Export | Yes |
Pluralization supported? | Yes |
Descriptions supported? | Yes |
Excel XLSX is a widely-used file format for localization. Though the layout of an XLSX file may differ based on specific settings, it generally follows the one-column-per-language convention. To translate Excel XLSXs using Phrase, you need to provide at least the key name column and one translation column. By default, the content is assumed to start in the first row. Along with the keys and translation you can also import meta-information like comments, tags and the maximum characters allowed for the translations.
Params
Locale Mapping
Identifier | locale_mapping |
Type | hash |
Upload | Yes |
Download | No |
Default | [empty] |
Description | Hash mapping each locale name to the column name it is contained in. |
Format Options
Key name column
Identifier | key_name_column |
Type | string |
Upload | Yes |
Download | No |
Default | [empty] |
Description | Column that contains the key name/identification. |
Comment column
Identifier | comment_column |
Type | string |
Upload | Yes |
Download | No |
Default | [empty] |
Description | Column that contains comment/description for a key. |
Tag column
Identifier | tag_column |
Type | string |
Upload | Yes |
Download | No |
Default | [empty] |
Description | Index of the column containing a tag for the key. |
First content row
Identifier | first_content_row |
Type | integer |
Upload | Yes |
Download | No |
Default | 1 |
Description | Index of first row to contain translation content. |
Enable plural forms
Identifier | enable_pluralization |
Type | boolean |
Upload | Yes |
Download | No |
Default | true |
Description | Enables detection of pluralized keys. All matching keys will be persisted as pluralized keys. |
Export tags
Identifier | export_tags |
Type | boolean |
Upload | No |
Download | Yes |
Default | false |
Description | Exports tags along with keys and translations. |
Export max characters
Identifier | export_max_characters_allowed |
Type | boolean |
Upload | No |
Download | Yes |
Default | false |
Description | Exports the key character limit along with keys and translations. |
Structure example
key_name |
en-US |
de-DE* |
comment* |
tags* |
max_characters* |
app_title | My Project | Mein Projekt | This is the main title | app, title | 30 |
greeting | Hi 'User'! | Hallo 'User'! | Be polite | ||
... |
*optional columns
The spreadsheet file needs at least the key column and one language in order to be uploaded. Apart from additional languages, the following columns can be added to add meta information:
- comment: to add a description to the key
- tags: to add tags to individual keys in the file
- max_characters: to set a character limit for a key through the upload
Configuration example
An example for the push section in your .phraseapp.yml for XLSX files.
push:
sources:
- file: "./en.xlsx"
params:
file_format: xlsx
update_translations: true
format_options:
key_name_column: A
comment_column: C
first_content_row: 2
tag_column: D
locale_mapping:
en: B
Plural forms
This format uses named categories to identify the different plural forms of a key. The following categories are reserved for pluralization:
.zero | .one | .two | .few | .many | .other
Example key names:
inbox.messages.notification.one
inbox.messages.notification.other
This way pluralized keys can be identified, persisted and marked accordingly.
Learn more about plural forms