• Hello,

    I have a web site that runs qTranslate and it works wonders. I have an issue with one area in particular where I haven’t been able to get working.

    I have some hard-coded HTML in one of the templates and naturally I need to have that available in both languages.

    I can’t for the life of me figure out how to basically do this.

    If Lang=fr show this:
    Allo
    else show this:
    Hello

    I will be putting ?lang=fr in my URL string when the language gets switched to French.

    THANK YOU for any help!

    Randy
    Montreal, Canada

Viewing 4 replies - 1 through 4 (of 4 total)
  • Alwyn Botha

    (@123milliseconds)

    From https://www.php.net/manual/en/reserved.variables.get.php

    <?php
    echo ‘Hello ‘ . htmlspecialchars($_GET[“name”]) . ‘!’;
    ?>

    Assuming the user entered https://example.com/?name=Hannes

    The above example will output something similar to:

    Thread Starter randyohhh

    (@randyohhh)

    Sorry I don’t think I explained myself properly.

    In the sidebar I have a block of text. My site is bilingual and I use qTranslate to post ?lang=en in the URL string.

    I need a way to show a certain block depending on the language.

    So if the query is lang=en it would show the english text.

    If the query is land=fr it would show the french.

    I’m not asking for data from the URL string, only to determine the language.

    Thanks,

    Randy

    Alwyn Botha

    (@123milliseconds)

    >>>I’m not asking for data from the URL string, only to determine the language.

    You need to get the data from the url; to determine the language; if you do not get the data from url where will you get it?

    sorry I do not understand either; so maybe someone else can help

    If $_GET[“lang”]=’fr’ show this:
    Allo
    else show this:
    Hello

    Try this:

    __e("[:en]Hello[:fr]Allo");

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘If Lang=en’ is closed to new replies.