Difference between revisions of "Template:Machine translate/doc"
Jump to navigation
Jump to search
imported>SMcCandlish (doc update, clarification; replaced bad example (incorrectly gave title of site not of article as "title" parameter value); giving more examples; clarifications) |
imported>SMcCandlish (updates (technical notes; new parameter and example; replaced example because the site in question supplies the incorrect language so GT can't use it, and it was at https, so BT can't use it.) |
||
| Line 7: | Line 7: | ||
=== Required parameters === | === Required parameters === | ||
| − | * '''lang''' or '''1''' (or first unnamed, positional parameter): The source language's ISO 639-1 code. | + | * '''lang''' or '''1''' (or first unnamed, positional parameter): The source language's [[ISO 639-1]] code. |
| − | * '''url''': URL of online item. Start the url with the communications protocol, e.g. <nowiki>http://</nowiki>. | + | * '''url''': URL of online item. Start the url with the communications protocol, e.g. <kbd><nowiki>http://</nowiki></kbd>. '''Tehcnical notes''', {{as of|lc|2016|08|post=:}} Bing Translate does not work on <kb><nowiki>https://</nowiki></kbd> URLs. Google Translate works by headers sent by the webserver of the original document, and will report "This page is already in English" errors if the site incorrectly supplies English as the document language for non-English material, and this error is fairly common. |
=== Optional parameters === | === Optional parameters === | ||
* '''title''': Title of specific online work being cited. This title will appear as the citation itself, hyperlinked to the URL. Quotation marks or italics (as appropriate for the source type, e.g. an article versus a book – see [[MOS:TITLES]]) must be manually included in the value you supply here. This parameter's content will not be displayed if {{para|nolink}}, below, is used. | * '''title''': Title of specific online work being cited. This title will appear as the citation itself, hyperlinked to the URL. Quotation marks or italics (as appropriate for the source type, e.g. an article versus a book – see [[MOS:TITLES]]) must be manually included in the value you supply here. This parameter's content will not be displayed if {{para|nolink}}, below, is used. | ||
| − | * '''nolink''': If set to any non-empty value (e.g. nolink | + | * '''nolink''': If set to any non-empty value (e.g. {{para|nolink|y}}), the link to the URL will not be included (or will the value of {{para|title}}, if present). This can be used e.g. after a {{tl|Cite web}} link. |
| + | * '''noicon''': If set to any non-empty value, will also suppress the language-name icon – {{de icon}}, {{zh icon}}, etc. – in case this has already been given in a preceding citation template with its own {{para|lang}} parameter. | ||
* '''dlang''': The destination language's ISO 639-1 code, default <kbd>en</kbd> (English). This is not normally used on English Wikipedia, though it might have some application on talk pages, e.g. in discussion of translating an en.wiki page to another-language Wikipedia. | * '''dlang''': The destination language's ISO 639-1 code, default <kbd>en</kbd> (English). This is not normally used on English Wikipedia, though it might have some application on talk pages, e.g. in discussion of translating an en.wiki page to another-language Wikipedia. | ||
== Examples == | == Examples == | ||
The code: | The code: | ||
| − | <nowiki>{{machine translate |lang= | + | <nowiki>{{machine translate |lang=es |url=http://www.beisbolcubano.cu/home/news.asp?idNews=27618}}</nowiki> |
or simply: | or simply: | ||
| − | <nowiki>{{machine translate | | + | <nowiki>{{machine translate |es |url=http://www.beisbolcubano.cu/home/news.asp?idNews=27618}}</nowiki> |
gives:<br /> | gives:<br /> | ||
| − | {{machine translate | | + | {{machine translate |es |url=http://www.beisbolcubano.cu/home/news.asp?idNews=27618}} |
The code: | The code: | ||
| − | <nowiki>{{machine translate | | + | <nowiki>{{machine translate |es |url=http://www.beisbolcubano.cu/home/news.asp?idNews=27618 |title="Habana del Este campeón"}}</nowiki> |
gives:<br /> | gives:<br /> | ||
| − | {{machine translate | | + | {{machine translate |es |url=http://www.beisbolcubano.cu/home/news.asp?idNews=27618 |title="Habana del Este campeón"}} |
The code: | The code: | ||
| − | <nowiki>{{machine translate | | + | <nowiki>{{machine translate |es |url=http://www.beisbolcubano.cu/home/news.asp?idNews=27618 |nolink=y |noicon=y}}</nowiki> |
gives:<br /> | gives:<br /> | ||
| − | {{machine translate | | + | {{machine translate |es |url=http://www.beisbolcubano.cu/home/news.asp?idNews=27618 |nolink=y |noicon=y}} |
| + | |||
| + | |||
| + | The code: | ||
| + | <nowiki>{{machine translate |en |dlang=gd |url=http://en.wikipedia.org/wiki/Scottish_Games_in_North_Carolina |title="Scottish Games in North Carolina" at en.Wikipedia}}</nowiki> | ||
| + | gives:<br /> | ||
| + | {{machine translate |en |dlang=gd |url=http://en.wikipedia.org/wiki/Scottish_Games_in_North_Carolina |title="Scottish Games in North Carolina" at en.Wikipedia}} | ||
| + | |||
== See also == | == See also == | ||
Revision as of 21:21, 20 August 2016
| 40px | This is a documentation subpage for Template:Machine translate. It contains usage information, categories and other content that is not part of the original template page. |
Usage
Note: The lang and dlang parameters should be ISO 639-1 codes.
Required parameters
- lang or 1 (or first unnamed, positional parameter): The source language's ISO 639-1 code.
- url: URL of online item. Start the url with the communications protocol, e.g. http://. Tehcnical notes, As of 8 December lc:[update] Bing Translate does not work on <kb>https:// URLs. Google Translate works by headers sent by the webserver of the original document, and will report "This page is already in English" errors if the site incorrectly supplies English as the document language for non-English material, and this error is fairly common.
Optional parameters
- title: Title of specific online work being cited. This title will appear as the citation itself, hyperlinked to the URL. Quotation marks or italics (as appropriate for the source type, e.g. an article versus a book – see MOS:TITLES) must be manually included in the value you supply here. This parameter's content will not be displayed if
|nolink=, below, is used. - nolink: If set to any non-empty value (e.g.
|nolink=y), the link to the URL will not be included (or will the value of|title=, if present). This can be used e.g. after a {{Cite web}} link. - noicon: If set to any non-empty value, will also suppress the language-name icon – Template:De icon, Template:Zh icon, etc. – in case this has already been given in a preceding citation template with its own
|lang=parameter. - dlang: The destination language's ISO 639-1 code, default en (English). This is not normally used on English Wikipedia, though it might have some application on talk pages, e.g. in discussion of translating an en.wiki page to another-language Wikipedia.
Examples
The code:
{{machine translate |lang=es |url=http://www.beisbolcubano.cu/home/news.asp?idNews=27618}}
or simply:
{{machine translate |es |url=http://www.beisbolcubano.cu/home/news.asp?idNews=27618}}
gives:
[1] (in Spanish) (Translate: Google, Bing)
The code:
{{machine translate |es |url=http://www.beisbolcubano.cu/home/news.asp?idNews=27618 |title="Habana del Este campeón"}}
gives:
"Habana del Este campeón" (in Spanish) (Translate: Google, Bing)
The code:
{{machine translate |es |url=http://www.beisbolcubano.cu/home/news.asp?idNews=27618 |nolink=y |noicon=y}}
gives:
(Translate: Google, Bing)
The code:
{{machine translate |en |dlang=gd |url=http://en.wikipedia.org/wiki/Scottish_Games_in_North_Carolina |title="Scottish Games in North Carolina" at en.Wikipedia}}
gives:
"Scottish Games in North Carolina" at en.Wikipedia (in English) (Translate to Scottish Gaelic: Google, Bing)
See also
- {{Google translation}} for just Google.
- {{rough translation}} to tag articles whose text seems to be generated through machine translation