HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

[Solved] How to give out the Current Language

deexdeex New
edited July 2013 in Localization

As the Title said, i really would like to know if there is a var which can give out the language code like "en_EN" based on the current settings.

Best Answers

Answers

  • The variable of the vanilla forum not the server.Thank you i will try this out and give you a feedback ;)

  • deexdeex New
    edited July 2013

    Hmm wont work correctly. He only give out the German Language, but always. If i'm on english he says its german.
    As example. html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de-DE". Is it possible that he is giving out my browser language instead of the language settings?

  • peregrineperegrine MVP
    edited July 2013

    $mylocale = Gdn::Config("Garden.Locale");

    echo $mylocale;

    It's giving you exactly what the locale is set to in your config and works.
    If I set my locale to german de-DE , it shows de-DE

    if I set it to english en-CA it shows en-CA

    Perhaps you are using some kind of plugin that you decline to mention.

    Best I can help you with based on the information you provided.

    if you are using some kind of multi language plugin, you would best be served by posting your question under the plugin rather than the general questions.

    otherwise, what I told you is what I told you.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Great and Awesome Peregrine,

    that did it :) now it works on all languages correctly.

    Thank you very much

  • Great, don't be scared to click insightful on the reactions :).

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

Sign In or Register to comment.