How to load qtranslate in custom .php file?

4.4k views Asked by At

I have a cart.php file in my public_html directory, this file are included in my wordpress theme.

I need to make work qtranslate php tags <?php _e("<!--:no-->Norwegian<!--:--><!--:de-->German<!--:-->"); ?> in my cart.php file

Here is my cart.php code: http://pastebin.com/N5h8tu8d

1

There are 1 answers

0
Obmerk Kronen On

Try :

  <?php _e('[:no]Norwegian
    [:de]German'); ?>

But I am really not sure what you are trying to accomplish.. There might be abetter way of doing it .. Are you trying to show the switch language links or just showing some string indifferent languages ?

Qtranslate is one of the greatest wordpress plugins , andit has all what you need ( if andwhenyouelaborate on the problem ) but If all fails , it has a simple function to detect current language , so you can use :

$lang=qtrans_getLanguage();

        if ($lang=="de") {
        // SOMETHING in German
        }
        else if ($lang=="en"){
        // SOMETHING in Norwegian
            }