qTranslate X

qTranslate label translation:

_e("English")

qTranslate current language code:

 if ( function_exists('qtranxf_generateLanguageSelectCode')) echo qtranxf_generateLanguageSelectCode('both'); // text, image, both 

Frequently Asked Questions

The following fields are pre-configured to be translatable by default:

  • all input fields of class “wp-editor-area“, which normally include all TinyMCE visual editors.
  • fields with the following id: “title”, “excerpt”, “attachment_caption”, “attachment_alt”.

qtranxf_useCurrentLanguageIfNotFoundUseDefaultLanguage($post->post_title)

theme-options.php
Backoffice -> Settings -> Languages -> Integration -> Custom Configuration

{ "admin-config":{ "theme-option":{ "pages":{"themes.php":"page=theme_options"}, "forms":{ "theme-options-form":{ "fields":{ "wp-editor-area":{"jquery":".wp-editor-area"} } } } } } }

.po + .mo = poedit

function kenobisoft_load_theme_textdomain() {
	load_theme_textdomain( 'default', get_stylesheet_directory() . '/languages/' );
}
add_action( 'after_setup_theme', 'kenobisoft_load_theme_textdomain' );

Loco Translate plugin

Replace “English” with EN

function my_qtranxf_generateLanguageSelectCode($style='', $id='') {
	ob_start();
	qtranxf_generateLanguageSelectCode($style, $id);
	$o = ob_get_contents();
	ob_end_clean();
	return str_replace(array('English', 'Français', 'Nederlands'),array('EN', 'FR', 'NL'), $o);
}