#57056 closed enhancement (fixed)
Pass $locale to override_load_textdomain filter
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 6.2 | Priority: | normal |
Severity: | normal | Version: | 6.1 |
Component: | I18N | Keywords: | good-first-bug has-patch commit |
Focuses: | Cc: |
Description
In [53874] the $locale
parameter was added to load_textdomain()
so it can be used to properly fill WP_Textdomain_Registry
.
Since the $locale
may not be the same value as determine_locale()
returns (e.g. when filtered by plugin_locale
in load_plugin_textdomain()
) we should also pass the new parameter to the filter so custom file loading implementations are using the same locale as load_textdomain()
got.
Change History (13)
This ticket was mentioned in PR #3600 on WordPress/wordpress-develop by @cadic.
13 months ago
#1
- Keywords has-patch added; needs-patch removed
#3
@
13 months ago
- Milestone changed from Future Release to 6.2
Adding to 6.2 milestone as initial PR updated from some code review feedback, needs final testing before readying for commit.
This ticket was mentioned in Slack in #core by costdev. View the logs.
10 months ago
@SergeyBiryukov commented on PR #3600:
10 months ago
#6
Would it make sense to move the locale detection earlier in the function, so that it's always passed as a string to the filter, instead of string|null
?
if ( ! $locale ) { $locale = determine_locale(); }
@swissspidy commented on PR #3600:
10 months ago
#7
IIRC that get_locale() call is deliberately as late as possible to avoid too many calls for performsnce reasons.
#8
@
10 months ago
- Keywords changes-requested removed
This ticket was discussed during the recent bug scrub. As all feedback on the PR has been addressed, I'm removing the changes-requested
keyword.
This ticket was mentioned in Slack in #core by costdev. View the logs.
10 months ago
#10
@
10 months ago
- Keywords commit added
This ticket was discussed during the bug scrub. As the patch only adds a new parameter to a filter, this should not need testing. Adding for commit
consideration.
#12
@
10 months ago
- Owner set to audrasjb
- Resolution set to fixed
- Status changed from new to closed
In 55196:
@audrasjb commented on PR #3600:
10 months ago
#13
committed in https://core.trac.wordpress.org/changeset/55196
In [53874] the
$locale
parameter was added toload_textdomain()
so it can be used to properly fillWP_Textdomain_Registry
.Since the
$locale
may not be the same value asdetermine_locale()
returns (e.g. when filtered byplugin_locale
inload_plugin_textdomain()
) we should also pass the new parameter to the filter so custom file loading implementations are using the same locale asload_textdomain()
got.Trac ticket: https://core.trac.wordpress.org/ticket/57056