[wp-trac] [WordPress Trac] #38788: Make get_available_languages() filtrable

WordPress Trac noreply at wordpress.org
Mon Nov 14 20:10:50 UTC 2016


#38788: Make get_available_languages() filtrable
-------------------------+------------------------------
 Reporter:  yoavf        |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  I18N         |     Version:  trunk
 Severity:  normal       |  Resolution:
 Keywords:  has-patch    |     Focuses:
-------------------------+------------------------------
Description changed by yoavf:

Old description:

> When a user object is saved (i.e, after editing the user settings) WP
> will discard (and replace with `en_US`) any value for the new user
> `locale` meta if it is not part of the array returned by
> `get_available_languages()`
>
> `get_available_languages()` works by scanning the language folder for
> `.mo` files. In some use cases, language files might not exist for a
> locale, named in a different way, or maybe stored elsewhere.
> `get_available_languages()` results should be filtrable.
>
> FWIW: we need this filter (or an alternate solution) to merge the new
> user locale setting and locale switching to WP.com.

New description:

 When a user object is saved using `edit_user()~ (i.e, after editing the
 user settings) WP will discard (and replace with `en_US`) any submitted
 value for the new user `locale` meta if it is not part of the array
 returned by `get_available_languages()`

 `get_available_languages()` works by scanning the language folder for
 `.mo` files. In some use cases, language files might not exist for a
 locale, named in a different way, or maybe stored elsewhere.
 `get_available_languages()` results should be filtrable.

 FWIW: we need this filter (or an alternate solution) to merge the new user
 locale setting and locale switching to WP.com.

--

--
Ticket URL: <https://core.trac.wordpress.org/ticket/38788#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list