API:Localisation/tr: Difference between revisions
Created page with "Daha önce $getDescription yöntemi tarafından döndürülen açıklama iletisi ikiye bölünmüştür: modülün tek satırlık özetini içeren bir $summary mesajı ve mod..." |
Created page with "1.30'dan önce bir $description mesajı kullanıldı. Bu, $1 yöntemi uygulanarak geçersiz kılındı, ancak bunun gerekli olduğu durumlar nadirdi." |
||
| Line 19: | Line 19: | ||
* Daha önce [//doc.wikimedia.org/mediawiki-core/master/php/classApiBase.html#a49b8857e40e254e0af27fd281f3a2230 getDescription()] yöntemi tarafından döndürülen açıklama iletisi ikiye bölünmüştür: modülün tek satırlık özetini içeren bir <code>apihelp-''$path''-summary</code> mesajı ve modül düzeyinde ek belgeler içeren bir <code>apihelp-''$path''-extended-description</code>. Bunlar, karşılık gelen yöntemlerle geçersiz kılınabilir, ancak bunun gerekli olduğu durumlar nadirdir. |
* Daha önce [//doc.wikimedia.org/mediawiki-core/master/php/classApiBase.html#a49b8857e40e254e0af27fd281f3a2230 getDescription()] yöntemi tarafından döndürülen açıklama iletisi ikiye bölünmüştür: modülün tek satırlık özetini içeren bir <code>apihelp-''$path''-summary</code> mesajı ve modül düzeyinde ek belgeler içeren bir <code>apihelp-''$path''-extended-description</code>. Bunlar, karşılık gelen yöntemlerle geçersiz kılınabilir, ancak bunun gerekli olduğu durumlar nadirdir. |
||
** |
** 1.30'dan önce bir <code>apihelp-''$path''-description</code> mesajı kullanıldı. Bu, [//doc.wikimedia.org/mediawiki-core/master/php/classApiBase.html#aa0c499873fba5c934b98aae65e61a33d getDescriptionMessage()] yöntemi uygulanarak geçersiz kılındı, ancak bunun gerekli olduğu durumlar nadirdi. |
||
* The parameter description messages, formerly returned by the [//doc.wikimedia.org/mediawiki-core/master/php/classApiBase.html#a1d9406dc4a7b6e5b69554c492ee464f6 getParamDescription()] method, are <code>apihelp-''$path''-param-''$name''</code> (where <code>''$name''</code> 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 <code>ApiBase::PARAM_HELP_MSG</code>] in the data structure returned from [//doc.wikimedia.org/mediawiki-core/master/php/classApiBase.html#a6806d2768e2bf6ea57e6b081bf4a9f9f getAllowedParams()]. |
* The parameter description messages, formerly returned by the [//doc.wikimedia.org/mediawiki-core/master/php/classApiBase.html#a1d9406dc4a7b6e5b69554c492ee464f6 getParamDescription()] method, are <code>apihelp-''$path''-param-''$name''</code> (where <code>''$name''</code> 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 <code>ApiBase::PARAM_HELP_MSG</code>] 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 [[MediaWiki:api-help-param-continue|api-help-param-continue]] instead of redefining a duplicate message. |
** Parameters with a description similar to "When more results are available, use this to continue" should use [[MediaWiki:api-help-param-continue|api-help-param-continue]] instead of redefining a duplicate message. |
||
Revision as of 18:44, 1 July 2020
| Bu sayfa MediaWiki Eylem API'si belgelerinin bir parçasıdır. |
| MediaWiki sürümü: | ≥ 1.25 Gerrit change 160798 |
Bu, MediaWiki eylem API'sinin (api.php) yerelleştirilmesine özgü şeyleri belgeler.
MediaWiki yerelleştirmesi hakkında genel yorumlar için Yerelleştirme sayfasına bakın.
Mesaj dosyaları
MediaWiki çekirdeği için yerelleştirme mesajları includes/api/i18n altında bulunur.
Uzantılar için, yalnızca API belgesi için kullanılan ve çoğu son kullanıcı tarafından görülmeyen mesajlar birden fazla dosya için normal mekanizmalar kullanılarak ayrı bir dosyada olmalıdır. Yeni mesaj eklemeyle ilgili yerelleştirme belgelerine bakın.
Yardım mesajları
Adlandırma
API modülleri için yardım mesajları, action=help “modules” parametresi için kullanılan dize olan "module path" kullanılarak adlandırılır. $wgAPIModules ile eklenen modüller için bu, bu dizide kullanılan anahtarla aynı olurken, $wgAPIPropModules, $wgAPIListModules veya $wgAPIMetaModules ile eklenen modüller için, "query+" önekine sahip anahtar olacaktır.
- Daha önce getDescription() yöntemi tarafından döndürülen açıklama iletisi ikiye bölünmüştür: modülün tek satırlık özetini içeren bir
apihelp-$path-summarymesajı ve modül düzeyinde ek belgeler içeren birapihelp-$path-extended-description. Bunlar, karşılık gelen yöntemlerle geçersiz kılınabilir, ancak bunun gerekli olduğu durumlar nadirdir.- 1.30'dan önce bir
apihelp-$path-descriptionmesajı kullanıldı. Bu, getDescriptionMessage() yöntemi uygulanarak geçersiz kılındı, ancak bunun gerekli olduğu durumlar nadirdi.
- 1.30'dan önce bir
- The parameter description messages, formerly returned by the getParamDescription() method, are
apihelp-$path-param-$name(where$nameis the key from getAllowedParams()). This may be overridden by setting a value forApiBase::PARAM_HELP_MSGin the data structure returned from 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
needsToken()do not need to document the token parameter; this is automatically handled by ApiBase. - Several additional constants are available for use in getAllowedParams(); see ApiBase for details.
- Parameters with an array for
ApiBase::PARAM_TYPEmay useApiBase::PARAM_HELP_MSG_PER_VALUEto specify that each value is individually documented. These messages are by defaultapihelp-$path-paramvalue-$name-$value. If the messages are named according to the default, there is no need to map messages to values in theApiBase::PARAM_HELP_MSG_PER_VALUEarray (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
apihelp-$path-example-$arbitrarySuffix.
Message documentation
When documenting the messages in qqq.json, use the following templates:
{{doc-apihelp-summary|module path}}{{doc-apihelp-extended-description|modül yolu}}{{doc-apihelp-param|module path|parameter name}}{{doc-apihelp-paramvalue|module path|parameter name|parameter value}}{{doc-apihelp-example|module path}}
Message formatting
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.
Use semantic wikitext markup in messages:
<var>for mention of parameter keys, and also references to variables like $wgMiserMode.<kbd>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.<samp>for mention of keys or values in the API output.<code>for anything else that's computer code, e.g. "themax-ageheader" or "the page<head>".- 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, "[[Special:ApiHelp/query+tokens|action=query&meta=tokens]]" 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.
Hata ve uyarılar
Errors are raised by calling $this->dieWithError( $messageObjectOrKey ); and the message can be localized in the usual way. Likewise for warnings with $this->addWarning( $messageObjectOrKey );.
See API:Errors and warnings for details.
Customarily API error messages have message keys starting with apierror- and warnings with apiwarn-.
Text in API responses
ApiBase, and thus all API modules, are also context sources. Messages should generally be accessed using $this->msg(), 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.
Improving localisations on 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
See also
- API/Architecture_work/i18n – Draft document with information for converting old API modules to the new system.