poedit

Utile notamment pour cake et plein d'autres scripts, permet la traduction pour l'internationalisation

quelques astuces:

dans les préférences de poedit, il faut autoriser le parsing des fichiers *.ctp et la syntaxe:

xgettext –language=PHP –force-po -o %o %C %K %F

exemple d'entête de fichier .po

msgid ""
msgstr ""
"Project-Id-Version: cakplanner2\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-02-09 15:44+0100\n"
"PO-Revision-Date: \n"
"Last-Translator: Fred Radeff <'fradeff@akademia.ch'>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Poedit-KeywordsList: __;___;__n;__d;__c;__dc;__dn;__dcn\n"
"X-Poedit-Basepath: /var/www/cakeplanner2/app\n"
"X-Poedit-SourceCharset: utf-8\n"
"X-Poedit-Language: French\n"
"X-Poedit-SearchPath-0: controllers\n"
"X-Poedit-SearchPath-1: models\n"
"X-Poedit-SearchPath-2: views\n"
"X-Poedit-SearchPath-3: libs\n"
"X-Poedit-SearchPath-4: plugins\n"

#: controllers/logs_controller.php:13
#: controllers/logs_controller.php:35
msgid "Invalid log"
msgstr "Log invalide"

#: controllers/logs_controller.php:23
#: controllers/logs_controller.php:40
msgid "The log has been saved"
msgstr "Le log a été sauvegardé"

#: controllers/logs_controller.php:26
#: controllers/logs_controller.php:43
msgid "The log could not be saved. Please, try again."
msgstr " Le log n'a pas été sauvegardé, merci d'essayer à nouveau."
...
  • info/poedit.txt
  • Dernière modification: 2018/07/18 09:46
  • par radeff