[wp-trac] [WordPress Trac] #52696: Add a way to determine whether a translation exists
WordPress Trac
noreply at wordpress.org
Tue May 28 08:22:47 UTC 2024
#52696: Add a way to determine whether a translation exists
-------------------------------------------------+-------------------------
Reporter: drzraf | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Future
| Release
Component: I18N | Version:
Severity: minor | Resolution:
Keywords: good-first-bug has-patch needs- | Focuses:
testing needs-unit-tests |
-------------------------------------------------+-------------------------
Comment (by mchirag2002):
@swissspidy
The translate function present in the `WP_Translation_Controller` is
already utilizing this `locate_translation()` protected function but in
the l10n.php file we are still using the NOOP Translate instance based
translate function.
Wouldn't it be more efficient if we switch to using the
WP_Translation_Controller's translate function like we are utilising the
`set_locale()` function?
That way we would not be required to make a separate call to the
`has_translation()` first and then call the translating functions.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/52696#comment:19>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list