Make WordPress Core

Opened 3 months ago

Closed 3 months ago

Last modified 3 months ago

#61108 closed enhancement (fixed)

Pass `$locale` to the `load_translation_file` filter

Reported by: johnbillion's profile johnbillion Owned by: johnbillion's profile johnbillion
Milestone: 6.6 Priority: normal
Severity: normal Version: 6.5
Component: I18N Keywords: has-patch commit needs-dev-note
Focuses: Cc:

Description

The load_translation_file filter was introduced in 6.5. It would be useful to pass it the $locale variable as a parameter, otherwise anything using the filter needs to recalculate the locale again by calling determine_locale().

Change History (5)

This ticket was mentioned in PR #6467 on WordPress/wordpress-develop by @johnbillion.


3 months ago
#1

  • Keywords has-patch added; needs-patch removed

#2 @swissspidy
3 months ago

  • Keywords commit added

#3 @swissspidy
3 months ago

  • Keywords needs-dev-note added

Can be added to the general i18n dev-note for 6.6

#4 @johnbillion
3 months ago

  • Owner set to johnbillion
  • Resolution set to fixed
  • Status changed from new to closed

In 58095:

I18N: Pass the $locale variable to the load_translation_file filter.

This avoids the need for the locale to be recalculated by code that hooks into this filter.

Props swissspidy, mukesh27, johnbillion

Fixes #61108

Note: See TracTickets for help on using tickets.