Making WordPress.org

Changeset 5518


Ignore:
Timestamp:
05/25/2017 07:36:19 PM (9 years ago)
Author:
coreymckrill
Message:

WordCamp: Load wordcamporg text domain based on user locale

Fixes an issue with WordCamp plugins' UIs still displaying in the site's
locale instead of the user's.

get_user_locale() was just introduced in WP 4.7, so it wasn't
available when this text domain strategy was implemented.

get_user_locale() falls back on get_locale() when necessary, so
it shouldn't cause a problem when a user doesn't have a specific locale
set.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/wcorg-misc.php

    r4750 r5518  
    227227 * GlotPress project, and we only have to install/update a single mofile per locale.
    228228 */
    229 load_textdomain( 'wordcamporg', sprintf( '%s/languages/wordcamporg/wordcamporg-%s.mo', WP_CONTENT_DIR, get_locale() ) );
     229load_textdomain( 'wordcamporg', sprintf( '%s/languages/wordcamporg/wordcamporg-%s.mo', WP_CONTENT_DIR, get_user_locale() ) );
    230230
    231231// WordCamp.org QBO Integration
Note: See TracChangeset for help on using the changeset viewer.