Difference between revisions of "Kerbal Space Program Wiki:Templates"
m (→Data template for celestial bodies: -/Data pages should go away soon;) |
(Readapted undoed example for new approach (data templates for celestial body)) |
||
Line 3: | Line 3: | ||
== Data templates == | == Data templates == | ||
− | Language-independent information should be stored in a specific template (a “data template“), to be referred to by each localized template (e.g. English, French, etc). This avoids duplicating data in different pages and improves maintainability and stability. Such templates should use {{ | + | Language-independent information should be stored in a specific template (a “data template“), to be referred to by each localized template (e.g. English, French, etc). This avoids duplicating data in different pages and improves maintainability and stability. Such templates should use <nowiki>{{Data template used}}</nowiki>, which will categorize them in [[:Category:Translating templates]]. |
=== Data templates for parts === | === Data templates for parts === | ||
Line 9: | Line 9: | ||
For instance, [[Rockomax 48-7S]] (English), [[Rockomax 48-7S/pl]] (Polish) and [[Rockomax 48-7S/ja]] (Japanese) all use the same raw data stored in the data template [[Rockomax 48-7S/Box]] to draw the infobox on the right. To do so, they simply include <code><nowiki>{{:Rockomax 48-7S/Box}}</nowiki></code>. Mind the colon (":"). | For instance, [[Rockomax 48-7S]] (English), [[Rockomax 48-7S/pl]] (Polish) and [[Rockomax 48-7S/ja]] (Japanese) all use the same raw data stored in the data template [[Rockomax 48-7S/Box]] to draw the infobox on the right. To do so, they simply include <code><nowiki>{{:Rockomax 48-7S/Box}}</nowiki></code>. Mind the colon (":"). | ||
− | [[Rockomax 48-7S/Box]] itself includes {{ | + | [[Rockomax 48-7S/Box]] itself includes <nowiki>{{Infobox/Part}}</nowiki>, which defines how the infobox is to be drawn and how to translate it. |
=== Data template for celestial bodies === | === Data template for celestial bodies === | ||
− | + | ||
+ | Similarly, [[Kerbin]] (English), [[Kerbin/fr]] (French) and [[Kerbin/de]] (German) all use data from [[Kerbin/Param]]. A small difference from data templates for parts is that <nowiki>{{Infobox/Body}}</nowiki> is directly included in the body's page and will automatically retrieve data from [[Kerbin/Param]]. |
Revision as of 08:08, 26 December 2014
Data templates
Language-independent information should be stored in a specific template (a “data template“), to be referred to by each localized template (e.g. English, French, etc). This avoids duplicating data in different pages and improves maintainability and stability. Such templates should use {{Data template used}}, which will categorize them in Category:Translating templates.
Data templates for parts
For instance, Rockomax 48-7S (English), Rockomax 48-7S/pl (Polish) and Rockomax 48-7S/ja (Japanese) all use the same raw data stored in the data template Rockomax 48-7S/Box to draw the infobox on the right. To do so, they simply include {{:Rockomax 48-7S/Box}}
. Mind the colon (":").
Rockomax 48-7S/Box itself includes {{Infobox/Part}}, which defines how the infobox is to be drawn and how to translate it.
Data template for celestial bodies
Similarly, Kerbin (English), Kerbin/fr (French) and Kerbin/de (German) all use data from Kerbin/Param. A small difference from data templates for parts is that {{Infobox/Body}} is directly included in the body's page and will automatically retrieve data from Kerbin/Param.