Template:Nihongo foot/doc

&#x3c;!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE --&#x3e;

This template marks the &#x3c;code&#x3e;Kanji&#x3c;/code&#x3e; segment as being in Japanese Kanji, which helps user agents (web browsers and so on) to display it correctly. It also applies the &#x3c;code&#x3e;t_nihongo_kanji&#x3c;/code&#x3e; CSS class. The footnote generated is called using the &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;references /&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e;.

Syntax
&#x3c;pre&#x3e;English (Kanji)

&#x3c;references group="group" /&#x3e;&#x3c;/pre&#x3e;

Outputs:

English (Kanji)

&#x3c;references group="group" /&#x3e;

Parameters

 * &#x26;lt;English&#x3e;. Optional. The word as translated into English. Note that this will sometimes be the actual Japanese word due to it being adopted into English.
 * &#x26;lt;kanji/kana&#x3e;. Required when &#x26;lt;rōmaji&#x3e; is empty or omitted. The word as written using Japanese script (kanji, kana).
 * &#x26;lt;rōmaji&#x3e;. Required when &#x26;lt;kanji/kana&#x3e; is empty. Transliteration of the Japanese word, using Hepburn Romanization.
 * &#x26;lt;extra&#x3e;. Optional. Can be used to add a gloss (particularly if there is no English form). Can also be expressed as a named parameter, &#x3c;code&#x3e;extra=&#x3c;/code&#x3e;
 * &#x26;lt;extra2&#x3e;. Optional. Can also be expressed as a named parameter, &#x3c;code&#x3e;extra2=&#x3c;/code&#x3e;. It is only useful in ";" definitions (extra2 will be displayed without bold, whereas text following the template will get the bold).
 * lead=yes. Optional. This should be used for the first instance of Japanese, usually in the lead. It gives the reader an idea what kind of non-English writing they are viewing.
 * post=&#x26;lt;postscript&#x3e;. Optional. Additional characters, such as commas, added after the visible English name but before the reference.
 * group&#x26;lt;group name&#x3e;. Optional. Can be used to define a custom references group. The group is then called by using &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;references group=&#x3c;/nowiki&#x3e;"group" /&#x3e;&#x3c;/code&#x3e; instead of the normal &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;references /&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e;.
 * ref_name&#x26;lt;name&#x3e;. Optional. Can be used to define a custom reference name. Use when the note is called multiple times with the same value on a page.
 * lead=yes. Optional. This should be used for the first instance, usually a footnote in the lead. It gives the reader an idea what kind of non-English writing they are viewing.

User style
User style can be set by adding code similar to

&#x3c;syntaxhighlight lang="css"&#x3e; @media screen, tv { *[lang="ja"] { color: green; } }&#x3c;/syntaxhighlight&#x3e;

or

&#x3c;syntaxhighlight lang="css"&#x3e; @media screen, tv { .t_nihongo_kanji { color: green; } } &#x3c;/syntaxhighlight&#x3e; to your common.css.

Error messaging
This template emits one error message of its own:
 * &#x3c;span class="error" style="font-size:100%"&#x3e;error: &#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;: Japanese or romaji text required&#x3c;/span&#x3e;

One of the positional parameters &#x3c;code&#x3e;&#x26;lt;kanji/kana&#x3e;&#x3c;/code&#x3e; (&#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e;), the 'Japanese' referred to in the error message or &#x3c;code&#x3e;&#x26;lt;rōmaji&#x3e;&#x3c;/code&#x3e; (&#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e;) is required for proper operation of this template. Articles with these errors are collected in.

This error often occurs because the template is malformed:
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;東京タワー&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; instead of &#x3c;code&#x3e;&#x3c;nowiki&#x3e; (東京タワー)&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e;; 東京タワー is in &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; (&#x3c;code&#x3e;&#x26;lt;English&#x3e;&#x3c;/code&#x3e;) instead of &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; (&#x3c;code&#x3e;&#x26;lt;kanji/kana&#x3e;&#x3c;/code&#x3e;). To resolve this error, add the missing pipe (&#x3c;code&#x3e;|&#x3c;/code&#x3e;).

Because this template uses and  which emit their own error messages, see the help text for those at:
 * – for error messages emitted by
 * – for error messages emitted by