Skip to content

Commit

Permalink
Update instructions of translation process (#381)
Browse files Browse the repository at this point in the history
* Update instructions of translation process

* Apply format convention to steps in Extract and Import doc
  • Loading branch information
fluiddot authored Jul 25, 2024
1 parent bc68f5e commit 70d6eb8
Showing 1 changed file with 18 additions and 10 deletions.
28 changes: 18 additions & 10 deletions docs/localization.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,30 @@ If you want to add support for another language you will need to add it to the

## Translation Process

1. **Extract Strings**
Run `npm run make-pot` to get the text out of the source
files. This will create a `*.pot` file for each module, as well as a bundle
### Extract and Import

#### Step 1: Extract Strings:

1. Run `npm run make-pot` to get the text out of the source
files.

This will create a `*.pot` file for each module, as well as a bundle
of all translatable strings in `out/pots/bundle-strings.pot`.

2. **GlotPress Import**
#### Step 2: Import to GlotPress:

1. Open [our project in GlotPress](https://translate.wordpress.com/projects/studio/).
2. Click the **Project actions** menu.
3. Click **Import Originals**.
4. Import `out/pots/bundle-strings.pot` (auto-detecting the file format is fine).

3. **Export Translations**
We will export the translations as Jed-formatted JSON, which is a format
`@wordpress/i18n` can understand. It's ok if some translations are missing,
they will be left as English in the app.
### Export and Add

#### Step 1: Export from GlotPress:

We will export the translations as Jed-formatted JSON, which is a format
`@wordpress/i18n` can understand. It's ok if some translations are missing,
they will be left as English in the app.

1. Open [our project in GlotPress](https://translate.wordpress.com/projects/studio/).
2. Click the **Project actions** menu.
Expand All @@ -38,6 +46,6 @@ If you want to add support for another language you will need to add it to the
6. Change the format to `Jed 1.x (.json)`.
7. Leave the other fields as default and click **Export**.

4. **Add to Project**
Unzip the exported strings and add them to the `src/translations`. Overwrite
#### Step 2: Add Translations to Project:
1. Unzip the exported strings and add them to the `src/translations`. Overwrite
the files in there with your new files.

0 comments on commit 70d6eb8

Please sign in to comment.