API:Localisation/fr

Ce document contient les informations spécifiques à la localisation de l'API action de MediaWiki (api.php). Voir Localisation pour les commentaires généraux sur la localisation de MediaWiki.

Fichiers de messages
Les messages de localisation du coeur de MediaWiki se trouvent sous. Pour les extensions, les messages peuvent être inclus dans les fichiers généraux i18n ou se trouver dans un fichier séparé utilisant les mécanismes standards pour avoir des fichiers multiples.

Nommage
The help messages for API modules are namespaced using the "module path", which is the string used for action=help's "modules" parameter. For modules added to this is going to be the same as the key used in that array, while for modules added to, , or  it will be that key prefixed with "query+".


 * The description message, formerly returned by the [//doc.wikimedia.org/mediawiki-core/master/php/classApiBase.html#a49b8857e40e254e0af27fd281f3a2230 getDescription] method, has been split into two: a  message with a one-line summary of the module and a   containing any additional module-level documentation. These may be overridden with corresponding methods, but cases where that is needed are rare.
 * Prior to 1.30, a  message was used. This was be overridden by implementing the [//doc.wikimedia.org/mediawiki-core/master/php/classApiBase.html#aa0c499873fba5c934b98aae65e61a33d getDescriptionMessage] method, but cases where that was needed were rare.
 * The parameter description messages, formerly returned by the [//doc.wikimedia.org/mediawiki-core/master/php/classApiBase.html#a1d9406dc4a7b6e5b69554c492ee464f6 getParamDescription] method, are  (where   is the key from [//doc.wikimedia.org/mediawiki-core/master/php/classApiBase.html#a6806d2768e2bf6ea57e6b081bf4a9f9f getAllowedParams]). This may be overridden by setting a value for [//doc.wikimedia.org/mediawiki-core/master/php/classApiBase.html#ab3a6e8b6e7cfbaf4f8bf4339a13d76c5  ] in the data structure returned from [//doc.wikimedia.org/mediawiki-core/master/php/classApiBase.html#a6806d2768e2bf6ea57e6b081bf4a9f9f getAllowedParams].
 * Parameters with a description similar to "When more results are available, use this to continue" should use api-help-param-continue instead of redefining a duplicate message.
 * Sorting parameters taking values "newer" and "older" (with related "start" and "end" parameters) should use api-help-param-direction instead of redefining a duplicate message.
 * Modules using CSRF tokens by implementing [//doc.wikimedia.org/mediawiki-core/master/php/classApiBase.html#a9bd9dd747c20665d94b5939373b3f40c ] do not need to document the token parameter; this is automatically handled by ApiBase.
 * Several additional constants are available for use in [//doc.wikimedia.org/mediawiki-core/master/php/classApiBase.html#a6806d2768e2bf6ea57e6b081bf4a9f9f getAllowedParams]; see ApiBase for details.
 * Parameters with an array for [//doc.wikimedia.org/mediawiki-core/master/php/classApiBase.html#a345d7963199abd8893bd88015f7d4ed6 ] may use [//doc.wikimedia.org/mediawiki-core/master/php/classApiBase.html#a5a023b82d4aa17a44e33c1e8e2abdd6b  ] to specify that each value is individually documented. These messages are by default  . If the messages are named according to the default, there is no need to map messages to values in the   array (it still has to exist but can be left empty).
 * All examples must have a descriptive text. Message names should be along the lines of.

Documentation des messages
Quand vous documentez les messages dans, utilisez les modèles ,  ,  ,  , et.

Format des messages
All messages should end with a period, and be grammatical sentences. For parameters passed to the messages by default, see the templates linked from #Message documentation.

Utiliser le marquage sémantique de texte wiki dans les messages:
 * for mention of parameter keys, and also references to variables like $wgMiserMode.
 * for the possible values of parameters, mention of parameters with values (including references to other modules), and the mention of the input values in example docs.
 * for mention of keys or values in the API output.
 * for anything else that's computer code, e.g. "the  header" or "the page  ".
 * You don't need additional quotation marks when using semantic markup.

If you need to reference other API modules, pipe a link to Special:ApiHelp and the help formatter will do the right thing. For example, " " is used in the documentation for various token parameters. The Special:ApiHelp link properly renders as an in-page anchored link if it's on the same help page (example). Similarly, reference to MediaWiki configuration variables such as $wgMiserMode should link to the documentation on mediawiki.org.

Pages referenced in examples should generally not be linked, as these links are unlikely to exist on many wikis.

Erreurs et avertissements
Les erreurs sont déclenchées en appelant  et le message est localisé de manière habituelle. C'est la même chose pour les avrtissements avec. Voir pour les détails.

Customarily API error messages have message keys starting with  and warnings with.

Texte dans les réponses de l'API
ApiBase, and thus all API modules, are also context sources. Messages should generally be accessed using, and the API module itself should generally be passed when an IContextSource is needed.

Messages should not be arbitrarily included in the output because a client might find it useful.

Améliorer les localisations sur translatewiki
You can add and improve API help message translations on translatewiki.net, in the same manner as other core MediaWiki messages. The relevant message groups include


 * API d'action de MediaWiki
 * Utiliser les fonctions de l'API

Voir aussi

 * API/Architecture_work/i18n – Ebauche de document avec des informations sur la conversion des anciens modules de l'API vers le nouveau système.