WordPress: Guide of configuration and use qTranslate

WordPress: Guide qTranslate

qTranslate is plugin translator of languages for WordPress, as main advantage before other similar tools we can say that it is Open Source, and forming it correctly it can be a very useful tool at the time of translating a Web. As disadvantage however we observed that qTranslate does not generate new name of URls by each language, if not that mounts the same URL in different directories or a subdomain (it depends on the configuration that you have created), example:


Others plugins as WPML

advantages of plugin qTranslate

  • He is gratuitous
  • Great amount of languages in its collection to add to your wordpress.
  • While you generate content in your wordpress, as pages or posts, they will appear to you the corresponding eyelashes for each language, which is helpful.
  • It gives the possibility of selecting the language us that we wished that it appears for the administration panel.
  • Possibility of choosing between the following structures of URLs for the translations:
    • http://laweb.com/?lang=en
    • http://laweb.com/en
    • http://en.laweb.com

To install qTranslate

* First of all, as recommendation when updating Core of WordPress, assures to you that qtranslate works in this version, since usually it gives problemas.*
Once we have installed and activated plugin, in the lateral panel we accede to Adjustments/Languages:

adjustments qtranslate

We are going to form qTranslate:

The language by defect:
language by decto qtranslate

Languages available or that we want to add:
to add languages qtranslate

To the right we can see the languages installed by defect. In order to activate or to deactivate between anyone of them we must you beat on €œQualifying€ or €œDeshabilitar€.

To install a language that does not come including in qtranslate by defect
In order to install a language that is not in favor of defect, first we must realise a copy of the file .mo of the language in the directory:

wp-content > languages

Perhaps fastest it can be to make a clean installation of wordpress in the corresponding language, and from extracting the file there .mo later to copy it in new wordpress under which we are working.

If you want to find the file directly .mo of your language without needing realising this step you can find information for it here: http://codex.wordpress.org/WordPress_in_Your_Language

Once here, we went to Adjustments - > Languages. And the left we can observe that they appear the flags, is here where qtranslate gives the option us to add a new language.
What we see is the following thing:

The code of the language is code ISO. In the case of the Castilian, it is IS. If you do not know it qtranslate on the matter facilitates a link with information in this same section of the Control Panel. Here we will be able to choose the predefined language for the panel and the rest of site Web.

The local code talks about to the specification of the language. .mo must agree with the name of the file. For example, in the case of Castilian the file he is €œes.mo€. So that the changes have effect the file .mo must be located in wp-content>languages.

Once fact this, already we have running qTranslate.
To observe that we have widget available to select:

widget qtranslate

To translate the contents with qTranslate
Three methods exist to add the translations in qTranslate, each corresponds to a specific use of the same.
Within the text editor of wordpress, already they appear the eyelashes that allow you to insert the text in their respective language:
entrance with qtranslate

In order to translate articles, pages, categories and labels we will use this method:

<! --: in--><! --: -->

This it is the source code that uses plugin qTranslate when it translates an article, category, or a label. We emphasize as important that it we cannot directly use in archives php. Of the three methods, this it is less used, since it comes automated within the administration panel.

[: in]

This fragment of code is used to insert within widgets and in the title of the blog, this is in: General adjustments > > Title. In this way, in widget we will put, for example:

[: in] Castilian text in [: in] english text

And also we can use:

<? php _e (€œ<! --: in-->english text<! --: --><! --: of--they >german text<! --: -->€); >

This line of code we can insert it within the archives .php that we want to translate.

To change the image of the logo according to the language that we have selected: (
Supposing that the images are in the directory of the subject within the directory €œimages€.)

 <? php if (qtrans_getLanguage () == €œis€) \ {I throw €œ<img src= \ "". get_bloginfo (€˜stylesheet_directory€™). €œ/images/nombre_de_la_imagen_es.jpg€/>€; }? > <? php if (qtrans_getLanguage () == €œin€) \ {I throw €œ<img src= \ "". get_bloginfo (€˜stylesheet_directory€™). €œ/images/nombre_de_la_imagen_en.jpg€/>€; }? >

To activate file Javascript according to the selected language
If we must validate a form with Javascript, it is possible that we need two archives Javascript. In order to use one of them according to the language we will need this code:

 <? php if (qtrans_getLanguage () == €œin€) \ {I throw €œ<script src= \ "". get_bloginfo (€˜stylesheet_directory€™). €œ/js/jquery.validate_en.js \€ type= \ €œtext/Javascript \ €œ></script>€; }? > <? php if (qtrans_getLanguage () == €œof€) \ {I throw €œ<script src= \ "". get_bloginfo (€˜stylesheet_directory€™). €œ/js/jquery.validate_de.js \€ type= \ €œtext/Javascript \ €œ></script>€; }? >

Desinstalar qTranslate

One of the main problems of qTranslate happens when you decide desinstalarlo, since your wordpress can be hairdo enough, with enough full residual code of tags of translations and possible titles duplicated in several languages. In this step many users of hairs, but calm because a solution for this €œsmall€ disadvantage exists, and usually are able themselves to eliminate qTranslate of simple form.

1) First I recommend to do backup.
2) We install plugin qTranslate Cleanup and WPML Import, that we can find it in the repositorios of wordpress.
3) To go to the configuration of plugin Cleanup and WPML Import and where they appear these checkbox, we selected the language that we want to maintain and we marked the two options that appear to eliminate all the residual code of our Web:
qtranslate cleanup

To form SEO Yoast and qTranslate

And to already complete the guide to explain that plugin SEO Yoast for wordpress does not take too much with qTranslate well, since by defect it does not recognize any of the previous methods when we entered the fields title SEO, description and keywords.

That would force to us to have the same description and title SEO for all the languages, that is to say, huge problems of labels and duplicated titles that google is not going to let to us pass to happen so easily.
In order to solve this we add to our file functions.php the following thing:

//for Inable qTranslate WordPress SEO //qTranslate and WordPress SEO function to qtranslate_filter ($text) \ {return ($text);} to add_filter (€˜wpseo_title€™, €˜to qtranslate_filter€™, 10, 1);
to add_filter (€˜wpseo_metadesc€™, €˜to qtranslate_filter€™, 10, 1);
to add_filter (€˜wpseo_metakey€™, €˜to qtranslate_filter€™, 10, 1);

Once fact this, we will be able to write titles and descriptions in the box of entrance of data of the SEO Yoast of the following way [: in] description or title in groins [: desc or title in Castilian is]

If you liked this article or she served as help comp¡rtelo please to you
A greeting,
By “scar Carrillo