Template:LanguageBar/doc: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(instructions for updating pages)
(→‎See Also: Maybe?)
 
(10 intermediate revisions by 2 users not shown)
Line 1: Line 1:
This template create a language bar like {{T|MultiPage}} that's shown on the upper right corner of the page. The language of a page is determined by language prefixes (like {{Code|Zh/}}, {{Code|Ru/}}, etc) instead of interface language. {{Note|English is the default language and English pages don't need language prefix.}}
{{Doc/subpage}}
This template creates a language bar that's shown on the upper right corner of the page. The language of a page is determined by language prefixes (like {{Code|Zh/}}, {{Code|Ru/}}, etc) instead of interface language. {{Note|English is the default language and English pages don't need language prefix.}}
{{important|LanguageBar should be used only on main, Category, Help and Valve Developer Community namespaces. Other namespaces don't use prefixes (see also {{T|language}})}}


== Update to {{T|LanguageBar}} ==
There are many pages using {{T|MultiPage}}. {{T|MultiPage}} increases the complexity of editing pages. Also, there are some pages using {{T|Lang}}. <br>Here are the ways to update these pages to use {{T|LanguageBar}}.
=== {{T|MultiPage}} ===
==== For English Pages ====
{{T|MultiPage}} creates lots of language subpages. These includes ''English''. So if you don't have admin rights, you can't move the English subpage to its original page (because the original page has already existed so you can't move the subpage, and you can't delete the original page). These actions can only be performed by [[Valve Developer Community:Moderators|Moderators]] or Site Administrators (Valve employees). You can contract the [[Special:ListUsers/mod|moderators]] for help and check out [[Special:RecentChanges]] to look for recent active moderator.


Method:
This template also applies [[:Category:Translation]]. (see the category for more details)
# Click the move button and move the subpage to the correct page name (you may need to delete the original page first). The page name needs to delete the language suffix and the slash ({{Code|/}}). For example: {{Code|Example Page/en}} → {{Code|Example Page}}. This also applies to non-main namespace pages. If there is a talk page, move it too. {{Note|Before deleting original pages, you should copy the categories on the original page first in order to transfer them. }}
# After moving, click the edit button.
# Change the template {{T|Language subpage}} or {{T|Langsp}} (short name) to {{T|LanguageBar}}.
# Add the categories from the orignial page.
# Save your changes. You can add an abstract for your edit.


==== For Other Language Pages ====
 
# Click the move button and move the subpage to the correct page name. The format is: {{Code|<language name>/<page name>}}, which the language name must be the abbreviation of the language and the page name is the original English page name. For example, a page named {{Code|ExamplePage/zh}} (Simplified Chinese page) needs to be moved to {{Code|Zh/ExamplePage}}. Its talk page also needs movement if there is.<br>If there is a namespace (the page doesn't belong to main namespace), then the format applies: {{Code|<namespace>:<language name>/<page name>}}, such as [[Valve Developer Community:Zh/Alternative Languages]].
== Parameters and Examples ==
# After moving, click the edit button.
{| class="standard-table" | style="width: 100%"
# Change the template {{T|Language subpage}} or {{T|Langsp}} (short name) to {{T|LanguageBar}}.
|-
# The links on the page within this website need using template {{T|L}}. For example, {{Code|<nowiki>[[ExampleLink]]</nowiki>}} will become {{Code|<nowiki>{{L|ExampleLink}}</nowiki>}}. If the link has alternative name, then follow this format: {{Code|<nowiki>{{A|<link name>|<alternative name>}}</nowiki>}}.
! Parameter !! Description !! Example
# The categories on the page also need to use {{T|ACategory}}. The method is the same as above. For example, {{Code|<nowiki>[[Category:Entities]]</nowiki>}} will become {{Code|<nowiki>{{ACategory|Entities}}</nowiki>}}. <br>If the category is a link instead of that adding the page to itself, use {{T|LCategory}} (i.e. {{Code|<nowiki>[[:Category:Entities]]</nowiki>}} {{Code|<nowiki>{{LCategory|Entities}}</nowiki>}}).
|-
# Save your changes. You can add an abstract for your edit.
|align="center"| No Parameters || Check for various language translations for this page and create flags for them. || {{CodeBlock|<nowiki>{{LanguageBar}}</nowiki>}}
You can check for other pages that have already updated to {{T|LanguageBar}} to understand better.
|-
|align="center"| {{Code|preset=2|{{param|title}}}} || Allows you to change the title of a page. || {{CodeBlock|<nowiki>{{LanguageBar|title=Example Title}}</nowiki>}}
|-
|align="center"| {{Code|preset=2|{{param|_}}}} || If title param is not used and not in Category namespace then SUBPAGENAME is automatically set as title which doesn't have underscores. Setting this parameter keeps the underscores. || {{CodeBlock|<nowiki>{{LanguageBar|_=1}}</nowiki>}}
|-
|}
 
 
{{Note|If you encounter {{T|lang}}, {{T|langsp}}, {{T|language subpage}} on pages rewrite them to use LanguageBar. Internally they were edited to use LanguageBar only remaining step is just rewriting them on the used pages. See categories [[:Category:TODO rewrite lang to LanguageBar]] and [[:Category:TODO rewrite langsp to LanguageBar]] }}
 
 
== See Also ==
* [[Project:Alternative Languages]]
* [[:Category:Translation]]
* [[:Category:LanguageBar translation mark settings]]
* {{T|L}}
* {{T|Language}}

Latest revision as of 10:20, 6 April 2025

Edit-copy.png
This is a documentation subpage for Template:LanguageBar.
Don't forget to purge the contents of the base page upon creating or editing this subpage.

This template creates a language bar that's shown on the upper right corner of the page. The language of a page is determined by language prefixes (like Zh/, Ru/, etc) instead of interface language.

Note.pngNote:English is the default language and English pages don't need language prefix.
Icon-Important.pngImportant:LanguageBar should be used only on main, Category, Help and Valve Developer Community namespaces. Other namespaces don't use prefixes (see also {{language}})


This template also applies Category:Translation. (see the category for more details)


Parameters and Examples

Parameter Description Example
No Parameters Check for various language translations for this page and create flags for them.
{{LanguageBar}}
{{{title}}} Allows you to change the title of a page.
{{LanguageBar|title=Example Title}}
{{{_}}} If title param is not used and not in Category namespace then SUBPAGENAME is automatically set as title which doesn't have underscores. Setting this parameter keeps the underscores.
{{LanguageBar|_=1}}


Note.pngNote:If you encounter {{lang}}, {{langsp}}, {{language subpage}} on pages rewrite them to use LanguageBar. Internally they were edited to use LanguageBar only remaining step is just rewriting them on the used pages. See categories Category:TODO rewrite lang to LanguageBar and Category:TODO rewrite langsp to LanguageBar


See Also