Tomas Kleinotas
Tomas Kleinotas

Reputation: 25

How to load qtranslate in custom .php file?

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

Upvotes: 0

Views: 4406

Answers (1)

Obmerk Kronen
Obmerk Kronen

Reputation: 15949

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
            } 

Upvotes: 1

Related Questions