Template:Localized link/ja
[[Special:MyLanguage/{{{1}}}|{{{1}}}]][[:{{{1}}}| ]]
大規模な崩壊や不要なサーバー負荷を回避するため、このテンプレートのいかなる変更も、前もって下位ページ /サンドボックス、/テストケース、ご自身の利用者下位ページ、のいずれかでテストすべきです。 テスト済みの変更であれば、このページに一度の編集で追加できます。
いかなる変更も、実装する前にトーク ページで議論することをご検討ください。
目的
このヘルパー テンプレートは、翻訳対象ページの利用者の言語版ページにリンクするのに使用できます。
これは特別ページの接頭辞 Special:MyLanguage/ を使用しており、ページに対応する利用者の言語の翻訳版があるかどうかをチェックし、あればそれにリンクし、フォールバック言語があればそれにリンクし、なければウィキ既定の言語版 (MediaWiki では英語) にリンクします。
使用法
Link to translatable page in the user’s language. It uses the special page prefix "Special:MyLanguage/".
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| Page name | 1 | Linked page | Page name | required |
| Displayed text | 2 | Display text for this link | Line | suggested |
| Display the namespace | nsp | If the "nsp" parameter is not defined, as link text displays the full pagename (including namespace); otherwise — if "nsp" parameter is defined by any value — link text displays the short pagename, without namespace.
| String | optional |
「nsp」パラメーターが定義されていない場合、リンク テキストとして名前空間を含む完全なページ名を表示し、それ以外の場合、つまり「nsp」パラメーターが任意の値で定義されている場合、リンク テキストとして名前空間を含まない短いページ名を表示します。
When linking to a section within a page, the section is not displayed in the link text.
簡単な使用例
| 入力内容 | 出力結果 |
|---|---|
| {{ll|Communication}} | コミュニケーション |
| {{ll|Communication|コミュニケーション}} | コミュニケーション |
| {{ll|Project:About}} | Project:プロジェクトについて |
| {{ll|Project:About#See_also}} | Project:プロジェクトについて |
| {{ll|Project:About|nsp=0}} | プロジェクトについて |
翻訳対象ページでの使用例
ページが Translate 拡張機能で翻訳対象にされている場合は、このテンプレートを 3 つの方法で使用できます。
- このテンプレートを subst 展開し、リンク先ページ名を
<tvar name=id>...</tvar>に埋め込むことで、翻訳可能なリンク テキストとは分けるといいでしょう。- For example:
Learn more {{<tvar name=1>ll|Communication</tvar>|about communication}}.
- For example:
- リンク テキストがリンク先のページ名と異なる必要がない場合は、このコードをすべて
<tvar>に埋め込んだ方がいいでしょう。- For example:
Learn more about <tvar name=1>{{ll|Communication}}</tvar>.
- For example:
- For standalone links, such as in a list or table, translate only the link text if it differs from the name of the target page. これは、「関連項目:」節のように、リンクを箇条書きにする場合に便利です。 Make sure to include the parameter name when adding translate tags inside template syntax.
- For example:
* {{ll|Project:About}}* {{ll|Communication|2=<translate>About communication</translate>}}
Test cases
例を更新するにはこのページのキャッシュを破棄 してください。
このページに複雑なテンプレートの例が多数ある場合、ページの最後のほうにあるものは MediaWiki の制限のため誤動作する可能性があります。 これが発生した場合、レンダリングされたページに追加された「NewPP limit report」コメントを参照してください。
テンプレートの使用結果を調べるには、Special:ExpandTemplates も使用できます。
| Subpage |
|---|
{{Localized link|Extension:DiscussionTools/Comparison}}
{{Localized link}} |
| Hide namespace |
|---|
{{Localized link|Extension:DiscussionTools/Comparison|nsp=0}}
{{Localized link}} |
| Hide namespace with {{LC zh }}'s namespace setting |
|---|
{{Localized link|Project:About|nsp=0}}
{{Localized link}} |
関連項目
- Template:Localized link/messagedoc — このテンプレートを使用している翻訳対象ページのメッセージ説明文で使用する必要があります。
- {{Translatable template }} - 別名 {{TNT }}、{{Tnt }}
- {{Translatable template name }} - 別名 {{TNTN }}、{{Tntn }}
- {{Page language link }} - 別名 {{Pll }} - 翻訳対象ページから同じ言語の別の翻訳対象ページへのリンクを追加する