Template:Strings subpage: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(added int=1 for {{Autolang}})
(added a purge button)
Line 45: Line 45:
<div style="opacity:.05; user-select:none; pointer-events:none; position:absolute; {{text-dir|ltr=right|rtl=left}}:-32px">[[File:icon-settings.png|64px|link=]]</div>
<div style="opacity:.05; user-select:none; pointer-events:none; position:absolute; {{text-dir|ltr=right|rtl=left}}:-32px">[[File:icon-settings.png|64px|link=]]</div>
<div style="font-size:16px; color:white">{{Strings subpage/strings|sos}}</div>
<div style="font-size:16px; color:white">{{Strings subpage/strings|sos}}</div>
<div>{{Autolang|int=1
<div style="display: flex; flex-direction: row; align-items: center">{{Autolang|int=1
| It contains various translatable and untranslatable strings that are used in the template or anywhere else.
| It contains various translatable and untranslatable strings that are used in the template or anywhere else.
| eo = Ĝi enhavas diversajn tradukeblajn literarojn uzitaj en ĉi ŝablono aŭ ajn ie.
| eo = Ĝi enhavas diversajn tradukeblajn literarojn uzitaj en ĉi ŝablono aŭ ajn ie.
Line 54: Line 54:
| ru = Содержит различные переводимые и непереводимые строки, которые используются в шаблоне или где-либо ещё.
| ru = Содержит различные переводимые и непереводимые строки, которые используются в шаблоне или где-либо ещё.
| vi = Nó chứa các chuỗi có thể dịch và không thể dịch khác nhau được sử dụng trong mẫu hoặc bất kỳ nơi nào khác.
| vi = Nó chứa các chuỗi có thể dịch và không thể dịch khác nhau được sử dụng trong mẫu hoặc bất kỳ nơi nào khác.
| zh = 它包含在模板或其他任何地方使用的各种可翻译字符串。}}
| zh = 它包含在模板或其他任何地方使用的各种可翻译字符串。}}<!--
</div><div><!--
-- purge button -- --><div class="plainlinks" style="align-items:center; justify-content:center; margin-left:auto"><div>[{{fullurl:{{NAMESPACE}}:{{ROOTPAGENAME}}|action=purge}} <font style="display:inline-flex; background:#36C; border-radius:3px; color:#FFF; font-weight:bold; white-space:nowrap; position:relative; z-index:10; padding:6px 10px">{{Language subpage/strings|Purge}}</font>]</div></div><!--
--> </div><!--
--><div><!--
--> <span style="background-color: rgb(255 255 255 / 10%); border-radius:.2em; display:inline-flex; position:relative; padding:.1em .5em; margin-top:.2em">[[Template:Strings subpage|<span style="width:100%; height:100%; position:absolute; top:0; left:0"></span>]]<span style="user-select:none; margin-right:.2em; margin-top:-1px">[[File:icon-gnome-document-open.png|14px|link=]]</span><span style="color:#CCCAC7">{{Dictionary/common|Doc}}</span></div>
--> <span style="background-color: rgb(255 255 255 / 10%); border-radius:.2em; display:inline-flex; position:relative; padding:.1em .5em; margin-top:.2em">[[Template:Strings subpage|<span style="width:100%; height:100%; position:absolute; top:0; left:0"></span>]]<span style="user-select:none; margin-right:.2em; margin-top:-1px">[[File:icon-gnome-document-open.png|14px|link=]]</span><span style="color:#CCCAC7">{{Dictionary/common|Doc}}</span></div>
</div><!--
</div><!--

Revision as of 07:13, 16 July 2024

English (en)Deutsch (de)Esperanto (eo)Español (es)Français (fr)Suomi (fi)Hrvatski (hr)Magyar (hu)Italiano (it)日本語 (ja)한국어 (ko)Nederlands (nl)Polski (pl)Português (pt)Português do Brasil (pt-br)Русский (ru)Slovenčina (sk)Svenska (sv)Türkçe (tr)Українська (uk)Tiếng Việt (vi)中文 (zh)中文(臺灣) (zh-tw)
Curly brackets white.pngTemplate Documentation [view] [edit]
Icon-translate.png Available doc translations
View
Page history
Icon-translate.png
This template uses a strings subpage
Please follow the format on this subpage(s) to add translations.

A panel indicating that the page it is on contains strings that are used in lieu of complicated #switch parser (or formerly, {{autolang}}(s)) on the base page.

Looking for creating a Strings subpage?

If you are looking for creating a strings subpage, just create a "/strings" subpage, then paste the following code:

See the code
{{Strings subpage<!-- Don't forget to update once you add new translation to a strings. --> |number = 1 | en = 1 | de = 1 | eo = 1 | es = 1 | fi = 1 | fr = 1 | ru = 1 | vi = 1 | zh = 1 }} * {{{{PAGENAME}}|Example}} <includeonly><onlyinclude>{{#switch:{{{1}}}<!-- Remember to keep this clean by sorting A-Z, and copy paste the tab space instead of pressing "SPACE" repeatedly. --> | Example = {{#switch: {{language}} | #default = Example | de = Beispiel | eo = Ekzemplo | es = Ejemplo | fi = Esimerkki | fr = Exemple | ru = Пример | vi = Ví dụ | zh = 示例 }} }}</onlyinclude></includeonly>
Note.pngNote:(Not required), but when you add a new language, it is recommended to sort the language codes from A to Z.

Parameters and Examples

Parameter Description Example
No Parameters Places the template.
{{Strings subpage}}
{{{number}}} Number of strings.
| number = 6
{{{<language code>}}} Number of translated strings into the specified language.
| en = 6
| eo = 3
| he = 2
When creating a new strings subpage, click on the three dots in the top right of the documentation box and click "Strings". This will create a new strings subpage with the proper formatting already applied. Of course, this is not required and you can just create a new one from scratch if you so wish.