WordPress.org

Forums

Multisite Language Switcher
[resolved] Cannot target the en_US version (5 posts)

  1. keepclif
    Member
    Posted 2 years ago #

    Hello everyone,

    I have a 3 languages website (french, spanish and english).
    When I want to translate 'static' elements of my theme I use:
    $blog = MslsBlogCollection::instance()->get_current_blog();
    $language = $blog->get_language();

    and then :
    if ($language=='fr_FR') {...}
    if ($language=='es_ES') {...}
    if ($language=='en_US') {...} (I tried 'en_EN' too)

    When I am targeting the 'en_US' version, it is not working. To see the translations, I have to use "else" instead of "if ($language=='en_US')", but then my french version is not working very good...

    I tried to force the WPLANG into the settings of my english website, but it is not considered. After saving the settings, the field stays empty...

    Does anyone had the same problem ? Could you help me ?

    Thanks a lot,

    Caroline

    http://wordpress.org/extend/plugins/multisite-language-switcher/

  2. Dennis Ploetner
    Member
    Plugin Author

    Posted 2 years ago #

    The switcher returns 'us'. This is a fallback because WordPress returns an empty string in this scenario.

  3. keepclif
    Member
    Posted 2 years ago #

    Thank you realloc, so what can I do ?

  4. Dennis Ploetner
    Member
    Plugin Author

    Posted 2 years ago #

    Does this the job?

    if ($language=='us') {...}

  5. keepclif
    Member
    Posted 2 years ago #

    yes !! thanks a lot :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Multisite Language Switcher
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.