Expression Grid Gallery and the qTranslate plugin

Please Note: Theme customizations and third party plugin support go beyond the scope of our support services and this article is provided solely as a courtesy to our customers. Please take a moment to review the Scope of our Support.

The qTranslate plugin requires a few modifications in the theme code when the content is loaded dynamically with AJAX, so that the correct translated version is retrieved.

The gallery in Photolux loads the content with AJAX and it will require the following modifications to be applied in order to make the plugin load the selected translation:

In the includes/gallery-load.php file:
1. Modify line 44:

ajaxUrl:"<?php echo admin_url( 'admin-ajax.php' ); ?>",

to be like this:

ajaxUrl:"<?php echo admin_url('admin-ajax.php?lang='.qtrans_getLanguage()); ?>",

2. Modify line 26:

$cat_arr[]=array("id"=>$cat->term_id, "name"=>$cat->name);

to be like this:

$cat_arr[]=array("id"=>$cat->term_id, "name"=>__($cat->name));

In lib/functions/ajax.php file:
1. Modify line 49:

$new_post['title'] = $post->post_title;

to be like this:

$new_post['title'] = __($post->post_title);

2. Modify line 89:

$term_names[]=$term->name;

to be like this:

$term_names[]=__($term->name);

3. Modify line 159:

$res_arr['title']=$post->post_title;

to be like this:

$res_arr['title']=__($post->post_title);

Regarding translating categories – you can use the qTranslate quick tags – for example, if you have an English category and a French translation, you can insert the following text in the category title:

<!--:en-->English category<!--:--><!--:fr-->French Category<!--:-->

OR:

[:en]English category [:de]French category

Was this useful? 1