Dev:FR/2.5/Doc/How to/Translate Blender

提供: wiki
2018年6月29日 (金) 04:46時点におけるYamyam (トーク | 投稿記録)による版 (1版 をインポートしました)
(差分) ← 古い版 | 最新版 (差分) | 新しい版 → (差分)
移動先: 案内検索

Traduction de l’interface de Blender en français

Cette page a pour but de servir de référence pour la traduction de l’interface de Blender en français.

{{#dpl:

 |debug=0
 |skipthispage=no
 |mode=ordered
 |namespace=
 |titlematch=Dev:FR/2.5/Doc/How to/Translate Blender/%
 |shownamespace=false
 |format=Subpages,²{#ifeq:²{IsUpper¦²{SUBPAGENAME:%PAGE%}²}²¦1¦²{Multiply¦*¦²{#expr:1+²{PagetitlePartsAmount¦%TITLE%}²-²{PagetitlePartsAmount¦²{PAGENAME}² }² -1 }² }² ²{SUBPAGENAME:%TITLE%}²¦}²,,

}}Cette page est en cours d’élaboration, et loin d’être complète !



Version anglaise (à traduire!)

Blender translation HOWTO

Here is a brief explanation of how translation works and how to update translation files. There is also a short presentation of all tools found in /tools dir!

NOTE/WARNING
I’m not sure all the command lines I give below are correct for this OS, and I couldn’t test the scripts on such system. Windows users, please tell me if there are any problems!


Note
All this makes references to the bf-translations svn repository.


Translating

NOTE
Gettext tools (msgfmt, msgmerge and xgettext) are mandatory for most of those operations!


How it works

The /branches/<language>/ folders contain source files for translation system (<language> being an ISO language code, like es or zn_CN). These source files have .po extension and a pretty simple syntax:

#: One or more lines of comments stating origins of the message.
#, fuzzy [optional] see below
# One or more lines of free, general comments
msgid "some message id"
msgstr "translation for this message"

In case msgid or msgstr are too long, they'll be split on several lines, like this:

msgid ""
"A very very very very very very very very very very very very very very very"
" very very very very dummy long message id!"

All this means that when the string "some message id" is used as operator name, tooltip, menu and so on, it'll be displayed on the screen as "translation for this message".

Pretty simple.

These source files are pre-compiled into /trunk/locale/<language>/LC_MESSAGES/blender.mo, which are binary files directly usable by the translation system.

How to edit translations - translators

It's also pretty simple. If you can find string you want to translate in /branches/<language>.po file as msgid, just write correct msgstr string for it. If msgid is marked as fuzzy, i.e.

#, fuzzy
msgid "some message id"
msgstr "translation for this message"

...it means translation used to exist for this message, but message was changed, so translation also have to be updated (it's easier to make new translation based on previous translation).

When translation has been updated, remove line with '#, fuzzy' and it'll work.

Note: You can use a GUI to ease po files edition, like e.g. Poedit.

How to add translations - translators

If you have not yet your languages under /branches, you should request (e.g. on the ML) an administrator to add it, as even if you can add a language in bf-translations project yourself, you’ll have to ask a developer to add it in Blender code, else it would be useless!

How to update translations - advanced translators

All po's under /branches/ should be updated something like once a week by an administrator.

However, you can do it yourself for your language, if needed.

Note
Please also see the "III. Tools" section below


To do so, you *must* have both blender and its sources, and a valid /trunk/po/tools/settings.py file. Then, just run:

$ cd where/you/put/trunk/po/tools
$ path/to/python3 ./update_branches.py <language>

(*nix users can skip the "path/to/python3" part, as scripts are executable.)

How to merge translations - translators

You might want to merge several po files together. To do so, you first have to choose a "dest" file, into which will be merged the translations and new messages of all others. Just run:

$ cd where/you/put/your/pos
$ path/to/python3 where/you/put/trunk/po/tools/merge_po.py dst.po src.po [src.po ...]

(*nix users can skip the "path/to/python3" part, as scripts are executable.)

Please read the help message of this script for more details (-h).

How to test your translations - translators

To test your translations, simply run, from your /branches/<language>/ dir:

$ msgfmt --statistics <language>.po -o blender.mo

Then copy the produced blender.mo binary file under your .blender/locale/<language>/LC_MESSAGES/ dir.

About languages needing some po processing

This concerns at least, currently, arabic and persian.

The process is now standardized! Please follow those rules:

  • The <language>.po file in /branches *must be the raw one* (i.e. non-processed).
  • You *must* name your processing script <language>_to_utf.py (e.g. ar_to_utf.py), and it *must* be callable like this:
$ path/to/python3 <language>_to_utf.py raw.po processed.po

This way, the update_trunk.py (and import_po_from_branches.py) scripts will do the conversion automatically!

Administrating

Note
Please also see the "III. Tools" section below


These are advanced and/or /trunk-affecting operations, translators should avoid to use them.

Adding a new language

To do so, you *must* have both blender and its sources, and a valid /trunk/po/tools/settings.py file. Note that adding some code in Blender itself is also required!

For the bf-translation part, just run:

$ cd where/you/put/trunk/po/tools
$ path/to/python3 ./update_branches.py -a <language>

(*nix users can skip the "path/to/python3" part, as scripts are executable.)

Updating all po's under /branches

To do so, you *must* have both blender and its sources, and a valid /trunk/po/tools/settings.py file. Then, just run:

$ cd where/you/put/trunk/po/tools
$ path/to/python3 ./update_branches.py

(*nix users can skip the "path/to/python3" part, as scripts are executable.)

This will build new msg and pot files (in the temp dir, so they don’t even clutter your working dir), and update accordingly <language>.po's found under /branches/<language>, for all existing language.

Note you can restrict the update to a list of languages, simply by passing their ISO codes as command line arguments, see the help (-h).

Updating /trunk

To do so, you *must* have a valid /trunk/po/tools/settings.py file. Then, just run:

$ cd where/you/put/trunk/po/tools
$ path/to/python3 ./update_trunk.py

(*nix users can skip the "path/to/python3" part, as scripts are executable.)

This will:

  • Remove all .po's from trunk.
  • Check all /branches/<language>/<language>.po's, and import those valid and translated above 80% (by default, you can specify another threshold with -t option) into /trunk/po.
  • Clean po's under /trunk/po (i.e. remove all commented messages in them).
  • Compile all po's in /trunk/po to /trunk/locale/<language>/LC_MESSAGES/blender.mo.
  • Clean translations that failed (i.e. remove from /trunk all mo's and po's that failed some way).

Tools

Here we quickly describes all scripts under /trunk/po/tools.

Note that all scripts also generates an help message when called with the "-h" option, please use this for more details.

Note for Windows users

You can find compiled builds of gettext in the lib folder under "binaries\gettext\" for both windows and win64.

In order to run the scripts you will need to replace the location of the GETTEXT_..._EXECUTABLE, in /trunk/po/tools/settings.py

For example:

-GETTEXT_XGETTEXT_EXECUTABLE = "xgettext"
+GETTEXT_XGETTEXT_EXECUTABLE = r"C:\Blender\lib\windows\binaries\gettext\xgettext.exe"

You will also have to specify python3's path, and perhaps others.

Settings - settings_template.py

Very important!

All scripts under /trunk/po/tools use a common setting source, settings.py

When freshly checked out, the /trunk/po/tools only contains a settings_template.py, which you should copy as settings.py, before editing that one.

For *nix users, most settings should be ok, except most probably BLENDER_EXEC and SOURCE_DIR.

Windows users will likely have to set the other executables' paths as well, as noted above.

Remember never to commit your settings.py file (else it would overwrite all others' on next update)! And to update it, when a new version of settings_template.py is committed.

Updating /branches tools

update_msg.py
This script runs _update_msg.py from inside Blender, to generate a trunk/po/messages.txt file (by default) containing all introspection-discovered messages (more than 98% of the messages!)
update_pot.py
This script first runs xgettext (over files listed in /trunk/po/POTFILES.in), to generate /trunk/po/blender.pot (by default), and then merges in all messages from /trunk/po/messages.txt.
update_po.py
This script runs msgmerge to update po's under /branches (by default) or under /trunk/po (-t, that option should never be used!), from /trunk/po/blender.pot.
update_branches.py
As we saw above, this script updates po's under /branches in one step. Under the hood, it obviously uses previous scripts!

Updating /trunk tools

import_po_from_branches.py
This script imports all .po that are advanced enough (default value is 80%, use -t for a different threshold) from /branches into /trunk/po.
update_mo.py
This script compiles po's under /trunk/po into mo's under /trunk/locale, creating directories if necessary.
update_trunk.py
As we saw above, this script updates po's and mo's under /trunk in one step. Under the hood, it obviously uses previous scripts!

Misc

check_po.py
This script can either run a quick test on po's (-m), make some raw stats (-s), or both. It can run over /branches po's (default), or /trunk/po po's (-t). It’s a report-only tool!
clean_po.py
This script removes all commented messages from /branches po's (default) or /trunk/po po's (-t).
merge_po.py
This script accepts two or more files as arguments, and merges into the first, dest file, the translations and new empty messages from all remaining files.
utils.py
This script gathers some commonly used functions, among which parser_messages, which reads and parse a po file.

See Also





Généralités

La traduction de l’interface de Blender se fait par l’intermédiaire du classique gettext. En voici les étapes principales, pour le cas de Blender :

  • Un premier programme (./po/update_msg.py) va extraire du logiciel (ici, Blender) l’ensemble des messages à traduire, et les placer dans un ficher texte (./po/messages.txt)
  • Un deuxième programme (./po/update_pot.py) va mettre à jour le fichier template de traduction (./po/blender.pot). Ce fichier sert de base, de référence pour toutes les traductions.
  • Un troisième programme (./po/update_po.py) va mettre à jour tous les .po existants en y fusionnant les nouveauté contenues dans le .pot. Les .po (par exemple, fr.po) sont les fichiers textes sur lesquels va intervenir le traducteur.
  • C’est donc maintenant que le traducteur intervient, en éditant son fichier .po (soit avec un éditeur de texte classique, soit avec un outil dédié comme poedit). Voir ci-dessous pour description détaillée de ce format de fichier.
  • Une fois les traductions effectuées, un quatrième programme (./po/update_mo.py) va compiler les différents .po en autant de fichiers .mo, qui en sont une version binaire.
  • Lorsque le programme (Blender) est exécuté, il charge le .mo correspondant à la langue choisie par l’utilisateur, et y lit les messages traduits avant de les afficher.

Règles et conventions de traduction

Voici les règles et conventions en usage dans la traduction de l’interface de Blender en français :

Comprendre ce que vous traduisez

Ben oui… Ça paraît évident, mais c’est parfois pas facile du tout à mettre en pratique ! Un bon truc, quand vous avez un doute, consiste à allez voir dans le programme lui-même – si vous le maîtrisez bien, ça devrait vous permettre de lever une bonne partie des ambiguïtés… Petit exemple sur lequel je viens juste de tomber :

  • Pin Cloth se traduit par “Épingler tissu”.
  • Pin Stiffness se traduit par “Raideur d’épinglage” (en fait, “Pinning stiffness” serait plus juste, ici…).

Utiliser l’infinitif

Bien qu’il y ai quelques exceptions (qui sont corrigées au fur et à mesure), les messages en anglais utilise majoritairement cette forme :

"Use X Coordinate"
"Define Color"

ce qui se traduit par :

"Utiliser coordonnée X"
"Définir couleur"

Lorsque vous rencontrez un verbe conjugué en début de phrase (genre “Defines the color”), mettez-le malgré tout à l’infinitif dans la traduction (de toute façon, il a de bonne chance d’y passer aussi en anglais !).

Atention : Cette règle ne s’applique qu’aux verbes initiaux, pas forcément à ceux que vous pouvez rencontrer au sein des phrases…

Ne pas abuser des majuscules

Les conventions des titres anglais autorisent de commencer chaque mot d’un titre en anglais, ce que l’on retrouve dans la plupart des libellés de Blender :

"Copy Location"
"Auto Run Python Scripts"

Ce n’est pas le cas en français ! Donc, hors exceptions (noms propres, références à d’autres éléments de l’interface, …), contentez-vous d’une seule majuscule en début de phrase :

"Copier position"
"Lancement auto scripts Python"

Ne pas mettre de points aux phrase

Ben oui ! Les conventions de Blender (cette fois) veulent qu’il n’y ait pas de point final aux phrase de l’interface (en général, cela concerne les astuces ou tooltips).

Note : Certaines astuces sont encore composées de plusieurs phrases. Là aussi, c’est en court de résorption, donc essayez de n’en faire qu’une (en [ab]usant si nécessaire des parenthèses en incises [–])…

Petit lexique

Voici un tableau récapitulant les traductions de certains mots revenant fréquemment. Notez que certains ne sont tout simplement pas traduits, soit qu’il n’y ait aucune solution satisfaisante, soit que le terme anglais soit tellement “implanté” dans le milieu de la CG qu’il ait été jugé préférable de le conserver.

Original Traduction
Mesh (pl. Meshes) Mesh (pl. Meshes)
Vertex (pl. Vertices) Vertex (pl. Vertices)
Face Face
Edge Arête
Lattice Latice
Metaball Métaballe
Frame Frame (ou photogramme…)
Field Trame (image entrelacée) ou champs (de force)
etc. etc.

Traduction

Voici des informations plus détaillées sur le processus de traduction.

Format des .po