Template:Nihongo krt/doc

Usage
This template is basically the same as Nihongo2, except that it appends rōmaji and an English translation inside parenthesis.

This template is useful when one is addressing a Japanese term directly for the purpose of explaining the language patterns (which is otherwise awkward when using rōmaji, since rōmaji is unable to discriminate kana). The optional English translation is included as a bonus for certain use cases but isn't the main purpose of using this template (since the semantic meanings of Japanese words are irrelevant to the explanation of the Japanese language patterns themselves).

Syntax: Parameters:
 * &lt;english>. Optional. The word as translated into English. Note that this will sometimes be the actual Japanese word due to it being adopted into English.
 * &lt;kanji/kana>. Required/Optional. The word as written using Japanese script (kanji, kana).
 * &lt;rōmaji>. Required/Optional. Transliteration of the Japanese word, using Hepburn Romanization.
 * &lt;extra>. Optional. Can be used to add a gloss (particularly if there is no English form). Can also be expressed as a named parameter,
 * &lt;extra2>. Optional. Can also be expressed as a named parameter, . It is only useful in ";" definitions (extra2 will be displayed without bold, whereas text following the template will get the bold).

This template marks the  segment as being in Japanese Kanji, which helps web browsers display it correctly. It also applies the  CSS style class to it.

Parameters 1 and 2 are required, since without Japanese writing this template is futile, and without romaji the target audience on English Wikipedia can't be expected to read Japanese.

Using the template without the Rōmaji and Kanji version is essentially pointless, and will result in a useless or worse-than-useless display. Parameters 4 and 5 can also be directly invoked with extra and extra2. Parameter extra2 is useful only in ";" definitions (extra2's content will be displayed without bold, whereas text following the template will get the bold); see below for a concrete example.

Please note:
 * The Rōmaji parameter (the second one) does automatically put its content into italics, which in most cases should be done (manually).
 * The English parameter (the third one) does automatically put quotation marks around its content.  This may or may not be desired, depending upon the context and content (and as in example below, something else may be done, such as prefacing the English translation with something. Literal translations and linguistic glosses go in single quotation marks, not double.
 * The order of parameters is fixed so that this template can be made with the Nihongo and Nihongo3 templates.

See examples below for usage hints.

Examples
Without an English translation:

Including an English translation:

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


 * *[lang=ja] { color: green; font-family: Arial; }

or


 * .t_nihongo_kanji { color: green; font-family: Arial; }

to common.css.

Error messaging
This template emits one error message of its own:
 * error: : Japanese or romaji text required

One of the positional parameters , the 'Japanese' referred to in the error message or    is required for proper operation of this template.

This error often occurs because the template is malformed:
 * instead of ; 東京タワー is in    instead of   .  To resolve this error, add the missing pipe  or consider using  or

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