Terraria Wiki
Terraria Wiki
(Rework for correct French display)
(sync :: en revid:1097454::)
 
(2 versions intermédiaires par un autre utilisateur non affichées)
Ligne 1 : Ligne 1 :
 
<!--
 
<!--
   
//register localization info:
+
//load localization info:
-->{{l10n/register|3ds_version|en<!--
+
-->{{icon-version/l10n}}<!--
-->|short=3DS<!--
 
-->|full=3DS version<!--
 
-->|link=3DS version<!--
 
-->}}<!--
 
-->{{l10n/register|3ds_version|de<!--
 
-->|short=3DS<!--
 
-->|full=3DS-Version<!--
 
-->|link=3DS-Version<!--
 
-->}}<!--
 
-->{{l10n/register|3ds_version|fr<!--
 
-->|short=3DS<!--
 
-->|full=Version 3DS<!--
 
-->|link=Version 3DS<!--
 
-->}}<!--
 
   
   
Ligne 36 : Ligne 22 :
 
-->{{#if:{{{nl|}}}{{{nolink|}}}|{{#vardefine:_v_link|}}}}<!--
 
-->{{#if:{{{nl|}}}{{{nolink|}}}|{{#vardefine:_v_link|}}}}<!--
 
-->{{#if:{{{short|}}}|{{#vardefine:_v_short|y}}}}<!--
 
-->{{#if:{{{short|}}}|{{#vardefine:_v_short|y}}}}<!--
//glue:
+
//glue: must not "short"
 
-->{{#vardefine:_v_glue|{{#ifeq:{{#var:_v_icon}}{{#var:_v_text}}|yy|{{#if:{{#var:_v_short}}||{{{glue|&nbsp;}}}}}}}}}<!--
 
-->{{#vardefine:_v_glue|{{#ifeq:{{#var:_v_icon}}{{#var:_v_text}}|yy|{{#if:{{#var:_v_short}}||{{{glue|&nbsp;}}}}}}}}}<!--
 
//link and display:
 
//link and display:
-->{{#vardefine:_v_link_target|{{l10n|3ds_version|link}}}}<!--
+
-->{{#vardefine:_v_link_target|{{l10n|icon-version|link_3ds}}}}<!--
-->{{#vardefine:_v_display_text_1|<!-- text in front of the 3DS icon
+
-->{{#vardefine:_v_display_text|<!--
 
//text: don't use {{{t|...}}} since when using |t=(blank) it will cause problem.
-->{{#if:{{#var:_v_icon}}|<!--
 
-->{{#if:{{#var:_v_short}}|<!--
+
-->{{#vardefine:_v_base_text|<!--
 
-->{{#or:{{{t|}}}|{{#if:{{#var:_v_short}}|{{l10n|icon-version|text-short_3ds}}|{{l10n|icon-version|text_3ds}}}}}}<!--
-->{{#dplreplace:{{l10n|3ds_version|short}}|/(.*?)\s*3DS.*/|$1}}<!--
 
-->|<!--
+
-->}}<!--
-->{{#dplreplace:{{l10n|3ds_version|full}}|/(.*?)\s*3DS.*/|$1}}<!--
+
-->{{#if:{{#var:_v_icon}}|<!--
-->}}<!--
+
-->{{#if:{{{t|}}}|<!--
  +
--><span style="display:none">3DS</span>__¤__icon:3DS__¤__{{#var:_v_glue}}{{{t}}}<!--
-->}}<!--
 
-->}}<!--
+
-->|<!--
  +
// replace whitespace surrounding the "3DS" part of the string by glue
-->{{#vardefine:_v_display_text_2|<!-- replacement text for the 3DS icon (hidden "3DS" e.g. for TOC heading) or, if using no icon, complete regular text
 
-->{{#if:{{#var:_v_icon}}|<!--
+
-->{{#vardefine:_v_base_text|{{#rreplace:{{#var:_v_base_text}}|/\s+3DS/|{{#var:_v_glue}}3DS}}}}<!--
-->{{#if:{{#var:_v_short}}|<!--
+
-->{{#vardefine:_v_base_text|{{#rreplace:{{#var:_v_base_text}}|/3DS\s+/|3DS{{#var:_v_glue}}}}}}<!--
  +
// add a hidden 3DS for TOC heading. The "__¤__icon:3DS__¤__" part will be replaced by the icon
-->{{#dplreplace:{{l10n|3ds_version|short}}|/.*?(\s*)3DS(\s*).*/|<span style="display:none">$13DS$2</span>}}<!--
+
-->{{#replace:{{#var:_v_base_text}}|3DS|<span style="display:none">3DS</span>__¤__icon:3DS__¤__}}<!--
-->|<!--
 
 
-->}}<!--
-->{{#dplreplace:{{l10n|3ds_version|full}}|/.*?(\s*)3DS(\s*).*/|<span style="display:none">$13DS$2</span>}}<!--
 
-->}}<!--
+
-->|<!--
-->|<!--
+
-->{{#var:_v_base_text}}<!--
 
-->}}<!--
-->{{#if:{{#var:_v_short}}|{{l10n|3ds_version|short}}|{{l10n|3ds_version|full}}}}<!--
 
-->}}<!--
 
-->}}<!--
 
-->{{#vardefine:_v_display_text_3|<!-- text behind the 3DS icon
 
-->{{#if:{{#var:_v_icon}}|<!--
 
-->{{#if:{{#var:_v_short}}|<!--
 
-->{{#dplreplace:{{l10n|3ds_version|short}}|/.*?3DS\s*(.*)/|$1}}<!--
 
-->|<!--
 
-->{{#dplreplace:{{l10n|3ds_version|full}}|/.*?3DS\s*(.*)/|$1}}<!--
 
-->}}<!--
 
-->}}<!--
 
-->}}<!--
 
//text: don't use {{{t|...}}} since when using |t=(blank) it will cause problem.
 
-->{{#if:{{{t|}}}|<!--
 
-->{{#if:{{#var:_v_display_text_1}}|{{#vardefine:_v_display_text_1|{{{t}}}}}}}<!--
 
-->{{#if:{{#var:_v_display_text_3}}|{{#vardefine:_v_display_text_3|{{{t}}}}}}}<!--
 
 
-->}}<!--
 
-->}}<!--
 
   
 
-- start output --
 
-- start output --
   
//TEXT 1:
 
-->{{#if:{{#var:_v_text}}|<!--
 
-->{{#if:{{#var:_v_display_text_1}}|<!--
 
-->{{#if:{{#var:_v_link}}|<!-- if need a link:
 
-->[[{{#var:_v_link_target}}|{{#var:_v_display_text_1}}]]<!--
 
-->|<!--ELSE, plain text
 
-->{{#var:_v_display_text_1}}<!--
 
-->}}<!--
 
-->{{#if:{{#var:_v_icon}}|<!--
 
-->{{#var:_v_glue}}<!--
 
-->}}<!--
 
-->}}<!--
 
-->}}<!--
 
 
// ICON
 
// ICON
-->{{#if:{{#var:_v_icon}}|<!--
+
-->{{#if:{{#var:_v_icon}}|{{#vardefine:_v_icon|<!--
 
//width & height, without "px".
 
//width & height, without "px".
 
-->{{#vardefine:_v_width|{{{width|}}}}}<!--
 
-->{{#vardefine:_v_width|{{{width|}}}}}<!--
Ligne 108 : Ligne 65 :
 
-->}}<!--
 
-->}}<!--
 
//output
 
//output
-->[[File:3DS.svg|{{#var:_v_width}}x{{#var:_v_height}}px|link={{#if:{{#var:_v_link}}|{{#var:_v_link_target}}}}|{{l10n|3ds_version|full}}]]<!--
+
-->[[File:3DS.svg|{{#var:_v_width}}x{{#var:_v_height}}px|link={{#if:{{#var:_v_link}}|{{#var:_v_link_target}}}}|{{l10n|icon-version|text_3ds}}]]<!--
-->}}<!--
+
-->}}}}<!--
 
-->{{#if:{{#var:_v_text}}||{{#var:_v_icon}}}}<!--
//TEXT 2:
 
 
//TEXT:
-->{{#var:_v_display_text_2}}<!--
 
//TEXT 3:
 
 
-->{{#if:{{#var:_v_text}}|<!--
 
-->{{#if:{{#var:_v_text}}|<!--
-->{{#if:{{#var:_v_display_text_3}}|<!--
+
-->{{#if:{{#var:_v_icon}}|<!-- if we need to include the icon:
  +
// split displaytext into pre- and post-icon parts. Since those parts likely begin or end with whitespace, we add Extension:ParserPower's "\0" sequence, which protects the leading/trailing whitespace from being trimmed by #if or #vardefine. The sequence is removed again by #uesc
-->{{#if:{{#var:_v_icon}}|<!--
 
  +
-->{{#vardefine:_v_display_text_pre|{{#explode:{{#var:_v_display_text}}|__¤__icon:3DS__¤__|0|2}}\0}}<!--
-->{{#var:_v_glue}}<!--
 
  +
-->{{#vardefine:_v_display_text_post|\0{{#explode:{{#var:_v_display_text}}|__¤__icon:3DS__¤__|1|2}}}}<!--
 
-->{{#if:{{#var:_v_link}}|<!-- if we need a link:
  +
-->{{#if:{{#uesc:{{#var:_v_display_text_pre}}}}|[[{{#var:_v_link_target}}|{{#uesc:{{#var:_v_display_text_pre}}}}]]}}<!--
 
-->{{#var:_v_icon}}<!--
  +
-->{{#if:{{#uesc:{{#var:_v_display_text_post}}}}|[[{{#var:_v_link_target}}|{{#uesc:{{#var:_v_display_text_post}}}}]]}}<!--
  +
-->|<!-- else: no link
 
-->{{#uesc:{{#var:_v_display_text_pre}}}}<!--
 
-->{{#var:_v_icon}}<!--
 
-->{{#uesc:{{#var:_v_display_text_post}}}}<!--
 
-->}}<!--
 
-->}}<!--
-->{{#if:{{#var:_v_link}}|<!-- if need a link:
+
-->|<!-- else: no icon
-->[[{{#var:_v_link_target}}|{{#var:_v_display_text_3}}]]<!--
+
-->{{#if:{{#var:_v_link}}|<!-- if we need a link:
 
-->[[{{#var:_v_link_target}}|{{#var:_v_display_text}}]]<!--
-->|<!--ELSE, plain text
 
 
-->|<!-- else: no link, plain text
-->{{#var:_v_display_text_3}}<!--
 
-->}}<!--
+
-->{{#var:_v_display_text}}<!--
-->}}<!--
+
-->}}<!--
 
-->}}<!--
 
-->}}<!--
 
-->}}<!--
   

Dernière version du 5 janvier 2021 à 18:35

Version 3DSVersion 3DS

Ce modèle est considéré comme prêt pour i18n, signifiant qu'il est facile à régionaliser pour les différentes langues. Veuillez regarder i18n & l10n pour les modèles (en) pour en apprendre plus.
Template-info Documentation La documentation ci-dessous est transcluse de Modèle:3DS version/doc. (modifier | historique)

An all-in-one template for display 3DS version link/text.

When a simple icon isn't enough, used to mark content as '3DS Only' within a sentence or paragraph. (use Template:Exclusive to mark 3DS exclusive pages or sections)

The "short" parameter value can be used to display "3DS" rather than "3DS version". (note that is different from {{icon|3ds}})

Usage

{{3DS version|MODE|nl/nolink=y|short=y|glue=&nbsp;|t=display text}}

NOTE: When there is icon in output, this template will add a hidden 3DS text after it. So this template can used in heading safely. for example =={{3DS version}}== will display "3DS version" in TOC.

unnamed parameter 1

Output mode, can be icon/text/short:

  • icon: output icon only.
  • text: output text only.
  • short: output icon and short text. Note: This is different from {{3DS version|icon}}, since there is a hidden 3DS more, so it can be used in heading.
nl/nolink=y/yes

Only output icon and/or text, don't make them be links.

short=y/yes

Output short text. {{3DS version|short=y}} has the same effect as {{3DS version|short}}

t=display text

Customize text. Will override short=y, have no effect when mode=icon. NOTE: This will disabled the hidden 3DS output.

glue=

Customize the glue text between icon and text. default is &nbsp;

size, width, height, scale, small

Customize icon display, see {{icon}} for detail.

example

code output note
{{3DS version}} Version 3DSVersion 3DS With a hidden "3DS" after icon.
{{3DS version|icon}} Version 3DS Without a hidden "3DS" after icon, same as {{icon|3ds}}
{{3DS version|text}} Version 3DS No hidden text.
{{3DS version|short}} 3DSVersion 3DS With a hidden "3DS" after icon.
{{3DS version|text|short=y}} 3DS
{{3DS version|short=y}} 3DSVersion 3DS same as {{3DS version|short}}
{{3DS version|t=sometext}} 3DSVersion 3DS sometext customize display text
{{3DS version|nl=y}} Version 3DSVersion 3DS No link, With a hidden "3DS" after icon.
{{3DS version|text|nl=y}} Version 3DS No link, no hidden text.
{{3DS version|short|nl=y}} 3DSVersion 3DS No link, with a hidden "3DS" after icon.
{{3DS version|glue=-}} Version-3DSVersion 3DS With a hidden "3DS" after glue.
{{3DS version|scale=2}} Version 3DSVersion 3DS see {{icon}}
{{3DS version|icon|small=y}} Version 3DS see {{icon}}