- Code: Select all
__(string $str)
returns nothing, echos translated string, which will be first parsed by qTranslate and then by Gettext
- Code: Select all
_e(string $str)
returns currently selected language.
- Code: Select all
qtrans_getLanguage()
returns formatted time using strftime syntax format. Use %q for date suffix (th, st, nd, rd)
- Code: Select all
qtrans_strftime(string $format, int $date)
returns an converted URL for the selected language or the current language, if $lang is omitted.
- Code: Select all
qtrans_convertURL(string $url, string $lang)
returns nothing, generates HTML lanuage selection code for the current page. $style can be either image, text, both or dropdown.
- Code: Select all
qtrans_generateLanguageSelectCode(string $style, string $id)
if you want to show content only for a specific language, use something like this
- Code: Select all
<?php _e("[:en]English only"); ?>
if you even want to use HTML code and PHP Code, you can use something like this
- Code: Select all
<?php if(qtrans_getLanguage()=='en'): ?>
<img src="<?php echo $imgsrc; ?>" alt="English Image" />
<?php endif; ?>
