検索を切り替える
検索
メニューを切り替える
39
12
1
569
Sleeping Cocoon-wiki
案内
メインページ
最近の更新
おまかせ表示
MediaWikiについてのヘルプ
特別ページ
ファイルをアップロード
Toggle preferences menu
通知
個人設定を切り替える
ログインしていません
編集を行うと、IPアドレスが公開されます。
user-interface-preferences
個人用ツール
トーク
投稿記録
アカウント作成
ログイン
「
テンプレート:Localization/register
」を編集中
提供:Sleeping Cocoon-wiki
このページを共有
表示
閲覧
編集
履歴表示
associated-pages
テンプレート
議論
その他の操作
警告:
ログインしていません。編集を行うと、あなたの IP アドレスが公開されます。
ログイン
または
アカウントを作成
すれば、あなたの編集はその利用者名とともに表示されるほか、その他の利点もあります。
スパム攻撃防止用のチェックです。 けっして、ここには、値の入力は
しない
でください!
<includeonly><!-- -->{{#dplvar:set<!-- -->|l10n:reg:namespace|{{{1|}}}<!-- -->|l10n:reg:lang|{{{2|en}}}<!-- -->}}<!-- ========================================================================================= If autoloading was triggered, we only load the information for the language that {{l10n|}} currently needs, from the /l10n subtemplate. The registrations of the other languages in the /l10n subtemplate will be skipped, and instead only an "exists" flag for their language will be set. When {{l10n|}} needs another language's information, it will already know if that language exists in the /l10n subtemplate (thanks to the "exists" flag), and will only load the /l10n subtemplate again if that language does exist there. Example (assuming autoload was triggered): (Template:Test/l10n contains l10n registrations for en, fr, and de) We call {{l10n|test|foo|en}}, so the /l10n subtemplate (Template:Test/l10n) will be loaded. Only {{l10n/register|test|en|foo=...}} will be registered; {{l10n/register|test|fr|foo=...}} and {{l10n/register|test|de|foo=...}} will be ignored (though both will be set to "exists"). Now we call {{l10n|test|foo|fr}} sometime later, and {{l10n|}} realizes that there is no relevant l10n information available about fr. Hence it checks the "exists" for fr and sees that there is a registration for fr in the /l10n subtemplate. Consequently, it will load the /l10n subtemplate again, now with the intention to register {{l10n/register|test|fr|foo=...}} (so the de registration will be ignored again). Lastly, we call {{l10n|test|foo|zh}}, and {{l10n|}} again realizes it has no l10n information for zh. It finds that the "exists" flag for zh is not set, however, so it concludes there is no {{l10n/register|test|zh|foo=...}} in the /l10n subtemplate, and will not load it again. ({{l10n|}} will then fallback to using the en information.) Thanks to this method, we can avoid processing numerous {{l10n/register}} calls for languages that are never used on a page, thus save a lot of runtime resources. ========================================================================================= {{#var:l10n:autoloading}} is the important link to {{l10n|}}, the langcode it currently wants to autoload. If it is empty, this registration is transcluded manually (not on an /l10n subtemplate). // autoloaded flag: this namespace has been autoloaded. -->{{#dplvar:set|l10n:autoloaded:{{#dplvar:l10n:reg:namespace}}|{{#var:l10n:autoloading}}}}<!-- // skip this registration? -->{{#if:{{#switch:{{#dplvar:l10n:reg:lang}}|{{#var:l10n:autoloading}}|en=y|#default={{#if:{{#var:l10n:autoloading}}||y}}}}|<!-- don't skip if: (checks performed in this order) * the language of this registration matches the language {{l10n|}} currently wants to autoload, or * the language of this registration is en (en should always be available for fallback), or * we are not autoloading (i.e. this {{l10n/register}} is not on an /l10n subtemplate). // actual registration: -->{{#forargs:|l10n:reg:_key|l10n:reg:_value|<!-- -->{{#dplvar:set|l10n:{{#dplvar:l10n:reg:namespace}}:{{#dplvar:l10n:reg:lang}}:{{#var:l10n:reg:_key}}|{{#var:l10n:reg:_value}}}}<!-- -->}}<!-- -->|<!-- skip if: * we are autoloading, and * the language of this registration is not en, and * the language of this registration does not match the language {{l10n|}} currently wants to autoload. // only set the "exists" flag -->{{#dplvar:set|l10n:{{#dplvar:l10n:reg:namespace}}:{{#dplvar:l10n:reg:lang}}:2|y}}<!-- -->}}<!-- Results now (assuming we are autoloading): * {{#dplvar:l10n:<namespace>:<lang>:1}} will now be non-empty if the l10n info for this language has been loaded and is readily available in full. * {{#dplvar:l10n:autoloaded:<namespace>}} will always be non-empty now – the /l10n subtemplate for this namespace has been loaded at least once now. * {{#dplvar:l10n:<namespace>:<lang>:2}} will now be non-empty if there is an l10n registration in the /l10n subtemplate for this lang, but the l10n info has not been loaded. This information is used by {{l10n|}}. --></includeonly><noinclude>{{doc}} {{category|I18n-ready templates| }} {{language info|en=Template:Localization/register}} </noinclude>
編集内容の要約:
『眠ル繭wiki』への投稿はすべて、他の投稿者によって編集、変更、除去される場合があります。 自分が書いたものが他の人に容赦なく編集されるのを望まない場合は、ここに投稿しないでください。
また、投稿するのは、自分で書いたものか、パブリック ドメインまたはそれに類するフリーな資料からの複製であることを約束してください(詳細は
Sleeping Cocoon-wiki:著作権
を参照)。
著作権保護されている作品は、許諾なしに投稿しないでください!
キャンセル
編集の仕方
(新しいウィンドウで開きます)
このページで使用されているテンプレート:
テンプレート:Category
(
編集
)
テンプレート:Common
(
編集
)
テンプレート:Dablink
(
編集
)
テンプレート:Doc
(
編集
)
テンプレート:Fullurl
(
編集
)
テンプレート:L10n
(
編集
)
テンプレート:Lang
(
編集
)
テンプレート:LangList
(
編集
)
テンプレート:Language info
(
編集
)
テンプレート:Localization
(
編集
)
テンプレート:Translation projects
(
編集
)
モジュール:Language info
(
編集
)