Difference between revisions of "Template:Translation"

From Nookipedia, the Animal Crossing wiki
(Translation template for use in infoboxes)
 
(Template will now adjust column count based on string length of translation input instead of English name. Changed name of length parameter to max-length.)
Line 1: Line 1:
{{#ifeq:{{#expr:{{#len:{{{name|{{#titleparts: {{PAGENAME}} | | -1 }}}}}}}<{{{length|12}}}}}|1|
+
{{#if:{{#ifexpr: {{#expr:{{#len:{{{ja-name|}}}}} + {{#len:{{{zh-name|}}}}} + {{#len:{{{zht-name|}}}}}}} < {{{max-length|31}}} | 3-col |}}{{#ifexpr: {{#expr:{{#len:{{{ko-name|}}}}} + {{#len:{{{fr-name|}}}}} + {{#len:{{{frq-name|}}}}}}} < {{{max-length|31}}} | 3-col |}}{{#ifexpr: {{#expr:{{#len:{{{it-name|}}}}} + {{#len:{{{es-name|}}}}} + {{#len:{{{esl-name|}}}}}}} < {{{max-length|31}}} | 3-col |}}{{#ifexpr: {{#expr:{{#len:{{{de-name|}}}}} + {{#len:{{{nl-name|}}}}} + {{#len:{{{ru-name|}}}}}}} < {{{max-length|31}}} | 3-col |}}|
 
<div style="text-align:left; line-height:1em; display:inline-block;">
 
<div style="text-align:left; line-height:1em; display:inline-block;">
 
[[File:Flag of Japan.png|Japanese|link=|14px]]&nbsp;<span style="font-size:.75em;">{{#if:{{{ja-name|}}}|{{{ja-name|}}}|{{Colorshow|{{{color|ccc}}}|Unknown}}}}</span><br>
 
[[File:Flag of Japan.png|Japanese|link=|14px]]&nbsp;<span style="font-size:.75em;">{{#if:{{{ja-name|}}}|{{{ja-name|}}}|{{Colorshow|{{{color|ccc}}}|Unknown}}}}</span><br>
Line 57: Line 57:
 
For use in Infobox-style templates to display translation information. Will appear as two columns if the length of the page or the <code>name</code> parameter is greater than 12 characters.
 
For use in Infobox-style templates to display translation information. Will appear as two columns if the length of the page or the <code>name</code> parameter is greater than 12 characters.
 
* <code>spacing</code> can be used to adjust the padding in between the translation columns.
 
* <code>spacing</code> can be used to adjust the padding in between the translation columns.
* <code>length</code> can be used to change the character count/force the 2-column or 3-column display.
+
* <code>max-length</code> can be used to change the character count/force the 2-column or 3-column display. The default value is 31. Increasing the value creates a tendency towards a 3-column display, decreasing it, a 2-column display.

Revision as of 14:35, May 2, 2020

Japanese Unknown
Korean Unknown
Italian Unknown
German Unknown

Chinese Unknown
French Unknown
Spanish Unknown
Dutch Unknown

Chinese Unknown
French Unknown
Spanish Unknown
Russian Unknown

Usage

{{Translation
| name     = <optional>
| color    = <hexcode (no preceding '#')>
| length   = <optional>
| spacing  = <optional>
| ja-name  = <japanese>
| ko-name  = <korean>
| zh-name  = <chinese (simplified)>
| zht-name = <chinese (traditional)>
| fr-name  = <french>
| frq-name = <french (quebec)> 
| es-name  = <spanish>
| esl-name = <spanish (latin america)>
| it-name  = <italian>
| de-name  = <german>
| nl-name  = <dutch>
| ru-name  = <russian>
}}

For use in Infobox-style templates to display translation information. Will appear as two columns if the length of the page or the name parameter is greater than 12 characters.

  • spacing can be used to adjust the padding in between the translation columns.
  • max-length can be used to change the character count/force the 2-column or 3-column display. The default value is 31. Increasing the value creates a tendency towards a 3-column display, decreasing it, a 2-column display.