Adds the CSV format to GlotPress to export/import translations and originals.
Adds the CSV format to GlotPress to export/import translations and originals.
This allows you to export a translation set to a CSV file, and use this to import the translations or originals into the project.
This plugin is properly prepared for localization.
The CSV output has values separated by ,
and enclosured by " "
.
The total number of columns depends on the number of Plural Forms of the exported Locale.
For an sample file, please check out example.csv.
The header columns for the different translations have the Translation (<plural-form>)
naming convention, being the Plural Forms depending on each exported Locale.
See the example below for a Portuguese CSV export, which has 2
plural forms.
"Context","Singular","Plural","Comments","References","Translation (Singular)","Translation (Plural)"
"","Singular in English.","","Comment 1.\nComment 2.","","Singular em Português.",""
Context | Singular | Plural | Comments | References | Translation (Singular) | Translation (Plural) |
---|---|---|---|---|---|---|
Singular in English. | Comment 1.\nComment 2. | Singular em Português. |
The 5 main columns are Context
, Singular
, Plural
, Comments
and References
.
Context | Singular | Plural | Comments | References | Translation(s)... |
---|---|---|---|---|---|
value | value | value | value | value | |
value | value | value | value | value |
The number of Plural Forms columns may vary depending on each Locale setting.
Check the below table for examples of GlotPress Locales from 1 to 6 Plural Forms.
Locale (nplurals) | ...References | Translation (Singular) | Translation (Plural 1) | Translation (Plural 2) | Translation (Plural 3) | Translation (Plural 4) | Translation (Plural 5) |
---|---|---|---|---|---|---|---|
Japanese (1) | Translation (Single) | ||||||
Portuguese (2) | Translation (Singular) | Translation (Plural) | |||||
Serbian (3) | Translation (1, 21, 31) | Translation (2, 3, 4) | Translation (0, 5, 6) | ||||
Slovenian (4) | Translation (1, 101, 201) | Translation (2, 102, 202) | Translation (3, 4, 103) | Translation (0, 5, 6) | |||
Irish (5) | Translation (1) | Translation (2) | Translation (3, 4, 5) | Translation (7, 8, 9) | Translation (0, 11, 12) | ||
Arabic (6) | Translation (0) | Translation (1) | Translation (2) | Translation (3, 4, 5) | Translation (11, 12, 13) | Translation (100, 101, 102) |
The gp_format_csv_header
allows you to add, remove or customize items from the CSV header.
The gp_format_csv_row
allows you to add, remove or customize items from the CSV row.
- Go to the bottom of the translation table.
- Select
CSV (.csv)
. - Click on the
Export
link to download the CSV file.
- Go to the bottom of the translation table.
- Click on the
Import Translations
link. - Select the CSV file to upload, the
Format
is Auto Detected. - Click on the
Import
button.
- Go to the project page.
- On the project actions click on the
Import Originals
link. - Select the CSV file to upload, the
Format
is Auto Detected. - Click on the
Import
button.
Yes you can! If you want to translate this plugin to your language, please click here.
Sure! You are welcome to report any issues or add feature suggestions on the GitHub repository.
- Require WP 5.1.
- Tested with WordPress 6.6.
- Tested with GlotPress 4.0.1.
- Tested with PHP 8.3.
- Removed Git Updater forbiden plugin header.
- Fix docblock type param.
- Update dependencies.
- Tested with WordPress 6.5.
- Tested with GlotPress 4.0.
- Tested with PHP 8.3.
- Add WP Plugin Check CI test.
- Update dependencies.
- Fix log error message typo. Props @fxbenard.
- Initial release.
- All WPCS and PHPStan level 9 verified.