API:Localisation/tr: Difference between revisions
Created page with ""newer" ve "older" (ilgili "start" ve "end" parametreleriyle) değerleri alan parametreleri sıralamak, yinelenen bir iletiyi yeniden tanımlamak yerine $1 kullanmalıdır." |
Created page with "$1 uygulayarak CSRF anahtarını kullanan modüllerin <var>token</var> parametresini belgelemeleri gerekmez; bu ApiBase tarafından otomatik olarak yapılır." |
||
| Line 23: | Line 23: | ||
** "Daha fazla sonuç olduğunda, devam etmek için bunu kullanın" benzeri bir açıklamaya sahip parametreler, yinelenen bir iletiyi yeniden tanımlamak yerine [[MediaWiki:api-help-param-continue|api-help-param-continue]] kullanmalıdır. |
** "Daha fazla sonuç olduğunda, devam etmek için bunu kullanın" benzeri bir açıklamaya sahip parametreler, yinelenen bir iletiyi yeniden tanımlamak yerine [[MediaWiki:api-help-param-continue|api-help-param-continue]] kullanmalıdır. |
||
** "newer" ve "older" (ilgili "start" ve "end" parametreleriyle) değerleri alan parametreleri sıralamak, yinelenen bir iletiyi yeniden tanımlamak yerine [[MediaWiki:api-help-param-direction|api-help-param-direction]] kullanmalıdır. |
** "newer" ve "older" (ilgili "start" ve "end" parametreleriyle) değerleri alan parametreleri sıralamak, yinelenen bir iletiyi yeniden tanımlamak yerine [[MediaWiki:api-help-param-direction|api-help-param-direction]] kullanmalıdır. |
||
** |
** [//doc.wikimedia.org/mediawiki-core/master/php/classApiBase.html#a9bd9dd747c20665d94b5939373b3f40c <code>needsToken()</code>] uygulayarak CSRF anahtarını kullanan modüllerin <var>token</var> parametresini belgelemeleri gerekmez; bu ApiBase tarafından otomatik olarak yapılır. |
||
** Several additional constants are available for use in [//doc.wikimedia.org/mediawiki-core/master/php/classApiBase.html#a6806d2768e2bf6ea57e6b081bf4a9f9f getAllowedParams()]; see ApiBase for details. |
** 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 <code>ApiBase::PARAM_TYPE</code>] may use [//doc.wikimedia.org/mediawiki-core/master/php/classApiBase.html#a5a023b82d4aa17a44e33c1e8e2abdd6b <code>ApiBase::PARAM_HELP_MSG_PER_VALUE</code>] to specify that each value is individually documented. These messages are by default <code>apihelp-''$path''-paramvalue-''$name''-''$value''</code>. If the messages are named according to the default, there is no need to map messages to values in the <code>ApiBase::PARAM_HELP_MSG_PER_VALUE</code> array (it still has to exist but can be left empty). |
* Parameters with an array for [//doc.wikimedia.org/mediawiki-core/master/php/classApiBase.html#a345d7963199abd8893bd88015f7d4ed6 <code>ApiBase::PARAM_TYPE</code>] may use [//doc.wikimedia.org/mediawiki-core/master/php/classApiBase.html#a5a023b82d4aa17a44e33c1e8e2abdd6b <code>ApiBase::PARAM_HELP_MSG_PER_VALUE</code>] to specify that each value is individually documented. These messages are by default <code>apihelp-''$path''-paramvalue-''$name''-''$value''</code>. If the messages are named according to the default, there is no need to map messages to values in the <code>ApiBase::PARAM_HELP_MSG_PER_VALUE</code> array (it still has to exist but can be left empty). |
||
Revision as of 04:47, 6 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
- Daha önce getParamDescription() yöntemi tarafından döndürülen parametre açıklama iletileri
apihelp-$path-param-$name(burada$name, getAllowedParams() öğesinin anahtarıdır). Bu, getAllowedParams() üzerinden döndürülen veri yapısındaApiBase::PARAM_HELP_MSGiçin bir değer ayarlanarak geçersiz kılınabilir.- "Daha fazla sonuç olduğunda, devam etmek için bunu kullanın" benzeri bir açıklamaya sahip parametreler, yinelenen bir iletiyi yeniden tanımlamak yerine api-help-param-continue kullanmalıdır.
- "newer" ve "older" (ilgili "start" ve "end" parametreleriyle) değerleri alan parametreleri sıralamak, yinelenen bir iletiyi yeniden tanımlamak yerine api-help-param-direction kullanmalıdır.
needsToken()uygulayarak CSRF anahtarını kullanan modüllerin token parametresini belgelemeleri gerekmez; bu ApiBase tarafından otomatik olarak yapılır.- 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.