Traduction d’un plugin WordPress

Faire un fichier .po qui contient les traductions.
Le fichier doit avoir le nom du plugin auquel on rajoute -fr_FR

Le fichier contient :

# Translation of plugin amr-users in French (France)
# This file is distributed under the license wtfpl http://www.wtfpl.net

msgid ""
msgstr ""
"Project-Id-Version: Version 1"
"Report-Msgid-Bugs-To: Personne"
"POT-Creation-Date: 05/08/2014"
"MIME-Version: 1.0"
"Content-Type: text/plain; charset=UTF-8"
"Content-Transfer-Encoding: 8bit"
"Plural-Forms: nplurals=2; plural=n>1;"
"Language: fr_FR"
"X-Generator: Vim est ton ami"

#: amr-users/includes/ausers-pluggable.php:1117
msgid "Displaying %s–%s of %s"
msgstr "Affichage de %s à %s sur %s"

 

Compiler en .mo :
# msgfmt -o nom_du_plugin-fr_FR.mo nom_du_plugin-fr_FR.po

Déposer le fichier .mo dans :
../wp-content/languages/plugins/nom_du_plugin-fr_FR.mo

Leave a Reply