API:Localisation/tr: Difference between revisions
Created page with "Tüm örneklerde açıklayıcı bir metin bulunmalıdır. Mesaj adları <code>apihelp-''$path''-example-''$arbitrarySuffix''</code> satırları boyunca olmalıdır." |
Created page with "=== Mesaj belgesi ===" |
||
| Line 29: | Line 29: | ||
{{anchor|Message documentation}} |
{{anchor|Message documentation}} |
||
=== |
=== Mesaj belgesi === |
||
When documenting the messages in {{git file|file=includes/api/i18n/qqq.json|text=qqq.json}}, use the following templates: |
When documenting the messages in {{git file|file=includes/api/i18n/qqq.json|text=qqq.json}}, use the following templates: |
||
Revision as of 04:48, 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.- Birkaç ek sabit getAllowedParams() olarak kullanılabilir; ayrıntılar için ApiBase bakın.
ApiBase::PARAM_TYPEdizisi olan parametreler, her değerin ayrı ayrı belgelendiğini belirtmek için $ 2 kullanabilir. Bu iletiler varsayılan olarakapihelp-$path-paramvalue-$name-$valueşeklindedir. İletiler varsayılana göre adlandırılmışsa, iletileriApiBase::PARAM_HELP_MSG_PER_VALUEdizisindeki değerlerle eşleştirmeye gerek yoktur (yine de var olması gerekir, ancak boş bırakılabilir).- Tüm örneklerde açıklayıcı bir metin bulunmalıdır. Mesaj adları
apihelp-$path-example-$arbitrarySuffixsatırları boyunca olmalıdır.
Mesaj belgesi
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.