Difference between revisions of "Template:Japanese names/core"
(Don't treat alternate capitalisations as translated names. e.g. "Man-eater Bug (DDS)".) |
Dinoguy1000 (talk | contribs) (consolidate the trans_name checks so the property doesn't get stored if no translated name is shown, and expand them to catch more cases (including whitespace differences)) |
||
Line 11: | Line 11: | ||
-->{{ #vardefine: $ja_trans_name | {{ #replace: {{ #replace: {{{#userparam|}}} | kana_only }} | no_ruby }} }}<!-- | -->{{ #vardefine: $ja_trans_name | {{ #replace: {{ #replace: {{{#userparam|}}} | kana_only }} | no_ruby }} }}<!-- | ||
− | -->{{ # | + | -->{{ #switch: {{ lc: {{ #replace: {{ #var: $ja_trans_name }} }} }} |
+ | | {{ lc: {{ #replace: {{ #explode: {{{1}}} | ( }} }} }} | ||
+ | | {{ lc: {{ #replace: {{ #explode: {{ #titleparts: {{PAGENAME}} }} | ( }} }} }} | ||
+ | = [[Category:Pages with an unnecessary translated Japanese name]] | ||
+ | }}<!-- | ||
-->{{ #vardefine: $romaji_name | {{{3<includeonly>|</includeonly>}}} }}[[Romaji name::{{ #var: $romaji_name }}| ]]<!-- | -->{{ #vardefine: $romaji_name | {{{3<includeonly>|</includeonly>}}} }}[[Romaji name::{{ #var: $romaji_name }}| ]]<!-- | ||
Line 17: | Line 21: | ||
| {{ #var: $ja_trans_name | | {{ #var: $ja_trans_name | ||
| {{ #if: {{{4<includeonly>|</includeonly>}}} | | {{ #if: {{{4<includeonly>|</includeonly>}}} | ||
− | | {{{4}}} | + | | {{ #ifeq: {{ lc: {{ #replace: {{{4}}} }} }} | {{ lc: {{ #replace: {{ #explode: {{ #titleparts: {{PAGENAME}} }} | ( }} }} }} |
− | | {{ #ifeq: {{ lc: {{ #explode: {{{1}}} | ( }} }} | {{ lc: {{ #explode: {{PAGENAME}} | ( }} }} | + | | |
+ | | {{{4}}} | ||
+ | }} | ||
+ | | {{ #ifeq: {{ lc: {{ #replace: {{ #explode: {{{1}}} | ( }} }} }} | {{ lc: {{ #replace: {{ #explode: {{PAGENAME}} | ( }} }} }} | ||
| | | | ||
| {{ #explode: {{{1|}}} | ( }} | | {{ #explode: {{{1|}}} | ( }} | ||
Line 37: | Line 44: | ||
-->{{ #if: {{ #var: $romaji_name }} | | -->{{ #if: {{ #var: $romaji_name }} | | ||
; Romaji: ''<span class="nowrap" lang="ja-Latn-Hepburn">{{ #var: $romaji_name }}</span>'' }}<!-- | ; Romaji: ''<span class="nowrap" lang="ja-Latn-Hepburn">{{ #var: $romaji_name }}</span>'' }}<!-- | ||
− | -->{{ #if: {{ #var: $ja_trans_name }} | + | -->{{ #if: {{ #var: $ja_trans_name }} | |
− | ; Translated: <span class="nowrap">{{ #var: $ja_trans_name }}</span> | + | ; Translated: <span class="nowrap">{{ #var: $ja_trans_name }}</span> }} |
</div><!-- | </div><!-- | ||
Revision as of 12:59, 23 June 2019
- Japanese
- {{{2}}}
- Base
- {{{5}}}
- Kana
- {{{6}}}
- Romaji
- {{{3}}}
- Translated
- {{{4}}}
{{Japanese names}} is used to output different ways of writing the Japanese name of a card and store their values in properties. It is typically used in the above
section on card tables.
Usage
{{Japanese names|Japanese name|Rōmaji name|Translated name}}
- Japanese name is to be replaced with the Japanese name, including ruby markup, if any.
- Rōmaji name is to be replaced with the Japanese name, written in rōmaji.
- Translated name is to be replaced with the Japanese name, translated into English.
{{Japanese names|main=A page name}}
- A page name is to be replaced with the name of a page, from which to extract Japanese names from. The target page needs to use the relevant Semantic MediaWiki properties, for this to work.
Examples
{{Japanese names|{{Ruby|青眼の白龍|ブルーアイズ・ホワイト・ドラゴン}}|Burūaizu Howaito Doragon}}
- Japanese
青眼の白龍 - Base
- 青眼の白龍
- Kana
- ブルーアイズ・ホワイト・ドラゴン
- Rōmaji
- Burūaizu Howaito Doragon
{{Japanese names|main=Dark Magician}}
- Japanese
- ブラック・マジシャン
- Rōmaji
- Burakku Majishan
- Translated
- Black Magician
See also
- {{Korean names}}