Comment créer des fichiers .pot avec POedit?
-
-
Essayez [Création defichiers POT] (https://codex.wordpress.org/User:Skippy/Creating_POT_Files).Try [Creating POT Files](https://codex.wordpress.org/User:Skippy/Creating_POT_Files).
- 0
- 2016-01-11
- WisdmLabs
-
10 réponses
- votes
-
- 2014-06-11
Vouspouvezessayer Eazy Po .
- Dans lemenu Fichier,sélectionnez "Nouveau àpartir desfichiers de code source ..".
- Dans lafenêtre dugestionnaire de commandes xgettext;Appuyez sur "Parcourir le dossier"pour sélectionner le dossier source debase.
- Dans le volet Build,appuyez sur lebouton "Execute Command"pourgénérer unfichier Pot.
You may try Eazy Po.
- From file menu select “New from source code files..”.
- In xgettext Command Manager window; Press “Browse folder” to select base source folder.
- In Build pane press “Execute Command” button to generate Pot file.
-
Bienmeilleuret plusfacile que POEdit.Nettoyer l'interface utilisateur.Atoutes lesfonctions detraductioni18n dans la liste demots cléspar défaut.Je vous remercie.Much better and easier than POEdit. Clean UI. Has all the i18n translation functions in the keyword list by default. Thank you.
- 0
- 2018-10-01
- Paras Shah
-
Utilisé ceci après avoir réalisé que lesfonctionnalités WordPress de POEdit sontpayantes.Aparfaitementfonctionné!Used this after realizing that POEdit's WordPress features are paid. Worked perfectly!
- 1
- 2018-11-30
- Swen
-
Afonctionnéparfaitementpourmoi aussiet plusfacile,trèsplusfacile quepoedit.Worked perfectly for me too and easier, very easier than poedit.
- 0
- 2020-04-17
- Loc_rabbirt
-
- 2014-11-23
Voici comment créer unfichier .potpour votrethème avec Poedit (éditiongratuite,version 1.6.10) sous OS X.
Lameilleurepratique consiste àenregistrer lesfichiers de langue dans un dossiernommé "languages" dans votre répertoire dethème. Si vousne l'avezpas déjàfait,créez-le avant de commencer.
Dans Poedit:
- Dans lemenu "Fichier",sélectionnez "Nouveau"
- Sélectionnez la langue que vous avez utilisée dans votrethème (probablement l'anglais)
- Dans lemenu "Catalogue",sélectionnez "Propriétés"
- Saisissez lesinformations duprojet dans l'onglet "Propriétés de latraduction"
- Accédez au 3e onglet "Mots clés sources"
- Cliquez sur lebouton "Nouvel élément" (2èmebouton)et saisissez unmot-cléet répétez cette opérationpour chacun de vosmots-clés (
__
,_e
,esc_attr_e
,etc.) - Cliquez sur lebouton "OK"en bas
- Dans lemenu "Fichier",sélectionnez "Enregistrer sous .."
- Enregistrez lefichier sous "yourthemename.pot" dans le dossier "languages" de votre répertoire dethème (assurez-vous d'ajouter l'extension .pot aunom defichier carpar défaut,il seraenregistré sous .po)
- Dans lemenu "Catalogue",sélectionnez ànouveau "Propriétés"
- Allez dans le 2ème onglet "Chemins des sources"
- Définissez la valeur de "Chemin debase" sur
../
(lefichier .potestenregistré dans un sous-répertoire de cettefaçon,vous définissez labase sur le répertoireparent,c'est-à-dire votre répertoire dethème) - À côté de "Chemin",cliquez sur lebouton "Nouvel élément"et entrez
.
(cela lefera analyser votre répertoire dethèmeset ses sous-répertoires) - Cliquez sur lebouton "OK"en bas
- Dans lafenêtre duprojet,cliquez sur "Mettre àjour" (2èmeicôneen haut)
- Dans lemenu "Fichier",cliquez sur "Enregistrer"
Et vous avezterminé :)
Here is how you can create a .pot file for your theme with Poedit (free edition, version 1.6.10) on OS X.
Best practise is to save language files in a folder named "languages" in your theme directory. If you haven't already, create it before you start.
In Poedit:
- In the "File" menu select "New"
- Select the language that you used in your theme (probably English)
- In the "Catalog" menu select "Properties"
- Enter the project information in the "Translation properties" tab
- Go to the 3rd tab "Sources keywords"
- Click on the "New item" button (2nd button) and enter a keyword and repeat this for each of your keywords (
__
,_e
,esc_attr_e
, etc.) - Click on the "OK" button at the bottom
- In the "File" menu select "Save As.."
- Save the file as "yourthemename.pot" in the "languages" folder in your theme directory (make sure you add the .pot extension to the filename because by default it will save as .po)
- In the "Catalog" menu select "Properties" again
- Go to the 2nd tab "Sources paths"
- Set the value for "Base path" to
../
(the .pot file is saved in a subdirectory so this way you set the base to the parent directory, ie. your theme directory) - Next to "Path" click on the "New item" button and enter
.
(this will make it scan your theme directory and its subdirectories) - Click on the "OK" button at the bottom
- In the project window click on "Update" (2nd icon at the top)
- In the "File" menu click "Save"
And you're done :)
-
Celane fonctionnepaspour WordPresset lesmodifications spécifiques apportées au système detraduction.Ilest aumieuxincomplet.This does not work for WordPress and the specific changes to the translation system. It is incomplete at best.
- 0
- 2016-01-30
- Otto
-
Cela atrèsbien fonctionnépourmonpluginIt worked really well for my plugin
- 1
- 2017-01-17
- Pablo S G Pacheco
-
Celafonctionnepour leplugin,maisne traduitpas la description duplugin de l'en-têteIt works for the plugin, but doesnt translate the plugin description from header
- 0
- 2018-02-27
- Awsme Sandy
-
- 2014-11-23
Vouspouvez lefaire avec les outils WordPress,sans POEdit.
Commencezpareffectuer uneextraction svn de http://develop.svn.wordpress.org/trunk/:
svn co http://develop.svn.wordpress.org/trunk/ wpdev
Ensuite,passez au répertoire des outilsi18n qu'il contient:
cd wpdev/tools/i18n/
Ensuite,exécutez simplement lemakepot.php sur le répertoire de votrethème:
php makepot.php wp-theme /path/to/your/theme themename.pot
Cela créera unfichierthemename.potpour vous.Utilisez-le dansn'importe quel outil detraduction standard que vous aimez.
C'estmieux caril utilise le code WordPresspourtrouver lesfonctionsi18n,donc vousne manquerez aucune d'entreelles.En outre,iltrouveraet ajoutera des élémentstels que lesinformations d'en-tête duthème,telles que lenom,la description,etc.Assurez-vous d'inclure l'en-tête "Text Domain:" dans votre style.csspour que ceux-cifonctionnent.
You can do this with the WordPress tools, without POEdit.
First, do an svn checkout of http://develop.svn.wordpress.org/trunk/:
svn co http://develop.svn.wordpress.org/trunk/ wpdev
Then, switch to the i18n tools directory in it:
cd wpdev/tools/i18n/
Then just run the makepot.php over your theme's directory:
php makepot.php wp-theme /path/to/your/theme themename.pot
This will create a themename.pot file for you. Use it in any standard translating tool you like.
This is better because it uses the WordPress code to find the i18n functions, so you won't miss any of them. Additionally, it will find and add things like the theme header information, such as the name, description, etc. This allows for those to be translated too. Make sure you include the "Text Domain:" header in your style.css for those to work.
-
celafonctionnera-t-il aussipour unplugin?will this work for a plugin too?
- 0
- 2014-12-25
- Maruti Mohanty
-
Oui,utilisez simplement "wp-plugin" au lieu de "wp-theme"et celagénérera unfichier POTpour unplugin.Yes, just use "wp-plugin" instead of "wp-theme" and it will generate a POT file for a plugin.
- 2
- 2014-12-25
- Otto
-
Toute autreméthode quin'utilisepas les outils spécifiques à WordPressest cassée d'unemanière ou d'une autre.Every other method that does not use the WordPress specific tools is broken in some way.
- 0
- 2016-01-30
- Otto
-
Des outilsgéniaux!Bien que cela continue degénérer deserreurs comme "Impossible degénérer lefichier"même sije `chmod + x` les répertoires ..Awesome tools! Though it kept throwing errors like "Couldn't generate file" even though I `chmod +x` the directories..
- 0
- 2016-12-22
- Samuel Elh
-
Pourquoi chmod + x aiderait-il?Vous devriezpeut-êtreessayer de rendre le répertoire accessibleen écriture au lieu de l'exécutable.Why would chmod +x help? Maybe you should try making the directory writable instead of executable.
- 1
- 2016-12-23
- Otto
-
Merci Otto,je n'aipas étéinformé de cela,maismaintenantje suis sur Ubuntuet celafonctionneplutôtparfaitement!Thanks Otto, I didn't get notified of that, but now I am on Ubuntu and this works rather perfect!
- 0
- 2017-01-25
- Samuel Elh
-
J'ai suivi lesmêmes étapes,touttraduitmaisimpossible detraduire la description duplugin dans la section d'en-tête duplugin.Followed the same steps, translated everything but unbale to translate the plugin description in the header section of the plugin.
- 0
- 2018-02-27
- Awsme Sandy
-
Si voustraduisez unplugin,assurez-vous d'utiliser "wp-plugin" dans la commandepour qu'il sache quelsen-têtes rechercher.If you're translating a plugin, make sure you use "wp-plugin" in the command so that it knows what headers to look for.
- 0
- 2018-02-27
- Otto
-
- 2018-12-11
J'aitrouvé que lemoyen leplus simplemaintenantest d'utiliser la WP-CLI .Accédez à votrethème oupluginet exécutez la commande suivante (après l'installation de WP-CLI):
wp i18n make-pot . languages/my.pot
(Voir la documentation de la commande)
Vouspouvezensuitemodifier cefichier avec Poedit outout autre outil detraductionpratique.
I found the easiest way now is to use the WP-CLI. Navigate to your theme or plugin and execute the following command (after WP-CLI is installed):
wp i18n make-pot . languages/my.pot
(See documentation of the command)
You can then edit this file with Poedit or any other handy translation tool.
-
cela devrait être lanouvelle réponse acceptéethis should be the new accepted answer
- 0
- 2020-05-26
- maysi
-
- 2015-07-13
Vouspouvez supprimer complètement les outilsexternes avec leplugin Loco Translate .Je l'aiessayéil y aenviron un anet jen'aijamais utilisé POEdit depuis.Installez-le sur votre site detestet créez unfichier POTen un seul clic.
You can drop external tools altogether with Loco Translate plugin. I've tried it about a year ago and never used POEdit since. Install it on your test site and create POT file with one click.
-
Celane fonctionnepaspour WordPresset lesmodifications spécifiques apportées au système detraduction.Ilest aumieuxincomplet.This does not work for WordPress and the specific changes to the translation system. It is incomplete at best.
- 0
- 2016-01-30
- Otto
-
Woot?C'est unplugin WP.Woot? It's a WP plugin.
- 0
- 2017-10-16
- certainlyakey
-
- 2016-03-31
Pourtous ceux qui aimeraient utiliser Poedit au lieu d'Easy Po.
- Télécharger (dernière version de) Poeditet installer
-
Aller aufichier> Nouveau.Unnouvel onglet apparaîtra,choisissez votre langue detraductionet enregistrez (ctrl + s) dans le dossier racine de votrethème wordpress.
-
Sur lapage que vous verrezensuite,cliquez sur - "Extraire des sources".L'onglet que vous verrezensuiteest similaire à ceux utilisés dans les liens que vous avez collés."Informations sur leprojet"est désormais "Propriétés detraduction",ainsi que "Chemins"et "Mots clés" sont respectivement "Chemins sources"et "Mots clés sources"
For anyone who had like to use Poedit instead of Easy Po.
- Download (latest version of) Poedit and Install
Go to file>New. A new tab will come up, choose your language of translation and Save (ctrl + s) to the root folder of your wordpress theme.
On the page you will see next, Click on - "Extract from sources". The tab you will see next is similar to those used in the links you pasted. "Project Info" is now "Translation Properties", as well as "Paths" and "Keywords" are "Sources Paths" and "Sources keywords" respectively
-
- 2016-10-18
J'ai lemêmeproblème,la solution setrouve dans lepremier onglet lors de l'extraction du catalogue,devraitmettre UTF8 recommandé,et dans le 3ème onglet "Mots-clés sources",cliquez sur lebouton "Nouvel élément" (2èmebouton)et entrez unmot-cléet répétez-lepour chacun de vosmots-clés (__,_e).
I have same problem, the solution is in the first tab when you extract catalog, should put UTF8 recommanded, and in the 3th tab "Sources keywords", click on the "New item" button (2nd button) and enter a keyword and repeat this for each of your keywords (__, _e).
-
- 2017-03-02
Comme Otto l'a dit :
Pour les utilisateurs de Mac ,je ferais quelque chose comme:
- Après avoir étéinstallépar
svn co http://develop.svn.wordpress.org/trunk/ wpdev
- Créez un répertoire
/languages/
sur votrethème - Créez unfichier de commande comme
lang.command
dans ce répertoire/languages/
- À l'intérieur de
lang.command
ajoutez un code comme celui-ci ..
#!/bin/bash cd $(dirname "$0") php /Users/YOUNAME/wpdev/tools/i18n/makepot.php wp-theme ../../mytheme mytheme.pot
PS: remplacez votre chemin makepot.php et mytheme par lenom de votrethème
Désormais,chaquefois que vous souhaitez créer unnouveaufichier .POT ,vouspouvez simplementexécuter lang.command^
As Otto said :
For Mac users, I would do something like :
- After installed by
svn co http://develop.svn.wordpress.org/trunk/ wpdev
So...
- Make
/languages/
dir on your theme - Make a command file like
lang.command
in that/languages/
dir - Inside
lang.command
add code something like this..
#!/bin/bash cd $(dirname "$0") php /Users/YOUNAME/wpdev/tools/i18n/makepot.php wp-theme ../../mytheme mytheme.pot
PS: Change your correct makepot.php path and mytheme to your theme name
Now everytime you want to make a new .POT file, you can just ran lang.command
-
- 2020-05-09
Une autre solution alternativepour créer desfichiers .potpour lespersonnes quipréfèrent NPMest wp-pot .Ilest livré avec untas d'options que vouspouvezmodifier à votreguise.Super simple à configurer.
Another alternative solution to create .pot files for folks who prefer NPM is wp-pot. It comes with a bunch of options that you can tweak to your liking. Super simple to set up.
-
- 2014-06-11
Essayez cepost: Créez unfichier .pot ou .poen utilisantPoedit .Il décrit leflux detravailet indique que lesfichiers .poet .pot sontidentiques.
Par défaut,Poeditenregistre votrefichieren tant quefichier .po,mais comme les deuxfichiers sontidentiques,vouspouvez contourner celaen choisissant simplement d'enregistrer lefichier .poen tant quefichier .pot
Try this post: Create a .pot or .po File using Poedit. It describes the workflow, and indicates .po and .pot files are the same.
By default Poedit saves your file as a .po file but since the two files are identical you can get around that by simply choosing to save the .po file as a .pot file
-
Celane fonctionnepaspour WordPresset lesmodifications spécifiques apportées au système detraduction.Ilest aumieuxincomplet.This does not work for WordPress and the specific changes to the translation system. It is incomplete at best.
- 0
- 2016-01-30
- Otto
J'aipassé des heures aujourd'hui sur ce qui semblait être quelque chose detrès simple,à savoir créer unfichier .potpour unthème Wordpress queje crée. J'ai lu l ' article de Smashing Magazine ,le article Tutsplus et quelques autres sur lafaçon d'utiliser Poedit pour créer desfichiers .potpour unthème,puis créer desfichiers .moet .po,maismalheureusement,je suistoujoursbloqué à lapremière étape.
J'aiinstallé Poeditet jetrouve que l'interface utilisateurest complètement différente de celleindiquée danstous les didacticielset il semble qu'iln'y aitplus d'optionpour créer unfichier .pot. La seule chose quiest disponibleest de créer desfichiers .poet .mo àpartir d'unfichier .potexistant,ce quin'estpas ce dontj'aibesoinmaintenant.
Alors,quelqu'unpeut-ilme dire commentpuis-je créer desfichiers .poten utilisant Poedit ou avec une autreméthode,je l'apprécierais vraiment.
Merci!