Killing Floor Wiki:Adding translations

From Killing Floor Wiki
Jump to: navigation, search

There are two namespaces that need translations: the main (article) namespace and the template namespace.

Mainspace[edit]

In general, you should copy the contents of the English version of the article and paste them into a new article.

Some articles contain template calls, which look like the construction {{MyName}} or {{MyName|...}}, and should contain the text |lang=xy, where xy is the ISO 639-1 code for your language. For example, {{Specimen health chart|1500|375}} should become {{Specimen health chart|1500|375|lang=xy}}. If the template still contains English after translating the existing parameters and adding lang, then the template itself must be translated; see #Template namespace.

Suppose the name of the English article is EnglishName, and the translation of the name is ForeignName. If an article already exists at ForeignName, then paste the contents into EnglishName/xy. If not, then paste the contents into ForeignName and create the page EnglishName/xy with the content

#REDIRECT ForeignName

If a {{Language bar}} exists at the bottom of your page, then change it to {{Language bar|EnglishName|xy}}. If it doesn't, then add one.

Template namespace[edit]

Templates are called with the construction {{TemplateName}} (no parameters) or {{TemplateName|...}} (one or more parameters). You can view the template itself at Template:TemplateName.

In general, templates should not be copypasted (for maintenance's sake, because they generally consist mostly of markup).

To add translations, two other two templates are used: {{LS}} and {{LL}}.

Adding translations[edit]

Predefined translations[edit]

{{LSG}} and {{LLG}} use a dictionary of frequently used terms; currently, they are perks, specimens, equipment, and maps. Terms and phrases that are only translated once throughout the entire wiki should not be added to LSG/LLG.

Consider the following template and code:

Farm • Offices
{| class="wikitable"
|-
| Farm{{•}} Offices
|}

To use the predefined translations of "Farm" and "Offices", use the following example:

{| class="wikitable"
|-
| {{LSG|{{{lang}}}|Farm}}{{•}} {{LSG|{{{lang}}}|Offices}}
|}

When {{TEMPLATE NAME|lang=fr}} is used, the output is:

Ferme • Bureaux

If LLG is used instead of LSG, then the text would be the same but would be linked:

{| class="wikitable"
|-
| {{LLG|{{{lang}}}|Farm}}{{•}} {{LLG|{{{lang}}}|Offices}}
|}
Ferme • Bureaux

Where LS is already used[edit]

Consider the following template and code:

Name: {{{name}}}
{| class="wikitable"
|-
| {{LS|{{{lang}}}
    |en=Name}}:
| {{{name}}}
|}

To translate "Name" to another language, use the following example:

{| class="wikitable"
|-
| {{LS|{{{lang}}}
    |en=Name
    |fr=Nom}}:
| {{{name}}}
|}

In the above code, |fr=Nom was added between |en=Name and }}. When {{TEMPLATE NAME|lang=fr|name=Killing Floor}} is used, the output is:

Nom: Killing Floor

Where LL is already used[edit]

Consider the following template and code:

Farm • Offices
{| class="wikitable"
|-
| {{LL|{{{lang|}}}|
    en=Farm}}{{•}} {{LL|{{{lang|}}}|
    en=Offices}}
|}

To translate "Farm" and "Offices" to another language, use the following example:

{| class="wikitable"
|-
| {{LL|{{{lang|}}}|
    en=Farm|
    fr=Ferme}}{{•}} {{LL|{{{lang|}}}|
    en=Offices|
    fr=Bureaux}}
|}

When {{TEMPLATE NAME|lang=fr}} is used, the output is:

Ferme • Bureaux

In the above code, pipes were added immediately after en=Farm and en=Offices; this is important for {{LL}} because any line breaks between an equal sign and the subsequent pipe will break the links, as shown below:

{| class="wikitable"
|-
| {{LL|{{{lang|}}}
    |en=Farm
    |fr=Ferme}}{{•}} {{LL|{{{lang|}}}
    |en=Offices
    |fr=Bureaux}}
|}
Ferme • Bureaux

Where LS is needed[edit]

Consider the following template and code:

Name: {{{name}}}
{| class="wikitable"
|-
| Name:
| {{{name}}}
|}

To add foreign language support for "Name", use the following example:

{| class="wikitable"
|-
| {{LS|{{{lang}}}
    |en=Name}}:
| {{{name}}}
|}

In the above code, Name was replaced with {{LS|{{{lang}}}|en=Name}}, and then optional spaces were added before a pipe to tidy up the code. See #Where LS is already used to finish adding a translation.