Valve Developer Community:Alternative Languages: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
No edit summary
 
(122 intermediate revisions by 20 users not shown)
Line 1: Line 1:
{{otherlang2
{{LanguageBar}}
|ru = Valve Developer Community:Alternative Languages:ru
{{Subpage|[[Help:Contents]]}}
|zh-cn = Valve Developer Community:Alternative Languages:zh-cn
{{shortcut|VDC:LANG</br>VDC:AL}}
|es = Valve Developer Community:Alternative Languages:es
{{toc-right|width=20%}}
|it = Valve Developer Community:Alternative Languages:it
{{cleanup|anything unclear}}
}}
{{shortcut|VDC:AL}}


{{toc-right}}
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.
For information on how to add a new language, see {{↓|Language_Checklist|the language checklist}}.
== Translating your page ==
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.


=== Required naming scheme ===
== Translate Pages ==
It is important that page, category, and article titles contain only [[Wikipedia:ASCII|ASCII]] characters in the format of "English title:language abbreviation".  That is, keep a page's English title, and add a colon then the 2-letter [[Wikipedia:ISO 639-2|ISO 639-2 alpha-2]] language code for that language. For example [[Command Line Options:jp]].


The reason for this is partially due to a technical limitation of the software the VDC runs on. Pages, titles, and categories with non-English characters (such as "д", "к", or "ỹ") do not get backed up correctly in the database. It is not a problem to use non-English text in the pages themselves, but the page/article titles cannot contain these non-English, non [[Wikipedia:ASCII|ASCII]] characters.
=== In [[mw:help:namespace|namespaces]] (main), Category, Valve Developer Community and Help ===
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}}


Please note that English articles are usually the originals and there is no :en tag required on them.
For information about the requirements for titles on translated pages, see {{↓|Titles}}.


== Adding links ==
Here are the steps for translating a page in English into other languages:


[[Template:Otherlang2]] generates a row of flags in the top-right of the page. Use it like this:
# Copy the content of the English page. If there isn't a {{T|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 {{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}}.
## 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.


<pre><nowiki>
==== Changing links ====
{{otherlang2|
* {{Code|<nowiki>[[info_target]]</nowiki>}} → {{Code|<nowiki>{{</nowiki>[[Template:L|L]]<nowiki>|info_target|optional altname}}</nowiki>}}
es = Destination page:es|
* {{Code|<nowiki>[[Valve Developer Community:Tasks]]</nowiki>}} → {{Code|<nowiki>{{</nowiki>[[Template:LProject|LProject]]<nowiki>|Tasks|optional altname}}</nowiki>}}
de = Destination page:de|
* {{Code|<nowiki>[[Help:Contents]]</nowiki>}} → {{Code|<nowiki>{{</nowiki>[[Template:LHelp|LHelp]]<nowiki>|Contents|optional altname}}</nowiki>}}
jp = Destination page:jp
* {{Code|<nowiki>[[:Category:Level Design]]</nowiki>}} → {{Code|<nowiki>{{</nowiki>[[Template:LCategory|LCategory]]<nowiki>|Level Design|optional altname}}</nowiki>}}
}}
also Special: links using {{T|LSpecial}} which will take the translation available from the wiki interface. See its documentation for more info
</nowiki></pre>
* {{Code|<nowiki>[[Special:RandomRootpage]]</nowiki>}} → {{Code|<nowiki>{{LSpecial|RandomRootpage}}</nowiki>}}


