Misplaced Pages

Template:Expand language/howto: Difference between revisions

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.
< Template:Expand language Browse history interactively← Previous editContent deleted Content addedVisualWikitext
Revision as of 02:25, 5 May 2017 view sourceMathglot (talk | contribs)Autopatrolled, Extended confirmed users, Page movers, Pending changes reviewers, Rollbackers, Template editors86,861 edits Tag it with... Was there a discussion about this I missed?← Previous edit Latest revision as of 15:01, 6 October 2024 view source Rich Farmbrough (talk | contribs)Edit filter managers, Autopatrolled, Extended confirmed users, File movers, Pending changes reviewers, Rollbackers, Template editors1,725,630 edits Topics and categorization 
(73 intermediate revisions by 16 users not shown)
Line 1: Line 1:
<!--This documentation is created by {{tlx|Expand language/howto|{{{1}}}}}--><noinclude>
This template is generated by {{tl|Expand language}}. It is used to mark articles that are better in {{{1}}} Misplaced Pages than in English Misplaced Pages, and thus should be translated from {{{2|{{{1}}}}}} into English.
{{interconnected template|]|]|and about 200 language expand templates|page=template doc helper page}}</noinclude>{{#ifeq:{{#invoke:High-use|num|x|demo={{ROOTPAGENAME}}}}|many||{{High-use|demo={{ROOTPAGENAME}}}}}}
{{transclusionless}}<!--included here and in transclusions to keep these temporary maintenance templates off of unused template reports-->
This template may be used to mark articles that have counterparts in {{{1}}} Misplaced Pages that are better than in English Misplaced Pages. These articles may be improved by ] from the original {{{1}}}.


== Usage == == Usage ==


To mark an article, tag it with: To mark an article, tag it with


:<code><nowiki>{{Expand</nowiki> {{{1}}}|''{{{2|{{{1}}}}}}articletitle''<nowiki>|date=</nowiki>{{CURRENTMONTHNAME}} {{CURRENTYEAR}}<nowiki>}}</nowiki></code> :<code><nowiki>{{Expand</nowiki> {{{1}}}|''{{{2|{{{1}}}}}} article title''<nowiki>|date=</nowiki>{{CURRENTMONTHNAME}} {{CURRENTYEAR}}<nowiki>}}</nowiki></code>


This template adds articles to the category ]. See ] below.
This template marks an opportunity, not a fault. It is less important than a stub mark. Therefore it should not be used as an urgent warning in the beginning of articles.


The template should be placed atop the article page ].<!--Per the latest Tfd at ].-->
This template places articles in the category ].


== Parameters ==
Because of this, the template should be added to the '''article page''', and ''not'' to the Talk page.


===Optional parameters=== All parameters are optional:


* <code>{{!}}1=''ARTICLE''</code>{{snd}}title of the article on {{{1}}} Misplaced Pages. This defaults to the article linked to the English article via Wikidata.
Foreign language featured articles can be marked using fa=yes, as in
* <code><nowiki>|section=yes</nowiki></code>{{snd}}changes notice to "This section may be expanded..." (default: 'article'){{#ifexist: Category:Featured articles needing translation from {{{1}}} Misplaced Pages |
* <code><nowiki>|fa=yes</nowiki></code>{{snd}}used to tag articles that are ] in {{{1}}}; used in category name generation.}}<noinclude>
<!-- 'Geography' is by far the most common subcat, and a good proxy for whether any topics exist. -->
</noinclude>{{#ifexist: Category:Geography articles needing translation from {{{1}}} Misplaced Pages |
* <code>{{!}}topic=''TOPIC''</code>{{snd}}a topic code used in category name generation.}}
* <code>{{!}}date={{CURRENTMONTHNAME}} {{CURRENTYEAR}}</code>{{snd}} set by bot if omitted.


