Template:HexString: Difference between revisions

From The Talos Principle Wiki
Second argument (translation) is now optional.
No edit summary
Line 1: Line 1:
{{#ifeq:{{{2|}}}|{{{2}}}|<abbr title="{{{2}}}">{{{1}}}</abbr>|<span style="border-bottom: 1px dotted red;">{{{1}}}</span>[[Category:Pages with untranslated hex strings]]}}<noinclude>
{{#ifeq:{{{2|}}}|{{{2}}}|<span style="white-space: pre; text-decoration: underline dotted black;" title="{{{2}}}">{{{1}}}</span>|<span style="text-decoration:underline dotted red;">{{{1}}}</span>[[Category:Pages with untranslated hex strings]]}}<noinclude>


This is used to show hex strings, with or without translations.
This is used to show hex strings, with or without translations.
Line 5: Line 5:
* If a translation is not provided, the page is automatically added to [[:Category:Pages with untranslated hex strings]].
* If a translation is not provided, the page is automatically added to [[:Category:Pages with untranslated hex strings]].
== Usage ==
== Usage ==
<pre>{{HexString|48656c6c6f|Hello}} is translated, {{HexString|00}} is not translated.</pre>
That shows up as:
{{HexString|48656c6c6f|Hello}} is translated, {{HexString|00}} is not translated.
=== Multiple lines: ===
You can break both the text and the tooltip into multiple lines. The text follows the usual MediaWiki conventions, but for the tooltip you need to explicitly break the text using the newline/line feed HTML character entity:
<pre>{{HexString
<pre>{{HexString
|48656c6c6f
|
|Hello
48656c6c6f2c0a
}} is translated, {{HexString|00}} is not translated.</pre>
776f726c64
|Hello,&amp;NewLine;world
}}</pre>


That should show up as: {{HexString
Produces:
|48656c6c6f
{{HexString
|Hello
|
}} is translated, and {{HexString|00}} is not translated.
48656c6c6f2c0a
</div>
776f726c64
|Hello,&NewLine;world
}}
</noinclude>
</noinclude>

Revision as of 17:21, 17 November 2023

{{{1}}}

This is used to show hex strings, with or without translations.

Usage

{{HexString|48656c6c6f|Hello}} is translated, {{HexString|00}} is not translated.

That shows up as:

48656c6c6f is translated, 00 is not translated.

Multiple lines:

You can break both the text and the tooltip into multiple lines. The text follows the usual MediaWiki conventions, but for the tooltip you need to explicitly break the text using the newline/line feed HTML character entity:

{{HexString
|
48656c6c6f2c0a
776f726c64
|Hello,&NewLine;world
}}

Produces: 48656c6c6f2c0a 776f726c64