Jump to content

Template:Localized link/ja

ショートカット: {{ll}} {{LL}}
From mediawiki.org
This page is a translated version of the page Template:Localized link and the translation is 73% complete.

[[Special:MyLanguage/{{{1}}}|{{{1}}}]][[:{{{1}}}| ]]

テンプレートの解説

目的

このヘルパー テンプレートは、翻訳対象ページの利用者の言語版ページにリンクするのに使用できます。 これは特別ページの接頭辞 Special:MyLanguage/ を使用しており、ページに対応する利用者の言語の翻訳版があるかどうかをチェックし、あればそれにリンクし、フォールバック言語があればそれにリンクし、なければウィキ既定の言語版 (MediaWiki では英語) にリンクします。

使用法

[閲覧 · トーク · 編集]

これは、ビジュアルエディターまたは他のツールで使用される、このテンプレート向けのテンプレートデータ説明文です。

Localized link

Link to translatable page in the user’s language. It uses the special page prefix “Special:MyLanguage/”.

Template parameters[Edit template data]

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Page name1

Linked page

Page namerequired
Displayed text2

Display text for this link

Linesuggested
Display the namespacensp

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.

Auto value
0
Stringoptional

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 つの方法で使用できます。

  1. このテンプレートを subst 展開し、リンク先ページ名を <tvar name=id>...</tvar> に埋め込むことで、翻訳可能なリンク テキストとは分けるといいでしょう。
    For example: Learn more {{<tvar name=1>ll|Communication</tvar>|about communication}}.
  2. リンク テキストがリンク先のページ名と異なる必要がない場合は、このコードをすべて ‎<tvar> に埋め込んだ方がいいでしょう。
    For example: Learn more about <tvar name=1>{{ll|Communication}}</tvar>.
  3. 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

Subpage
{{Localized link|Extension:DiscussionTools/Comparison}}

{{Localized link}}

Extension:DiscussionTools/Comparison

{{Localized link/sandbox}}

Extension:DiscussionTools/Comparison

Hide namespace
{{Localized link|Extension:DiscussionTools/Comparison|nsp=0}}

{{Localized link}}

DiscussionTools/Comparison

{{Localized link/sandbox}}

DiscussionTools/Comparison

Hide namespace with {{LC zh }}'s namespace setting
{{Localized link|Project:About|nsp=0}}

{{Localized link}}

プロジェクトについて

{{Localized link/sandbox}}

プロジェクトについて

関連項目