== Topics and categorization ==
:<code><nowiki>{{Expand</nowiki> {{{1}}}<nowiki>|fa=yes|date=</nowiki>{{CURRENTMONTHNAME}} {{CURRENTYEAR}}<nowiki>}}</nowiki></code>

This template categorizes articles into categories. Basic categorization is into: ⟶ ]. Usage of parameters <code>fa</code> and <code>topic</code> define subcategories<!--
-->{{#ifexist: Category:Featured articles needing translation from {{{1}}} Misplaced Pages | , as follows:
* <code>fa=yes</code> ⟶ ] |.}}
{{#ifexist: Category:Geography articles needing translation from {{{1}}} Misplaced Pages |
Topic codes are expanded into fuller descriptors in the category name; for example: code ''geo'' becomes ''Geography'', and code ''gov'' becomes ''Government and politics''.
* <code>topic=geo</code> ⟶ ]
Topics recognized by {{BASEPAGENAME}} and the categories they are associated with include:
<table class="wikitable" style="margin-left:4em">
<tr> <th>Topic code</th> <th>Topic name<br/>and category</th> <th>Articles in<br/>category</th></tr>
{{EL table row|{{{1}}}|bio}}
{{EL table row|{{{1}}}|culture}}
{{EL table row|{{{1}}}|geo}}
{{EL table row|{{{1}}}|gov}}
{{EL table row|{{{1}}}|hist}}
{{EL table row|{{{1}}}|mil}}
{{EL table row|{{{1}}}|scitech}}
{{EL table row|{{{1}}}|sport}}
{{EL table row|{{{1}}}|struct}}
{{EL table row|{{{1}}}|transp}}
{{#ifexist: Template:Expand {{{1}}}/topics | {{Expand {{{1}}}/topics}} |}}
<tr> <th>&nbsp;</th> <td>]</td> <td style="text-align:right">{{#ifeq: {{PAGESINCATEGORY:Articles needing translation from {{{1|}}} Misplaced Pages|subcats}} | 0 | | ({{PAGESINCATEGORY:Articles needing translation from {{{1|}}} Misplaced Pages|subcats}}&nbsp;C)&#32; |}}{{PAGESINCATEGORY:Articles needing translation from {{{1|}}} Misplaced Pages|pages}}</td> </tr>
</table>}}

=== Adding a new topic and subcategory ===
{{Collapse top|bg=cornsilk|click show to view details on adding new topics and subcategories}}
{{Expand language/howto/newtopic|{{{1}}}}}
{{Collapse bottom}}

== See also ==
* ], policy which governs copying and translating articles from other language Wikipedias
* ], describes ] when adding translated content to an article
* ], general info
* ], a how-to page about how to copy and translate text from a ] into English.
* ]
* {{Template link|Expand language}}, parent template
* {{Template link|Translated page}}, may be added to the Talk page to provide supplemental ]
* {{Template link|Proofreader needed}}, may be added to the article page to request assistance after translation from a given language
* <span class="plainlinks"></span>
* ]
* ]
* ]
* ], WikiProject for translating content from non-English Wikipedias
* ], general WikiProject for languages
<includeonly>{{#ifeq: {{PAGENAME}} | {{BASEPAGENAME}} | {{template other| ] }} }}</includeonly><noinclude>

Latest revision as of 15:01, 6 October 2024

This template doc helper page is closely interconnected with other templates or pages.

This template may:

  • Be closely connected to other templates, subtemplates, or modules
  • Have dependencies on config files or data files
  • Have dynamic documentation
  • Or otherwise be closely interconnected with other pages

You are encouraged to familiarize yourself with its setup, and with related files—in particular, Expand language/howto/newtopic, Expand language/doc, and about 200 language expand templates. If your edit causes unexpected problems, please undo it quickly, as this template may appear on a large number of pages.

You can conduct experiments, and should test all major changes, either in this template's sandbox, the general template sandbox, or your user space before changing anything here.
WarningThis template is used on approximately 86,000 pages and changes may be widely noticed. Test changes in the template's /sandbox or /testcases subpages, or in your own user subpage. Consider discussing changes on the talk page before implementing them.
This template may have no transclusions, because it is substituted by a tool or script, it is used as part of a short-term or less active Misplaced Pages process, or for some other reason.

This template may be used to mark articles that have counterparts in {{{1}}} Misplaced Pages that are better than in English Misplaced Pages. These articles may be improved by translating content from the original {{{1}}}.

Usage

To mark an article, tag it with

{{Expand {{{1}}}|{{{1}}} article title|date=January 2025}}

This template adds articles to the category ]. See #Categorization below.

The template should be placed atop the article page along with other maintenance templates.

Parameters

All parameters are optional:

  • |1=ARTICLE – title of the article on {{{1}}} Misplaced Pages. This defaults to the article linked to the English article via Wikidata.
  • |section=yes – changes notice to "This section may be expanded..." (default: 'article')
  • |date=January 2025 – set by bot if omitted.

Topics and categorization

This template categorizes articles into categories. Basic categorization is into: ⟶ ]. Usage of parameters fa and topic define subcategories.


