Template:Sandbox/Aurelain/Translation: Difference between revisions

From Heroes of Might and Magic: Olden Era Official Wiki
No edit summary
No edit summary
Line 70: Line 70:
7. Getting a rich text
7. Getting a rich text


{{Color|yellow|Input:}} <code><nowiki>{{Sandbox/Aurelain/Translation|demon_hero_6|en}}</nowiki></code>
{{Color|yellow|Input:}} <code><nowiki>{{Sandbox/Aurelain/Translation|demon_hero_6|en|field=description}}</nowiki></code>


{{Color|lime|Output:}} {{Sandbox/Aurelain/Translation|demon_hero_6|en}}
{{Color|lime|Output:}} {{Sandbox/Aurelain/Translation|demon_hero_6|en|field=description}}


</noinclude>
</noinclude>

Revision as of 11:44, 6 August 2026


Retrieves the name value from the Translation Cargo table for a target id, in the desired language.

This is very similar to the Label template, but is more generic, allowing you to pull any id from the Translation table, not just those prefixed with wiki_.

Usage

1. English:

Input: {{Sandbox/Aurelain/Translation|nature|en}}

Output: Grove


2. Japanese:

Input: {{Sandbox/Aurelain/Translation|nature|ja}}

Output: グローヴ


3. Missing id:

Input: {{Sandbox/Aurelain/Translation|foo|en}}

Output: foo💬


4. Surrounded by text, to prove this template doesn't add unexpected whitespace:

Input: Hello{{Sandbox/Aurelain/Translation|nature|en}}World

Output: HelloGroveWorld


5. With type, when collisions are a concern:

Input: {{Sandbox/Aurelain/Translation|luck|en|type=unit_stat}}

Output: Luck


6. With field, to get the description:

Input: {{Sandbox/Aurelain/Translation|nature|en|field=description}}

Output: Each of the Murmurwoods’ elemental spirits is a unique powerhouse, supported by equally strong — and expensive — rangers and druids.


7. Getting a rich text

Input: {{Sandbox/Aurelain/Translation|demon_hero_6|en|field=description}}

Output: She desired the best for her children, but they rejected her for her crimes. Thus, she is now the Hive’s Matron.