The template '''must''' be the first text on the page! You should also do your best to update all the other translated pages, not just your own and English.
Following regex can be used in {{npp|1}} to automatize this process (make sure 'Match case' is not ticked). For regex usable right inside the editing toolbar see {{T|LAuto}}
<pre>
Find:
\[\[(?!#)(?:(?<c>:Category:(?<cl>.*?))|(?<a>Category:(?<al>.*?))|(?<h>:?Help:(?<hl>.*?))|(?<v>:?(?:Project|Valve[ _]Developer[ _]Community):(?<vl>.*?))|(?<s>:?Special:(?<sl>.*?))|(?<m>:?(?!File([ _]talk)?:|Image([ _]talk)?:|Media:|Template([ _]talk)?:|MediaWiki([ _]talk)?:|Talk:|Category[ _]talk:|Project[ _]talk:|Valve[ _]Developer[ _]Community[ _]talk:|Help[ _]talk:|User([ _]talk)?:|c:|commons:|Dictionary:|Google:|GoogleGroups:|IMDB:|M:|Meta:|Metawikipedia:|MW:|SdkBug:|SourceForge:|Steampowered:|W:|Wiki:|WikiBooks:|Wikipedia:|Wikiquote:|Wiktionary:|WP:)(?<ml>.*?)))\]\]


== Available languages ==
Replace:
Languages available can be found in the [[:Category:Languages|Languages category]].
(?{c}{{LCategory|$+{cl}}}:(?{a}{{ACategory|$+{al}}}:(?{h}{{LHelp|$+{hl}}}:(?{v}{{LProject|$+{vl}}}:(?{s}{{LSpecial|$+{sl}}}:(?{m}{{L|$+{ml}}}:))))))
</pre>


In order to have your language category listed in the primary Languages category, add the following to your language's category article:
=== {{LMainPage}} <!-- is this relevant info ? --> ===
<nowiki>[[Category:Languages]]</nowiki>
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}}.


== Final notes ==
=== Other namespaces ===
This guide is not definitive, but it makes things much simpler when everyone follows one method of using the templates, so everything in the wiki stays consistent throughout languages.
==== 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


[[Category:Languages]]
==== 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}}.
 
