Viewing 6 replies - 1 through 6 (of 6 total)
  • <?php
    if( qtrans_getLanguage() == ‘en’ ){ ?>
    Choose Language
    <?php }else { ?>
    Danke
    <?php } ?>

    This may help! Put this inside your template if you want the option of two outputs!

    Thread Starter devilcerkez

    (@devilcerkez)

    Dear Chris,

    How to use your code? I tried with Widget Title. I saw “Choose Language Danke” when I refreshed.
    Or I must add any .php file?

    Thank you

    You can do this in your php file as a work around so ie…

    <h1><?php
    if( qtrans_getLanguage() == ‘en’ ){ ?>
    Thank you
    <?php }else { ?>
    Danke
    <?php } ?>
    </h1>

    Place this were you have your title.

    Or if via the widget do this in the title box

    [:en]Thank you[:GER]Danke

    Thread Starter devilcerkez

    (@devilcerkez)

    I tried but it could not work ??

    You can see left side

    https://www.prosammuhendislik.com.tr

    <?php if(qtrans_getLanguage() == “en”)
    echo (‘Thank You’);
    else if(qtrans_getLanguage() == “GER”)
    echo (‘Danke’);
    ?>

    Also make sure your language code matches that of the qtranslate plugin, this will be in

    Settings > Lanuages > Languages Table > Select your language here ie Francais > Edit > Lanugage code . So if you have to translate french your code would be

    <?php if(qtrans_getLanguage() == “en”)
    echo (‘Thank You’);
    else if(qtrans_getLanguage() == “fr”)
    echo (‘merci’);
    ?>

    Make sure within the plugin you have English and French enabled under General settings!

    Thread Starter devilcerkez

    (@devilcerkez)

    Dear Chis,

    I could not find where I must change. ??

    Edit Language
    Language Code

    2-Letter ISO Language Code for the Language you want to insert. (Example: en)
    Flag Incorrect Flag Image Path! Please correct it!

    Choose the corresponding country flag for language. (Example: gb.png)

    Name

    The Name of the language, which will be displayed on the site. (Example: English)
    Locale

    PHP and WordPress Locale for the language. (Example: en_US)

    You will need to install the .mo file for this language.
    Date Format

    Depending on your Date / Time Conversion Mode, you can either enter a strftime (use %q for day suffix (st,nd,rd,th)) or date format. This field is optional. (Example: %A %B %e%q, %Y)
    Time Format

    Depending on your Date / Time Conversion Mode, you can either enter a strftime or date format. This field is optional. (Example: %I:%M %p)
    Not Available Message

    Message to display if post is not available in the requested language. (Example: Sorry, this entry is only available in %LANG:, : and %.)
    %LANG:<normal_seperator>:<last_seperator>% generates a list of languages seperated by <normal_seperator> except for the last one, where <last_seperator> will be used instead.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘How to use this plugin at Widget Title?’ is closed to new replies.