Opened 7 years ago
Last modified 6 years ago
#42721 new enhancement
Introduce native language name as a WP_Locale property
Reported by: | SergeyBiryukov | Owned by: | |
---|---|---|---|
Milestone: | Future Release | Priority: | normal |
Severity: | normal | Version: | 4.9 |
Component: | I18N | Keywords: | |
Focuses: | Cc: |
Description
At the moment, displaying the current locale's native name is only possible by reusing wp_get_available_translations()
, which performs an external request to the translations API and stores the result in a transient.
It would be easier if the native name was available as a WP_Locale
instance property.
Use case: [41198] introduced 50+ strings with language names for MediaElement.js. Looking at the code, they are used as subtitle track labels, unless the track has its own label.
This is only a subset of all locales supported by WordPress. If the goal is to make sure the current locale's name can be used as a subtitle track label, it doesn't make much sense to translate the whole list to 100+ languages.