[wp-trac] [WordPress Trac] #29783: User Admin Language

WordPress Trac noreply at wordpress.org
Sun Jun 14 20:45:48 UTC 2015


#29783: User Admin Language
-----------------------------------+-----------------------------
 Reporter:  faevilangel            |       Owner:  ocean90
     Type:  feature request        |      Status:  assigned
 Priority:  normal                 |   Milestone:  4.3
Component:  I18N                   |     Version:  4.0
 Severity:  normal                 |  Resolution:
 Keywords:  has-patch 2nd-opinion  |     Focuses:  administration
-----------------------------------+-----------------------------

Comment (by ocean90):

 We - @toscho, @ipm-frommen, @bueltge, @obenland, @giede, @dreamfish, and
 me - had a discussion about this at the contributor day of WordCamp
 Cologne. The following is a short summary:

 * Introduce `get_user_locale()` which retrieves the locale from a meta key
 `locale`. Fall back to `get_locale()`.
 * Check bbPress/BuddyPress for compatibility issues because the user will
 be loaded early. (Known issue, @toscho is looking into it, provide patches
 if necessary.)
 * switch_to_(language|locale)():
   * We should avoid loading multiple languages into memory, only one at
 the same time.
   * Check if file exists '''before''' switching a language
   * Core isn't an issue, support was added in [29630]
   * load_(theme|plugin)_textdomain should maintain a history/stack about
 the loaded textdomains and language files. For v1 we want to provide a
 do_action when doing a language switch. We want to write a best practice
 guide to gather feedback.
   * @obenland mentioned, that wp.com is doing language switches already
 and will look into it.
 * For v1 we want to focus on admin screens and API calls, like plugin
 details.
    * Because of the architecture of admin-ajax.php this will include AJAX
 calls too.
    * Mails should be send in global site language.
 * Toolbar, plugins and themes is something for v2.
 * Date/time formats, timezone settings, etc should all be user settings.
 #18146 for timezone setting.

 [attachment:29783.2.patch] is a first pass for  `get_user_locale()`.
 Instead of using 'default' for the fallback I'm now using an empty string
 which is currently the default value, if a user hasn't selected a locale.
 If a user selects 'en_US' it stores 'en_US' into `$user->locale`. This is
 different from `$locale` where an empty string is 'en_US'.

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


More information about the wp-trac mailing list