Quelle est la différence entre les fichiers .po .mo et .pot dans la localisation wordpress?
1 réponses
- votes
-
- 2016-05-25
Ilne s'agitpas den'importe quelformat de WP,maisplutôt detypes defichiersgettext que WPimplémente.
Lemanuel detraduction contient les définitions suivantes dans son Glossaire :
Fichiers MO: MO ou Machine Objectest unfichier de donnéesbinaire contenant données d'objet référencéespar unprogramme. Ilestgénéralement utilisépourtraduire code deprogramme,et peut être chargé ouimporté dans legettext GNU programme.
Fichiers PO: lesfichiers PO sont lesfichiers qui contiennent les traductions. Chaque langue aura sonproprefichier PO,parexemple, pour lefrançaisil y aurait unfichierfr.po,pour l'allemandil y aurait unfichier de.po,pour l'anglais américain,ilpourrait y avoiren-US.po.
Fichier POT: lesfichiers POT sont lesfichiersmodèles desfichiers PO. Elles vont laisseztoutes les chaînes detraduction vides. Unfichier POTestessentiellement unfichier PO vide sans lestraductions,avecjuste l'original chaînes.
Les détailstechniques desformats defichierspeuvent êtretrouvés dans la documentation degettext:
These are not any kind of WP's own format but rather just gettext file types which WP implements.
Translate Handbook has following definitions in its Glossary:
MO files: MO, or Machine Object is a binary data file that contains object data referenced by a program. It is typically used to translate program code, and may be loaded or imported into the GNU gettext program.
PO files: PO files are the files which contain the actual translations. Each language will have its own PO file, for example, for French there would be a fr.po file, for german there would be a de.po, for American English there might be en-US.po.
POT file: POT files are the template files for PO files. They will have all the translation strings left empty. A POT file is essentially an empty PO file without the translations, with just the original strings.
The technical details of file formats can be found in gettext documentation:
-
Donc,pourmieux le comprendre,en unmot,lesfichiersmoet pot sont laissésintacts (lefichiermoestessentiellement créé automatiquementen utilisant unprogramme,parexemplepoedit)?Jene comprendstoujourspas quandnous avonsbesoin d'unfichier depot ..So, to understand it better, in a nutshell mo and pot files are left intact (mo file is essentially made automatically by using a program, for example poedit)? I still dont understand when we need a pot file..
- 0
- 2018-02-27
- Yannis Dran
-
Lefichier POTest utilisé chaquefois que quelqu'un démarre unnouveaufichier PO àtraduire dans unenouvelle langue.Ainsi,leflux detravailest POT (chaînes d'origine) à PO (chaînes d'origineet leurtraduction dans une langue spécifique) à MO (résultatbinaire compilé).POT file is used whenever someone starts a new PO file for translation to a new language. So the workflow is POT (original strings) to PO (original strings and their translation to a specific language) to MO (compiled binary result).
- 2
- 2018-02-27
- Rarst
-
Vous voulez dire quepour que lestraductions dans unthèmefonctionnent,il doit y avoir unetraduction qui commence àpartir de l'importationpour éditer unfichier .pot?J'ignorais lefichierpot (parce que lethème queje recherchais uniquementestprêtpour lesparamètres régionaux,paspour la langueet n'avaitpas defichierspotfournis)et jene pouvais voir aucun changement de langue après avoirpersonnalisé lesfichiersen-EN.poet .modansma languepréférée.You mean that for translations in a theme to work, there must be a translation which begins from importing to poedit a .pot file? I was ignoring the pot file (because theme I was looking for only is locale ready, not language-ready and had no pot files provided) and I could see no change of the language after customizing the en-EN.po and .mo files to my preferred language.
- 0
- 2018-02-27
- Yannis Dran
-
Je conseillerais de simplementposer unenouvelle question.:) Vousfaitesglisser votreproblèmetrès spécifique (lapersonnalisationne fonctionnepas) dans une questiontrèsgénérale (quels sont lesformats defichiers).I would advise to just ask a new question. :) You are dragging your very specific problem (customization not working) into a very general questions (what are the file formats).
- 1
- 2018-02-27
- Rarst
-
toutebonne référenceen ligne sur cesfichiersany good online reference about these files
- 0
- 2018-12-07
- Er. Amit Joshi
-
@ Er.AmitJoshi J'ai ajouté des liens vers des détailstechniques,si vous êtes curieux de connaître lesinternes.:)@Er.AmitJoshi I have added links to technical details, if you are curious about internals. :)
- 2
- 2018-12-11
- Rarst
-
Je reçois quelquesfichiers .mo ajoutéset j'aipensé que celapourrait être unpiratage à cause du «indésirable»encodé à l'intérieur.Cesfichierspourraient-ils continuer à êtregénérés demanièreinnocente - le cheminest/wp-content/languages/themes/twentytwenty-en_GB.moI am getting a couple of .mo files added and thought it might be a hack because of the encoded 'junk' inside. Could these files keep being generated innocently- path is /wp-content/languages/themes/twentytwenty-en_GB.mo
- 0
- 2019-11-19
- landed
-
@landed oui,lesfichiers `mo` sont auformat _binary_,ilsne sontpas censés être lisiblespar l'homme.@landed yes, `mo` files are _binary_ format, they are not supposed to be human-readable.
- 1
- 2019-11-19
- Rarst
-
Lesfichiers .mopeuvent-ils contenir du code de hackers?Je suisperplexe carj'aimême désinstallé cethème,alors qu'est-ce que la création de cesfichiers?Could .mo files contain hackers code? I am puzzled as I even uninstalled this theme so what is creating these files?
- 0
- 2019-11-20
- landed
-
Que signifie «PO»?What does "PO" stand for?
- 0
- 2020-06-16
- Aaron Franke
-
Ce serait un objetportable.That would be Portable Object.
- 0
- 2020-06-17
- Rarst
Jetraduis un site wordpresset j'aibesoin deplus de clarté sur cestermes.Quelqu'unpeut-iltrouver quelques définitionset différencesentre lesfichiers .po .moet .pot avec la localisation Wordpress?