Adding a new topic and subcategory

click show to view details on adding new topics and subcategories

This section provides information about categorization in the {{Expand language}} suite of templates, and explains how to make a new subcategory available for use in a particular language template by use of a topic code. Editors may then employ the topic code in the {{]}} template as shorthand for categorizing the article in which it appears into a subcategory associated with that topic code. If you've done this before, and just need a refresher, see Quickstart. Otherwise, skip to the gory details below.

Quickstart

Here is a summary of the steps to add a new subcategory and a new topic code to the table for ] (details follow):

  • determine which missing topic code you wish to add (e.g., 'bio'; see col 1 of the topic table)
  • find the topic name for the topic (e.g., 'Biography'; see col. 2 of the Topics table)
  • derive the subcategory name from the topic name and the language name ("{{{1}}}", in this case) (e.g., Biography articles needing translation from {{{1}}} Misplaced Pages (click the topic name in col. 2 of the table for an example; e.g., ])
  • create the Category page for {{{1}}} using that name, and categorize it under Category:Articles needing translation from {{{1}}} Misplaced Pages
  • Adjust the #switch statement in ] template to include: | topic code = Topic name; for example:
    | bio = Biography (model after the #switch in Template:Expand French if needed)
  • To use the new code, go to an article needing categorization into the new subcat, and add:
    {{Expand {{{1}}}|topic=topic code|date=January 2025}} to the top of the article.
Background

A topic code is just an abbreviation or word, like bio for "Biography", or sport for "Sports". Associating a topic code with a subcategory name, and enabling its use to categorize articles on which the {{Expand LanguageName}} appears has two main requirements:

  • Creation of a category page with the appropriate subcategory name for the topic code
  • Ensuring that the wikicode of the particular {{Expand LanguageName}} template associates the topic code with the right subcategory name.

The {{Expand language}} suite of templates automatically categorizes pages on which it appears into Category:Articles needing translation from LanguageName Misplaced Pages. For many languages, this category may grow too large, and subcategorization is needed. The suite of Expand language templates supports subcategorization into a number of pre-defined subcategories, and provides an easy way of indicating subcategorization by using the |topic= param in the template, instead of having to know about a complex set of category naming or remember the category names. This page explains how to do that.

Categorizing articles needing translation

Adding a new topic goes hand in hand with creating a new subcategory in which to categorize articles needing expansion. The top level (and sometimes only) category for articles needing expansion for a given language follows this pattern:

Category:Articles needing translation from LanguageName Misplaced Pages

But the top level category can often grow to many hundreds or thousands of articles and that's too much for one category. In order to facilitate a better and more useful categorization, the {{Expand language}} suite of templates supports subcategorization into a number of subcategories using the |topic= parameter of the language-specific templates, such as {{Expand French}} or {{Expand German}}. Ten topic codes are defined, such as bio (for 'Biography') and mil (for 'Military'): when used as the value of the |topic= parameter, they imply (but do not automatically create) a subcategory of a specific name. For example:

{{Expand {{{1}}}|topic=bio}}

would categorize the article in which it appears into subcategory ⟶ ] .

