Skip to content

Commit

Permalink
Remove duplicate documentation, just link to Handbook
Browse files Browse the repository at this point in the history
  • Loading branch information
mkaz committed Mar 6, 2019
1 parent d92be52 commit 4daab75
Showing 1 changed file with 1 addition and 22 deletions.
23 changes: 1 addition & 22 deletions packages/i18n/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

Internationalization utilities for client-side localization. See [How to Internationalize Your Plugin](https://developer.wordpress.org/plugins/internationalization/how-to-internationalize-your-plugin/) for server-side documentation.

For a complete example, see the [Internationalization section of the Gutenberg Handbook](https://wordpress.org/gutenberg/handbook/designers-developers/developers/internationalization.md).

## Installation

Expand All @@ -23,27 +22,7 @@ sprintf( _n( '%d hat', '%d hats', 4, 'text-domain' ), 4 );
// 4 hats
```


## Build and Usage

You can use [WP-CLI](https://wp-cli.org/) to generate a `.pot` file containing all your translatable strings.

```sh
wp i18n make-pot ./src myplugin.pot
```

Use the [po2json](https://github.com/mikeedwards/po2json) npm module to convert a po file to the proper Jed json format.

```sh
po2json myplugin-eo.po myplugin-eo.json -f jed
```

Use the [wp_set_script_translations](https://developer.wordpress.org/reference/functions/wp_set_script_translations/) function to load the json translation file.

```php
wp_set_script_translations( 'myplugin-script', 'myplugin', plugin_dir_path( __FILE__ ) . 'languages' );
```

For a complete example, see the [Internationalization section of the Gutenberg Handbook](https://wordpress.org/gutenberg/handbook/designers-developers/developers/internationalization/).

## API

Expand Down

0 comments on commit 4daab75

Please sign in to comment.