Skip to content

Commit

Permalink
Fix faulty Jed state after setLocaleData (#10233)
Browse files Browse the repository at this point in the history
* Fix faulty Jed state after setLocaleData

When calling `setLocaleData` with a custom textdomain in a non-Gutenberg environment the default textdomain ends up in a state that is not ok with Jed resulting in the error: "Error: No locale meta information provided." In Gutenberg this is not a problem because `setLocaleData` is always called first with the default textdomain.

* i18n: Add CHANGELOG entry for initialization fix
  • Loading branch information
atimmer authored and gziolo committed Oct 4, 2018
1 parent 638605c commit dcd5cd1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions packages/i18n/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
## 3.0.0 (2018-09-30)

### Braking Change
### Breaking Changes

- `wp.i18n.getI18n` has been removed. Use `__`, `_x`, `_n`, or `_nx` instead.
- `wp.i18n.dcnpgettext` has been removed. Use `__`, `_x`, `_n`, or `_nx` instead.
- `getI18n` has been removed. Use `__`, `_x`, `_n`, or `_nx` instead.
- `dcnpgettext` has been removed. Use `__`, `_x`, `_n`, or `_nx` instead.

### Bug Fixes

- The initialization of the internal Jed instance now correctly assigns its default data.

## 2.0.0 (2018-09-05)

Expand Down
2 changes: 1 addition & 1 deletion packages/i18n/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export function setLocaleData( localeData = { '': {} }, domain = 'default' ) {
i18n = new Jed( {
domain: 'default',
locale_data: {
default: {},
default: { '': {} },
},
} );
}
Expand Down

0 comments on commit dcd5cd1

Please sign in to comment.