Usually 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 could 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}} [[mw: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 [[mw:Help:Magic_words|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:
 
* Translations for the following pages in the left sidebar:
** [[Main Page]]
** [[SDK Docs]]
** [[Help:Contents]]
** [[:Category:Source SDK FAQ]]
** [[:Category:Level Design FAQ]]
 
* Following template translations:
** [[:Category:Dictionary/Notices]]
** [[Template:Software/strings]]
** {{T|This is a}}
 
* Optionally
** you can add translations of other language names to {{tl2|language name}}
** A [[Valve Developer Community:Translation Dictionary|dictionary of common/technical terms and their translations]].
 
After these are met following can be done
* Adding icon of a flag representative of the language [[File:Flag-en.png|16px]] (most if not all already exist)
* Proper addition to {{tl|link=LanguageBar}}
* An addition to {{tl2|uselangflags}}
 
{{todo|More?}}
 
 
== Translation notices ==
Following notices should be put on pages using {{T|TranslationMark}} and not manually, as it can do it in single edit on all translated pages and will also cause the flag to be highlighted with orange. {{T||TranslationMark}} is used by clicking {{flag|Translate}} in the language bar and then {{flag|TranslationMark}} (instructions how to use TranslationMark are in its documentation)
 
=== {{T|Update translation}} notice  ===
To be used when English page has received an update, all translations of the page (or just the desired ones)
 
=== {{T|Finish translation}} notice ===
If translation was unfinished
 
=== {{T|Translate}} notice ===
This would be rarely used as if page is not translated at all it should be deleted/not created in the first place instead. May be needed if wanting to refrain from deleting in order to keep page history. (several translations of this page were blanked as they were completely outdated and marked with this notice)
<!-- possibly unneeded -->
 
=== {{T|Machine translation}} notice ===
It's discouraged to use AI translation and is only acceptable if the given user speaks the given language and English too and therefore can properly check and edit any mistakes. If AI translation was done without proper corrections it should be noted with this notice and should stay until proper correction are made. If the notice stays for too long the page might get deleted.
 
== Abandoned translations ==
Translations with very few pages, not meeting most of the language checklist and not edited by user speaking such language in a long time.
<categorytree>Abandoned translation</categorytree>
 
== 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.
 
Feel free to post questions in the discussion section if anything is unclear.
 
== See also ==
* [[:Category:To be translated]]
* [[:Category:Translation]]
* {{tl|[[template:Translate|Translate]]}}
* {{T|TranslationMark}}
* {{T|LanguageBar}}
* {{T|Language}}
* {{T|L}}
 
 
[[Category:Languages]]  
[[Category:Wiki]]
[[Category:Wiki]]

Latest revision as of 05:42, 26 July 2025

English (en)Deutsch (de)Esperanto (eo)Español (es)Français (fr)Hrvatski (hr)Italiano (it)Português do Brasil (pt-br)Русский (ru)中文 (zh)Translate (Translate)
Shortcut
VDC:LANG
VDC:AL
Broom icon.png
This article or section needs to be cleaned up to conform to a higher standard of quality because:
anything unclear
For help, see the VDC Editing Help and Wikipedia cleanup process. Also, remember to check for any notes left by the tagger at this article's talk page.

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

In namespaces (main), Category, Valve Developer Community and Help

All the translated pages use {{LanguageBar}} to link pages in another language and stand alone.

Note.pngNote:Some pages still have old {{lang}} or {{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 ↓.

Here are the steps for translating a page in English into other languages:

  1. Copy the content of the English page. If there isn't a {{LanguageBar}}, then you should add one at the start of the page.
  2. Follow the requirement of titles to entry the creating page of the corresponding language page.
  3. Start translating. Conventions:
    1. 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.
    2. 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}}.
    3. 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.
  4. After finishing translating, save your contributions.

Changing links

  • [[info_target]]{{L|info_target|optional altname}}
  • [[Valve Developer Community:Tasks]]{{LProject|Tasks|optional altname}}
  • [[Help:Contents]]{{LHelp|Contents|optional altname}}
  • [[:Category:Level Design]]{{LCategory|Level Design|optional altname}}

also Special: links using {{LSpecial}} which will take the translation available from the wiki interface. See its documentation for more info

  • [[Special:RandomRootpage]]{{LSpecial|RandomRootpage}}

Following regex can be used in Notepad++ to automatize this process (make sure 'Match case' is not ticked). For regex usable right inside the editing toolbar see {{LAuto}}

Find:
\[\[(?!#)(?:(?<c>:Category:(?<cl>.*?))|(?<a>Category:(?<al>.*?))|(?<h>:?Help:(?<hl>.*?))|(?<v>:?(?:Project|Valve[ _]Developer[ _]Community):(?<vl>.*?))|(?<s>:?Special:(?<sl>.*?))|(?<m>:?(?!File([ _]talk)?:|Image([ _]talk)?:|Media:|Template([ _]talk)?:|MediaWiki([ _]talk)?:|Talk:|Category[ _]talk:|Project[ _]talk:|Valve[ _]Developer[ _]Community[ _]talk:|Help[ _]talk:|User([ _]talk)?:|c:|commons:|Dictionary:|Google:|GoogleGroups:|IMDB:|M:|Meta:|Metawikipedia:|MW:|SdkBug:|SourceForge:|Steampowered:|W:|Wiki:|WikiBooks:|Wikipedia:|Wikiquote:|Wiktionary:|WP:)(?<ml>.*?)))\]\]

Replace:
(?{c}{{LCategory|$+{cl}}}:(?{a}{{ACategory|$+{al}}}:(?{h}{{LHelp|$+{hl}}}:(?{v}{{LProject|$+{vl}}}:(?{s}{{LSpecial|$+{sl}}}:(?{m}{{L|$+{ml}}}:))))))

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}}.

Usually 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 could be whatever the user decides to set up there.


Todo: more info

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.
Icon-Important.pngImportant:Do not add language name prefix for English pages! English pages do not need their language name to be the prefixs of their names.
Icon-Important.pngImportant: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.

  • {{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:

After these are met following can be done

  • Adding icon of a flag representative of the language Flag-en.png (most if not all already exist)
  • Proper addition to {{LanguageBar}}
  • An addition to {{uselangflags}}
Todo: More?


Translation notices

Following notices should be put on pages using {{TranslationMark}} and not manually, as it can do it in single edit on all translated pages and will also cause the flag to be highlighted with orange. {{TranslationMark}} is used by clicking Translate (Translate) in the language bar and then Translationmark (TranslationMark) (instructions how to use TranslationMark are in its documentation)

{{Update translation}} notice

To be used when English page has received an update, all translations of the page (or just the desired ones)

{{Finish translation}} notice

If translation was unfinished

{{Translate}} notice

This would be rarely used as if page is not translated at all it should be deleted/not created in the first place instead. May be needed if wanting to refrain from deleting in order to keep page history. (several translations of this page were blanked as they were completely outdated and marked with this notice)

{{Machine translation}} notice

It's discouraged to use AI translation and is only acceptable if the given user speaks the given language and English too and therefore can properly check and edit any mistakes. If AI translation was done without proper corrections it should be noted with this notice and should stay until proper correction are made. If the notice stays for too long the page might get deleted.

Abandoned translations

Translations with very few pages, not meeting most of the language checklist and not edited by user speaking such language in a long time.

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.

Feel free to post questions in the discussion section if anything is unclear.

See also