Skip to content

Commit

Permalink
Notify listeners also on has_translation filter add/remove
Browse files Browse the repository at this point in the history
  • Loading branch information
jsnajdr committed Feb 5, 2021
1 parent 2bd465d commit a245ae0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/i18n/src/create-i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ const DEFAULT_LOCALE_DATA = {

/*
* Regular expression that matches i18n hooks like `i18n.gettext`, `i18n.ngettext`,
* `i18n.gettext_domain` or `i18n.ngettext_with_context`
* `i18n.gettext_domain` or `i18n.ngettext_with_context` or `i18n.has_translation`.
*/
const I18N_HOOK_REGEXP = /^i18n\.(n?)gettext(_|$)/;
const I18N_HOOK_REGEXP = /^i18n\.(n?gettext|has_translation)(_|$)/;

/**
* @typedef {(domain?: string) => LocaleData} GetLocaleData
Expand Down

0 comments on commit a245ae0

Please sign in to comment.