Outils pour utilisateurs

Outils du site


webdev:wordpress:translations:wpml

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
webdev:wordpress:translations:wpml [31/10/2017 18:39] dolowebdev:wordpress:translations:wpml [02/11/2017 18:19] (Version actuelle) dolo
Ligne 1: Ligne 1:
 +====== Translations with WPML ======
 +[[https://wpml.org/documentation/support/language-configuration-files/|wpml-config.xml]]
  
 +**Example : force a custom field to be copied and synced with it's translations**
 +<code linenums>
 +<wpml-config>
 + <custom-fields>
 + <custom-field action="copy">pdf-test</custom-field>
 + </custom-fields>
 +</wpml-config>
 +</code>
 +The field can only be updated from the main langage, but is garanteed to be the same on all langages.
 +
 +==== Plugin / Theme translation ====
 +[[https://wpml.org/documentation/support/achieving-wpml-compatibility-for-your-themes-and-plugins/]] - [[https://wpml.org/documentation/support/language-configuration-files/]]
 +
 +<del>Apparemment on a besoin de ces 3 plugins : WPML core, WPML String Translation and WPML Translation Management</del> **C'est juste leur Doc qui est mal expliquée**
 +
 +==== Constante pour récupérer la langue actuelle ====
 +> Yes you can make use of WPML Constant ICL_LANGUAGE_CODE
 +>
 +> For more information please check following URL
 +> http://wpml.org/documentation/support/wpml-coding-api/
 +
 +==== Récupérer l'ID du Term original depuis celle d'un Term traduit ====
 +[[https://wpml.org/forums/topic/taxonomy-get-id-of-original-english-given-id-of-translation/|Post du forum]]
 +
 +<code linenums>
 +$original_tax_id = icl_object_id( $Term_Obj->term_id, 'service_technique_taxonomy', false, 'fr');
 +</code>