Data:WikiTranslations: Difference between revisions
No edit summary |
No edit summary |
||
| (4 intermediate revisions by 2 users not shown) | |||
| Line 10: | Line 10: | ||
* [[Data:WikiTranslations/fr]] | * [[Data:WikiTranslations/fr]] | ||
* [[Data:WikiTranslations/jp]] | * [[Data:WikiTranslations/jp]] | ||
* [[Data:WikiTranslations/zh-hans]] | |||
| Line 18: | Line 19: | ||
Each translated term will look like this: | Each translated term will look like this: | ||
<pre><nowiki>{{ | <pre><nowiki>{{WikiTranslation | ||
| subtype = hero_infobox | | subtype = hero_infobox | ||
| target_id = wiki_hero_class | | target_id = wiki_hero_class | ||
| | | en = Hero Class | ||
| name = | | name = Klasa | ||
}}</nowiki></pre> | }}</nowiki></pre> | ||
* The '''subtype''' should indicate which page uses this term. If it shows up on more than 1 page, this should be the word '''common''' to indicate it is used elsewhere. | * The '''subtype''' should indicate which page uses this term. If it shows up on more than 1 page, this should be the word '''common''' to indicate it is used elsewhere. | ||
* The '''target_id''' is a unique identifier for this term and should always start with the prefix "wiki_" to ensure it does not collide with official game terms. This is the key used to look up this term and should not be changed. | * The '''target_id''' is a unique identifier for this term and should always start with the prefix "wiki_" to ensure it does not collide with official game terms. This is the key used to look up this term and should not be changed. | ||
* ''' | * '''en''' is a comment that tells people what the translation means in English. | ||
* '''name''' is, finally, the actual translation for the term | * '''name''' is, finally, the actual translation for the term | ||
Note that the language is auto-detected based on the page address. | |||
| Line 48: | Line 48: | ||
<pre><nowiki>{{subst:AddWikiTranslations|lang=pl}}</nowiki></pre> | <pre><nowiki>{{subst:AddWikiTranslations|lang=pl}}</nowiki></pre> | ||
# Create | # Create a page <code>Data:WikiTranslations/xx</code>, replacing xx with the language code. | ||
# Add a link to that page at the top of this page. | # Add a link to that page or <code><nowiki>{{loc}}</nowiki></code> at the top of this page. | ||
# Add the following to that page: <code><nowiki>{{subst:NewWikiTranslations|lang=xx}}</nowiki></code>, replacing xx with the language code. | # Add the following to that page: <code><nowiki>{{subst:NewWikiTranslations|lang=xx}}</nowiki></code>, replacing xx with the language code. | ||
# Save the article | # Save the article. | ||
# Edit the article and replace the English placeholders with the translations in that language. | # Edit the article and replace the English placeholders after <code>| name =</code> with the translations in that language. | ||
[[Category: Wiki Translations]] | [[Category: Wiki Translations]] | ||
Latest revision as of 04:38, 22 July 2026
Across the wiki, various templates such as infoboxes are used to programmatically query the Help:Cargo database for game data. These infoboxes are set up to automatically translate their contents into various languages, but at times there are terms which have not been translated in the game files (or more specifically, have not been translated in a manner which isolates the term to itself rather than as part of a grammatical sentence). In addition, there occasionally exist terms which are not game concepts which need to be presented, such as "internal ID".
This article and its children are the solution to that translation issue. Each of these sub-pages defines
- Data:WikiTranslations/en
- Data:WikiTranslations/pl
- Data:WikiTranslations/ru
- Data:WikiTranslations/fr
- Data:WikiTranslations/jp
- Data:WikiTranslations/zh-hans
Schema
Each individual term which needs to be translated has its own invocation of the Template:TranslationDef template. This template is normally used throughout the Help:ObeliskBot data import process to store all sorts of game terms (over 75,000 individual translations), but we can also use it here.
Each translated term will look like this:
{{WikiTranslation
| subtype = hero_infobox
| target_id = wiki_hero_class
| en = Hero Class
| name = Klasa
}}
- The subtype should indicate which page uses this term. If it shows up on more than 1 page, this should be the word common to indicate it is used elsewhere.
- The target_id is a unique identifier for this term and should always start with the prefix "wiki_" to ensure it does not collide with official game terms. This is the key used to look up this term and should not be changed.
- en is a comment that tells people what the translation means in English.
- name is, finally, the actual translation for the term
Note that the language is auto-detected based on the page address.
Updating
Each language page is essentially a repository of these entries, but we do not expect anyone to manually manage all of them! Whenever a new set of terms needs to be injected into each subpage, use Template:AddWikiTranslations to do so:
{{subst:AddWikiTranslations|lang=pl}}
Copy-paste that into each subpage and save (not preview) the article, and the new entries will be ready to edit.
New Languages
When new language wikis come online, this procedure can also be used to quickly set up new languages, in this case using Template:NewWikiTranslations:
{{subst:AddWikiTranslations|lang=pl}}
- Create a page
Data:WikiTranslations/xx, replacing xx with the language code. - Add a link to that page or
{{loc}}at the top of this page. - Add the following to that page:
{{subst:NewWikiTranslations|lang=xx}}, replacing xx with the language code. - Save the article.
- Edit the article and replace the English placeholders after
| name =with the translations in that language.


