Valve Developer Community:Alternative Languages: Difference between revisions
No edit summary |
(still needs lot of cleanup as this feels chaotic) |
||
Line 3: | Line 3: | ||
{{shortcut|VDC:AL}} | {{shortcut|VDC:AL}} | ||
{{toc-right}} | {{toc-right}} | ||
{{ | {{cleanup|feels chaotic}} | ||
This page is a reference on having alternative languages here on the Valve Developer Community. Translating the page you want should be simple if you are fluent in a language. This article does not go into depth in translation of articles. | This page is a reference on having alternative languages here on the Valve Developer Community. Translating the page you want should be simple if you are fluent in a language. This article does not go into depth in translation of articles. | ||
For information on how to add a new language, see [[ | For information on how to add a new language, see [[#Language_Checklist|the language checklist ↓]]. | ||
== Translate Pages == | == Translate Pages == | ||
For information about the requirements for titles on translated pages, see [[#Titles]]. | === Main, Category, Valve Developer Community, Help [[w:namespace|namespaces]] === | ||
All the translated pages use {{T|LanguageBar}} to link pages in another language and stand alone. | |||
{{note|Some pages still have old {{T|lang}} or {{T|langsp}} but those templates were edited to place LanguageBar and are currently just waiting to be rewritten to LanguageBar}} | |||
For information about the requirements for titles on translated pages, see [[#Titles|Titles ↓]]. | |||
Here are the steps for translating a page in English into other languages: | Here are the steps for translating a page in English into other languages: | ||
Line 19: | Line 21: | ||
# Follow the requirement of titles to entry the creating page of the corresponding language page. | # Follow the requirement of titles to entry the creating page of the corresponding language page. | ||
# Start translating. Conventions: | # Start translating. Conventions: | ||
## The links on the translated page within this website need to use 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>{{ | ## The links on the translated page within this website need to use 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>{{L|<link name>|<alternative name>}}</nowiki>}}. So you can use altname for translating links. {{Code|<nowiki>{{L|Cubemaps|反射贴图}}</nowiki>}} is an example, which is used in Chinese. External links don't need. | ||
## 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>}}). These 2 templates also support altname like that in {{T|L}}. | ## 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>}}). These 2 templates also support altname like that in {{T|L}}. | ||
## Templates itself remain unchanged because the language and text inherent in the template are automatically translated. But you need to translate the value of the parameter used in the template. For example, the notes written by {{T|Note}} won't be translated and you should translate them. | ## Templates itself remain unchanged because the language and text inherent in the template are automatically translated. But you need to translate the value of the parameter used in the template. For example, the notes written by {{T|Note}} won't be translated and you should translate them. | ||
# After finishing translating, save your contributions. | # After finishing translating, save your contributions. | ||
== | === [[Main Page]] <!-- is this relevant info ? --> === | ||
The translation on the main page is handled differently using interface language to determine what language to show up in and uses its own unique templates made specifically for it. To translate it edit page {{Code|<language shortcut>/Main Page}}. To make a link to Main Page there is {{T|LMainPage}}. | |||
=== | === Other namespaces === | ||
==== Relevant templates ==== | |||
Relevant language templates (see their doc pages for more info): | |||
* {{T|language}} - returns language shortcut | |||
* {{tl2|Uselangflags}} - makes language bar at right side of the page that is changing user's interface language instead of having links to other pages | |||
=== | ==== Template namespace ==== | ||
Most templates are set up to be universal and change their language based on where they are being transcluded. This is done most of the time using {{T|language}}. | |||
Generally there is a string subpage created for translations of templates | |||
* [[Template:Delete/strings|example of string subpage]] | |||
Different method used for notices [[:Category:Dictionary/Notices]] | |||
' | ==== The rest ==== | ||
It would be very rare to need translations in other namespaces and generally it would be done based on user's interface language or in case of User namespaces it would be whatever the user decides to set up there. | |||
* [[:File:Wireframe_gradient.jpg|example of translated page in File namespace that changes based on interface language]] | |||
{{todo|more info}} | |||
== Titles == | |||
== | It is important that all page names contain only [[Wikipedia:ASCII|ASCII]] characters; otherwise, the pages aren't handled correctly by the database. | ||
[[ | |||
:{{tl|LanguageBar}} is a template that will create a series of flags that can switch to the page of the corresponding language. It has adopted the new translation standard. <br>Normally, the titles of most of the translated pages follow this format: {{Code|<language name>/<Page name>}}, which the language name must be abbreviation, and the page name is the same as the English page. An example is [[Zh/Main Page]], which is the translations of Main Page in Chinese. <br>If the page does not belong to {{Code|main}} [https://www.mediawiki.org/wiki/Help:Namespaces namespace] (such as {{Code|Category}}), then the format is similar to those pages which are {{Code|main}} namespaces: {{Code|<namespace>:<lang name>/<page name>}}, such as [[Valve Developer Community:Zh/Alternative Languages]]. <br>Actually, the language name prefix determines the language of each page. Templates will determine what language they should use according to the prefix. | |||
{{Important|Do not add language name prefix for English pages! English pages do not need their language name to be the prefixs of their names.}} | |||
{{Important|Do not use this method on templates. Templates do not need extra pages for translating. Instead, translations for templates are combined into the template page itself or some templates use a special string subpage for translating the template.}} | |||
== | === Change the Title === | ||
There are a number of ways to change how a page title will appear to readers without affecting the URL. | |||
* {{tl|LanguageBar}}: To translate the title, specify the value of {{param|title}} to what you translated. | |||
* {{tl|This is a}} which are used on entity articles, material shader articles, console command/variable articles, etc. and will set a title to specified {{param|name}} | |||
*<code><nowiki>{{DISPLAYTITLE:</nowiki>''title''<nowiki>}}</nowiki></code> - This is not a template, rather a ''magic word'' to change the page title to whatever you want. All the templates listed use this internally. This should only be used in rare scenarios where all other methods are not viable | |||
==Language Checklist== | == Language Checklist == | ||
Every language on the wiki should have: | Every language on the wiki should have: | ||
*An icon of a flag representative of the language [[File:Flag-en.png|16px]] | *An icon of a flag representative of the language [[File:Flag-en.png|16px]] | ||
:{{tip|Most of the flags currently on the wiki seem to come from [https://web.archive.org/web/20051101010616/http://www.famfamfam.com/lab/icons/flags/ this site]}} | :{{tip|Most of the flags currently on the wiki seem to come from [https://web.archive.org/web/20051101010616/http://www.famfamfam.com/lab/icons/flags/ this site]}} | ||
*Proper addition to {{tl|link=LanguageBar}} | *Proper addition to {{tl|link=LanguageBar}} | ||
*A [[:Category:Languages|category]] page translated using {{tl|LanguageBar | *A [[:Category:Languages|category]] page translated using {{tl|LanguageBar}} | ||
{{important|'''DO NOT''' create a separate template for the flag such as [[Template:en]], these are leftovers from {{tl|Lang}}}} | {{important|'''DO NOT''' create a separate template for the flag such as [[Template:en]], these are leftovers from {{tl|Lang}}}} | ||
*Translations for all the pages in the left sidebar: | *Translations for all the pages in the left sidebar: | ||
Line 92: | Line 85: | ||
{{todo|More?}} | {{todo|More?}} | ||
==Final Notes== | == Final Notes == | ||
This guide is not definitive, but it makes things much simpler when everyone follows one method of translating content, so everything in the wiki stays consistent throughout languages. | This guide is not definitive, but it makes things much simpler when everyone follows one method of translating content, so everything in the wiki stays consistent throughout languages. | ||
Line 98: | Line 91: | ||
If a page has received an important update, translations of the page should be marked with {{tl|Updatetranslation}}. | If a page has received an important update, translations of the page should be marked with {{tl|Updatetranslation}}. | ||
==See also== | |||
== Obsolete methods == | |||
{{Note|Do not use}} | |||
{{Expand| | |||
== Titles == | |||
=== Deprecated Method === | |||
;For pages using {{tl2|MultiPage}} | |||
:The title for a translated page (called "language subpages") should be the English name followed by a forward slash (/) and the abbreviation (usually [[Wikipedia:List_of_ISO_639-1_codes|ISO_639-1]]) for the language. ''This includes English''. The root page should only have {{tl|MultiPage}} and categories. An correct title is [[Half-Life 2/en]]. Language subpages should have the {{tl|Language subpage}} template at the top followed by the body text for the article. Remember, categories go on the root page only, ''not'' the subpages. | |||
;For pages using {{tl2|Lang}} | |||
:The name of a translated page should put the English name first, followed by a colon (<code>:</code>), followed by the abbreviation described in {{tl|Lang}}'s documentation (which is ''not'' always the language's [[Wikipedia:ISO_639-1|ISO_639-1]] and [[Wikipedia:ISO_639-2|ISO_639-2]] abbreviation). An example of a proper page name is [[Help:Contents:ru]]. It is not a problem to use non-English text in the pages themselves, but the name of the page cannot contain any non-English, non-ASCII characters. | |||
English pages are usually the originals (with the exception of MultiPage having the /en page, but the main page itself always have the original English language), and there is no :en tag on them. | |||
== Changing the title == | |||
*{{tl|MultiPage}}: '''Deprecated.''' Do not use this if possible! | |||
*{{tl|Lang}}: '''Deprecated.''' Only should be used if other language templates doesn't work properly. Do not use this if possible! | |||
== Templates == | |||
=== Using {{tl2|Autolang}}, {{tl2|String}} === | |||
:{{tl|Autolang}} will change the contents according to the page language. There are some strings subpages in some templates (such as {{tl|Software page}}), and the translations are in them. All the strings subpages use this template internally. | |||
See [[Template:Autolang|the documentation of the template]] for its usage. Alternatively, check the source code of pages that have already used this template to learn how to use it. | |||
{{T|String}} is the alternative version of {{T|Autolang}}. It is specially designed for those templates that use strings for translating. | |||
=== Using {{tl|Lang}} (deprecated) === | |||
:{{Deprecated|Only use this sparingly if other translation template isn't working on certain templates at the moment, eventually there will be somebody able to properly fix it and properly use the {{tl|Autolang}} template, to the point that {{tl|Lang}} isn't needed anymore.}} | |||
[[Help:Templates|Templates]] containing text visible on content pages should have that text translated into the translated page's language before the page is considered finished. Any documentation on the template should also be translated. | |||
}} | |||
== See also == | |||
* [[:Category:To_be_translated]] | * [[:Category:To_be_translated]] | ||
* [[:Category:Translation]] | * [[:Category:Translation]] | ||
*{{tl|[[template:Translate|Translate]]}} | * {{tl|[[template:Translate|Translate]]}} | ||
[[Category:Languages]] | [[Category:Languages]] | ||
[[Category:Wiki]] | [[Category:Wiki]] |
Revision as of 19:26, 9 August 2024

This page is a reference on having alternative languages here on the Valve Developer Community. Translating the page you want should be simple if you are fluent in a language. This article does not go into depth in translation of articles.
For information on how to add a new language, see the language checklist ↓.
Translate Pages
Main, Category, Valve Developer Community, Help namespaces
All the translated pages use {{LanguageBar}} to link pages in another language and stand alone.

For information about the requirements for titles on translated pages, see Titles ↓.
Here are the steps for translating a page in English into other languages:
- Copy the content of the English page. If there isn't a {{LanguageBar}}, then you should add one at the start of the page.
- Follow the requirement of titles to entry the creating page of the corresponding language page.
- Start translating. Conventions:
- The links on the translated page within this website need to use template {{L}}. For example, [[ExampleLink]] will become {{L|ExampleLink}}. If the link has alternative name, then follow this format: {{L|<link name>|<alternative name>}}. So you can use altname for translating links. {{L|Cubemaps|反射贴图}} is an example, which is used in Chinese. External links don't need.
- The categories on the page also need to use {{ACategory}}. The method is the same as above. For example, [[Category:Entities]] will become {{ACategory|Entities}}.
If the category is a link instead of that adding the page to itself, use {{LCategory}} (i.e. [[:Category:Entities]] → {{LCategory|Entities}}). These 2 templates also support altname like that in {{L}}. - Templates itself remain unchanged because the language and text inherent in the template are automatically translated. But you need to translate the value of the parameter used in the template. For example, the notes written by {{Note}} won't be translated and you should translate them.
- After finishing translating, save your contributions.
Main Page
The translation on the main page is handled differently using interface language to determine what language to show up in and uses its own unique templates made specifically for it. To translate it edit page <language shortcut>/Main Page. To make a link to Main Page there is {{LMainPage}}.
Other namespaces
Relevant templates
Relevant language templates (see their doc pages for more info):
- {{language}} - returns language shortcut
- {{Uselangflags}} - makes language bar at right side of the page that is changing user's interface language instead of having links to other pages
Template namespace
Most templates are set up to be universal and change their language based on where they are being transcluded. This is done most of the time using {{language}}.
Generally there is a string subpage created for translations of templates
Different method used for notices Category:Dictionary/Notices
The rest
It would be very rare to need translations in other namespaces and generally it would be done based on user's interface language or in case of User namespaces it would be whatever the user decides to set up there.
Titles
It is important that all page names contain only ASCII characters; otherwise, the pages aren't handled correctly by the database.
{{LanguageBar}}
is a template that will create a series of flags that can switch to the page of the corresponding language. It has adopted the new translation standard.
Normally, the titles of most of the translated pages follow this format: <language name>/<Page name>, which the language name must be abbreviation, and the page name is the same as the English page. An example is Zh/Main Page, which is the translations of Main Page in Chinese.
If the page does not belong to main namespace (such as Category), then the format is similar to those pages which are main namespaces: <namespace>:<lang name>/<page name>, such as Valve Developer Community:Zh/Alternative Languages.
Actually, the language name prefix determines the language of each page. Templates will determine what language they should use according to the prefix.


Change the Title
There are a number of ways to change how a page title will appear to readers without affecting the URL.
{{LanguageBar}}
: To translate the title, specify the value of {{{title}}} to what you translated.{{This is a}}
which are used on entity articles, material shader articles, console command/variable articles, etc. and will set a title to specified {{{name}}}{{DISPLAYTITLE:title}}
- This is not a template, rather a magic word to change the page title to whatever you want. All the templates listed use this internally. This should only be used in rare scenarios where all other methods are not viable
Language Checklist
Every language on the wiki should have:
Tip:Most of the flags currently on the wiki seem to come from this site
- Proper addition to
{{LanguageBar}}
- A category page translated using
{{LanguageBar}}

{{Lang}}
- Translations for all the pages in the left sidebar:
- An addition to {{uselangflags}}}}
- Translations for the {{dictionary}}
- A dictionary of common/technical terms and their translations.
- Translations of some commonly used templates
- Optionally, you can add translations of other language names to {{language name}}
Final Notes
This guide is not definitive, but it makes things much simpler when everyone follows one method of translating content, so everything in the wiki stays consistent throughout languages.
Please fully translate pages. A page partially in another language is simply not helpful for readers who only know one language.
If a page has received an important update, translations of the page should be marked with {{Updatetranslation}}
.
Obsolete methods

TitlesDeprecated Method
English pages are usually the originals (with the exception of MultiPage having the /en page, but the main page itself always have the original English language), and there is no :en tag on them. Changing the title
TemplatesUsing {{Autolang}}, {{String}}
See the documentation of the template for its usage. Alternatively, check the source code of pages that have already used this template to learn how to use it. {{String}} is the alternative version of {{Autolang}}. It is specially designed for those templates that use strings for translating. Using
|