[wp-trac] [WordPress Trac] #42721: Introduce native language name as a WP_Locale property

WordPress Trac noreply at wordpress.org
Tue Nov 28 03:11:51 UTC 2017


#42721: Introduce native language name as a WP_Locale property
----------------------------+-----------------
 Reporter:  SergeyBiryukov  |      Owner:
     Type:  enhancement     |     Status:  new
 Priority:  normal          |  Milestone:  5.0
Component:  I18N            |    Version:  4.9
 Severity:  normal          |   Keywords:
  Focuses:                  |
----------------------------+-----------------
 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 [source:tags/4.9/src/wp-includes/script-
 loader.php?marks=391-445#L391 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.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/42721>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list