CSV

Simple CSV files, fields separated by comma.

File Extensions.csv
API Extensioncsv
Format Optionskey_index, comment_index, column_separator, quote_char, header_content_row, enable_pluralization
ImportYes
ExportYes
Pluralization supported?Yes
Descriptions supported?Yes

Example

boolean_key,"--- true
"
empty_string_translation,""
key_with_description,Check it out! This key has a description! (At least in some formats),This is the amazing description for this key!
key_with_line-break,"This translations contains
a line-break."
nested.deeply.key,"Wow, this key is nested even deeper."
nested.key,This key is nested inside a namespace.
null_translation,
pluralized_key.one,Only one pluralization found.
pluralized_key.other,"Wow, you have %s pluralizations!"
pluralized_key.zero,You have no pluralization.
sample_collection,"---
- first item
- second item
- third item
"
simple_key,Just a simple key with a simple message.
unverified_key,This translation is not yet verified and waits for it. (In some formats we also export this status)

Params

OptionTypeUploadDownloadDefaultDescription
locale_mappinghashcheckcloseHash mapping each locale name to the column index it is contained in. Column indices start at 1.

Format Options

OptionTypeUploadDownloadDefaultDescription
key_indexintegercheckclose1Index of the column containing the key names. Column indexes start at 1.
comment_indexintegercheckclose3Index of the column containing description for the key. Column indexes start at 1.
column_separatorstringcheckclose,Char that is used to separate rows.
quote_charstringcheckclose"Char that is used to quote CSV columns.
header_content_rowbooleancheckclosefalseIndicates whether the first row contains only header information and should be skipped.
enable_pluralizationbooleancheckclosefalseEnables detection of pluralized keys. All matching keys will be persisted as pluralized keys.

File structure

A typical CSV file should be structured like this:

1 (Key column), 2 (Translation column), 3 (Comment column)
app_title,      My Software Project,    This is the main title
apples.zero,    one apple,              my comment
...

Configuration example

An example for the push section in your .phraseapp.yml for CSV files.

push:
  sources:
  - file: "./multi.csv"
  params:
  update_translations: true
    locale_mapping:
    en: 2
      de: 3
        format_options:
        comment_index: 4

Pluralization

This format uses named categories to identify the different pluralizations 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 pluralization?