Global Lua Modules/Japanese

Japanese is a module used to display Japanese characters and pronunciation.

Features

 * Highly customizable with classes, inline styles, and portable/modular CSS.
 * Highly performant and backwards compatible with previous incarnations of the template.
 * Uses semantic markup and modern CSS for SEO, accessibility, and mobile-friendliness.
 * Optional features such as left- and right-aligning the pull quote. The template breaks silently and elegantly when not all parameters are provided, giving it flexibility.

Module
First thing is the module itself. You don't need to copy the code. Just create a module titled Module:Japanese (or any other—just remember to adjust  calls) and put this in the code

CSS
CSS for this template is entirely optional, and provides minor formatting to the output. To do this, copy and paste from the following:

Template
The module is designed to be used as a regular template. To do that just create a template (ex: Template:J) with following content:

Now the template you created will accept parameters documented below.

Usage
For example:

An optional  parameter allows the display text to be changed. The default is. Below are examples of alternatives,,  ,  , and.

can contain any string. Instances of  are replaced with the input Japanese,   with the rōmaji, and   with the lit. translation. If  is not used and there is a lit. translation given then it always goes after either the Japanese or rōmaji, whichever is used second (although both would be required).

Spacing is ignored and handled automatically. To preserve spacing and to print "j", "r", or "l" characters, square brackets can be used and their contents remain. Square brackets can be printed literally inside of square brackets, however the "j", "r", and "l" values cannot appear inside them.