Topic codes and topic names

The rows in the topic code table show what subcategories already exist under the top level category for a given language; for example, for {{{1}}}, the topic code table is ]. The existing subcategories can be found by clicking (or mousing over) the topic names in column two of the table.

There are ten predefined topic codes that are conventionally available for addition to, and use by, any of the Expand LanguageName templates. They are: bio, cult, geo, gov, hist, mil, sci, sport, struct, and transp. Each code is recognized by param |topic= in the Expand LanguageName template, which will categorize the page on which it appears into a subcategory based on the associated topic name, e.g.,bioBiography, and so forth).

Creating a new subcategory
  1. choose a topic code from the topic code table and determine the topic name from column 2 of the table (e.g., bio ⟶ Biography)
  2. define the subcategory name as a function of topic name and language name, using this pattern:
    Topic name articles needing translation from Language name Misplaced Pages
    Example: for topic name Biography and {{{1}}} we have: Biography articles needing translation from {{{1}}} Misplaced Pages
  3. create the category, e.g., ]
    Add the following text, and save the page:
{{Transcat|language={{{1}}}|topic=bio}}
{{CatAutoTOC}}
Enable subcategorization in the Expand LanguageName template

Creating a new subcategory is independent of the Expand language template, and one could always categorize an article into the subcategory the way any article is categorized, simply by adding the category between brackets to the end of the article. But to make subcategorization easier, the specific Expand language template for a given language will categorize the article into a subcategory automatically, if the correct association between topic code and topic name appears in the wikicode of the template.

Edit the specific Expand language template for the given language; for example, for {{{1}}}: edit ]

The association between topic code and topic name for a given language, and by extension between the topic code and the subcategory name, occurs in the wikicode of the specific language name templates, in particular, in the assignment of |topic=, which usually occurs within a #switch statement which picks one of a number of topic codes and assigns it to the topic name. Some languages have no support for topic codes, for example, {{Expand Chinese}}; others have full support, like {{Expand French}}, and others have something in between. To enable |topic= to be used to categorize the article on which it appears into the associated subcategory requires this code to be set up correctly; if the wikicode does not already have it, you can copy the #switch statement that assigns the value of |topic= from Template:Expand French.

Classify articles into the new subcategory

To classify articles into the new subcategory, use a specific Expand language template with the |topic= param.

  • Edit the article and find the {{]}} template
  • Paste |topic=bio into the template call; it can go anywhere, but after the name is good, e.g.:
    {{Expand {{{1}}}|John Doe|topic=bio|date=January 2025}}
  • Add an edit summary e.g., "Added topic=bio to Expand template."; Preview as needed, and Publish.
Creating non-standard subcategories and topic codes

Topic codes that are not among the standard ten may be created for specific languages and associated with new subcategories as needed. Define a topic code, a topic name corresponding to the variable part of the subcategory name, and add it to the template #switch statement.

To add the new code to the topic table in the doc page, create a /topics subpage, e.g., ] in which the row for the topics table is defined. If the file exists, it is transcluded at the end of the table. For an example, see |topic=commune in the {{Expand French}} template.

This is a more advanced type of operation which requires some basic knowledge of template writing, so it may be easier to do this by adding an Edit request on the Talk page of the template concerned. In the Edit request, specify the topic code and subcategory name you wish to add. For example, you could say, "Please add new topic code mtn to {{Expand Nepali}} which should categorize articles containing {{Expand Nepali|topic=mtn}} into subcategory 'Mountain articles needing translation from Nepali Misplaced Pages' using the topic code mtn." You can create the subcategory yourself, following the instructions above.

See also

Categories: