i18n: Add domain argument to localization functions #5167
Labels
Good First Issue
An issue that's suitable for someone looking to contribute for the first time
Internationalization (i18n)
Issues or PRs related to internationalization efforts
[Type] Task
Issues or PRs that have been broken down into an individual action to take
Gutenberg was localized without explicit domain in its JavaScript gettext implementation with the following assumptions in mind:
Since these assumptions do not hold true for plugin code, and we should seek to open up localization tools more broadly, we should introduce a domain parameter to the localization functions.
As part of this, we may consider being explicit in specifying
gutenberg
domain for strings within Gutenberg, since we do this in PHP code and Gutenberg is still technically a plugin. That said, the plugin manifest does not specify the text domain.This should not be a very difficult task, as it's merely a matter of adding the argument and using the domain-prefixed Jed functions. For example:
Before:
(Reference)
After:
(Repeat for
_x
,_n
,_nx
)The text was updated successfully, but these errors were encountered: