Jump to content

Meta: Diretrizes para internacionalização

From Meta, a Wikimedia project coordination wiki
This page is a translated version of the page Meta:Internationalization guidelines and the translation is 31% complete.
Outdated translations are marked like this.

A Meta-Wiki visa ser um wiki multilíngue, portanto, espera-se que a maioria das páginas seja traduzível e traduzida. Para poder ser traduzida através de extenção de tradução, uma página deve ser etiquetada com ‎<translate>...‎</translate> (i.e. internacionalizada) e depois marcada para tradução por um administrador de tradução. Esta página visa apresentar as diretrizes para internacionalização de páginas na Meta-Wiki.

For a step-by-step guide to marking a page for translation, see the tutorial.

Diretrizes gerais

Em regra, você deve seguir as diretrizes da extensão de tradução sobre a marcação de uma página para tradução: quando possível, por favor, evite dividir manualmente as unidades de tradução fechando a etiqueta ‎</translate>, você deve deixar as linhas vazias fazerem este trabalho.

Although you can edit translated content using the visual editor, you must use the source editor to add or change translation markup. To make it easier to add translation markup, use the buttons in the box under the editing interface.

Do not use section editing when editing translated pages since this adds extra whitespace to the page.[1] Always select the option to edit the entire page.

Segmentation examples

Good syntax Bad syntax
Add ‎<translate> tags on new lines around headings and paragraphs.
<translate>
== Section heading ==

This is a paragraph.

This is another paragraph.
</translate>

{{Template}}

<translate>
== Another heading ==
</translate>
Heading markup (for example: ==) must be included in translation units.
== <translate>Section heading</translate> ==
<translate>This is a paragraph.</translate>

<translate>This is another paragraph.</translate>

{{Template}}

== <translate>Another heading<translate> ==
Split list items into individual translation units without line breaks. Exclude list markup from the translation unit.
* <translate>This is a long list:</translate>
** <translate>There are more than 160 words in this list,</translate>
** <translate>or there are more than 8 items.</translate>
* <translate>So it is better to split it in several smaller units.</translate>
* <translate>But we must exclude bullet points from translate tags to keep the list accessible.</translate>
List markup (for example: * or #) must be excluded from translation units.
<translate>
* This is a long list:
** There are more than 160 words in this list,
** or there are more than 8 items.
</translate>
<translate>
* So it is better to split it in several smaller units.
* But we must exclude bullet points from translate tags to keep the list accessible.
</translate>

Elementos específicos

Ligações

Links require special markup to link to the correct language variant of the target page. Use localized link syntax for any page that could be translated, even if it hasn't been marked for translation. Pages which do not need localized link syntax include talk pages and templates without textual content.

To link to a page on a multilingual wiki, prefix links with Special:MyLanguage/. To make translation easier, include only the link text in the translation unit, not the link target. If the link is part of a larger translation unit, like a paragraph, you can exclude the link target from the translation unit by wrapping it inside a translation variable (<tvar name=1> … </tvar>).

For a standalone link to a page on the same wiki, such as in a list or a table, you can use the localized link template to simplify the syntax. This works on Meta-Wiki, mediawiki.org, Outreach Wiki, and other wikis where this template is available.

For links to Wikipedia article, you should use {{lwp}} template for the target and wrap it inside a tvar. E.g. [[{{lwp|Rosa Parks}}</tvar>]] produces en:Rosa Parks in English pages and fr:Rosa Parks in French pages.

Para ligações cross-wiki e externos, se houver uma tradução, você não deve colocar o link alvo dentro da tvar. Por exemplo, se a página conecta um artigo da Wikipedia, você deve permitir que os tradutores conectem um artigo equivalente em seu próprio idioma da Wikipedia. Naturalmente, se o site alvo incluir um sistema de detecção de idioma (como o MediaWiki's Special:MyLanguage/), você pode usar este sistema e colocar o link completo dentro de tvar.

Good syntax Bad syntax
To link to a page on a multilingual wiki, prefix the link target with Special:MyLanguage/, and add link text. Use a translation variable to ensure that only the link text is included in the translation unit.
<translate>
Learn about [[<tvar name=1>Special:MyLanguage/Wikimedia projects</tvar>|Wikimedia projects]] and how to request a [[<tvar name=2>Special:MyLanguage/New project process</tvar>|new project]].
</translate>
The translation variable should include only the link target, not the link text.
<translate>
Learn about [[<tvar name=1>Special:MyLanguage/Wikimedia projects</tvar>|Wikimedia projects]] and how to request a [[<tvar name=2>Special:MyLanguage/New project process|new project</tvar>]].
</translate>
For a standalone link to a page on the same wiki, such as in a list or a table, use Template:ll , and translate only custom link text. You can use |nsp=0 to simplify the link text by omitting the namespace.
<translate>
See also:
</translate>

* {{ll|Help:Contents|2=<translate>Help pages</translate>}}
* {{ll|Meta:Discussion pages|nsp=0}}
A parameter name (2=) is required when adding ‎<translate> tags inside template syntax.
<translate>
See also:
</translate>

* {{ll|Help:Contents|<translate>Help pages</translate>}}
* {{ll|Meta:Discussion pages|nsp=0}}
For external links, exclude the link target from the translation unit using a translation variable.
<translate>
This is a text with an [<tvar name=url>https://openstreetmap.org</tvar> external link].
</translate>
A translation variable is required to exclude the external link target from the translation unit.
<translate>
This is a text with an [https://openstreetmap.org external link].
</translate>

Categorização

Você deve excluir as declarações de categoria das etiquetas de ‎<translate>. Ao invés disso, adicione {{#translation:}} após o nome da categoria: [[Category:Target category{{#translation:}}]]. Desta forma, apenas a página principal em inglês é categorizada dentro das categorias alvo, as páginas de tradução são categorizadas em categorias por idioma.

Good syntax Bad syntax
[[Category:Wikipedia{{#translation:}}]]
<translate>[[Category:Wikipedia]]</translate>

Images

Thumbs and large images

If the image can be localized (e.g. it contains some text and a translated version exists), it should be fully included in ‎<translate> tags.

Else, you should only wrap alt= value in <translate nowrap> tags and caption in <translate> tags.

If left or right is used as image parameter: remove it if it is useless (thumbnails default to right in English), or replace it respectively with {{dirstart}} or {{dirend}}.

Good syntax Bad syntax
[[File:landscape.jpg |thumb |{{dirstart}} |alt=<translate nowrap>Sunset over mountains</translate> |<translate>Photo of a beautiful landscape</translate>]]
<translate>
[[File:landscape.jpg |thumb |left |alt=Sunset over mountains |Photo of a beautiful landscape]]
</translate>
<translate>
[[File:English Wikipedia screenshot.png|thumb|alt=Homepage of English Wikipedia with featured article and news topics|Wikipedia homepage]]
</translate>
[[File:English Wikipedia screenshot.png|thumb|right|alt=<translate nowrap>Homepage of English Wikipedia with featured article and news topics</translate>|<translate>Wikipedia homepage</translate>]]

Icons

Inline icons may be simply wrapped in a <tvar name="icon">.

Good syntax Bad syntax
<translate>
[[File:pretty hello word.png|alt=Hello everybody!]], <tvar name="icon">[[File:smiley.png|alt=🙂]] How are you?
</translate>
<translate>
[[File:pretty hello word.png|alt=Hello everybody!]], [[File:smiley.png|alt=🙂]] How are you?
</translate>

Traduzindo variáveis

As variáveis de tradução (sintaxe do <tvar name="name"></tvar>) devem ser usadas para esconder o texto dos tradutores, a fim de evitar que eles o traduzam.

Os exemplos a seguir devem ser envelopados dentro de uma etiqueta tvar:

  • automaticamente-localizado ou nãolocalizável alvos de ligações,
  • nomes de usuário,
  • números que provavelmente mudarão (devem ser envelopados dentro de {{formatnum:}} e depois dentro de tvar),
  • atributos da etiqueta (por exemplo, <span class="css_class" style="background-color:blue"</tvar>>hello</span>),
  • nome e parâmetros das predefinições (por exemplo, {{<tvar name=1>center|5px</tvar>|hello}}),
  • Você pode colocar partes complexas de wikitexto ou HTML dentro de $tag, mas certifique-se de que o wikitexto resultante para tradutores seja equilibrado.

Os exemplos a seguir não devem ser envelopados dentro de uma etiqueta tvar:

  • nomes de pessoas e lugares (mesmo que raramente sejam traduzidos, podem ser transliterados),
  • Tag XML sem atributos, como <code> (a interface de tradução lida com eles),
  • Alvos de links localizáveis (por exemplo, links para artigos da Wikipedia).

Tradução de nomes de variáveis

Para ajudar os tradutores, por favor, mantenha nomes de etiquetas o mais curtos e legíveis possível. Se os tradutores não precisam saber seu conteúdo, usar nomes numerados é uma boa idéia, pois os dígitos são rápidos de digitar para a maioria dos tradutores e são comuns em muitos idiomas (para que a maioria dos iniciantes não os traduza acidentalmente).

Entretanto, se tvar estiver dentro de uma frase, ela deve ter um nome explícito para permitir que os tradutores entendam o que ela contém e assim escrevam facilmente no lugar certo em sua tradução (é bastante comum para endereço de e-mail, URL, etiquetas de wikitexto ...).

Good syntax Bad syntax
[[<tvar name="1">Special:MyLanguage/Help:Links|See help page]]
[[Special:MyLanguage/Help:Links|See help page]]
The meeting will take place on <tvar name="date">{{dateT||9|24}}</tvar> on <tvar name="software">{{int string|Zoom}}</tvar>.
The meeting will take place on <tvar name=1>{{dateT||9|24}}</tvar> on <tvar name=2>{{int string|Zoom}}</tvar>.

Avoid using spaces, underscores or letters with diacritics in tvar names as well.

Good syntax Bad syntax
<tvar name="max-count">84</tvar> cafés
<tvar name="max_count of café">84</tvar> cafés

Predefinições

Você pode preparar uma predefinição para tradução como qualquer página, mas você deve garantir que a caixa de seleção "Ativar transclusão com reconhecimento de tradução para esta página" esteja marcada quando você marcar a página para tradução.

Se você inserir uma etiqueta ‎<translate> dentro de um parâmetro de valor de uma predefinição, certifique-se de que o parâmetro seja nomeado (caso contrário, adicione um nome numérico, como 1=).

Se for esperado que sua predefinição seja incluída em páginas não traduzíveis (por exemplo páginas de usuário) e deve até mesmo ser traduzida nestas páginas, você pode usar o "hack pré-2021 com switch", substituindo uselang={{PAGELANGUAGE}} por uselang={{int:lang}} no código mostrado abaixo.

Hacks Pré-2021

Antes da MediaWiki 1.36.0-wmf.32 (23.02.2021), você deve garantir que as páginas em inglês incluam a subpágina /en em vez da predefinição diretamente.

Uma maneira era substituir cada ocorrência de {{minha predefinição traduzida|param}} por {{TNT|minha predefinição traduzida|param}}, exceto nos modelos ou páginas transcluídas que devem conter {{ {{TNTN|meu modelo traduzido}} |param}}.

Outra maneira era editar a predefinição para que ela se chamasse {{TNT}}. Para isso, você deve colocar o código completo da prédefinição dentro de uma chave que avaliou uma etiqueta ‎<translate> vazia, com uma caixa padrão que se chamava {{TNT}}.

{{#switch:<translate></translate>
|=<código completo da predefinição>
|#default={{#invoke:Template translation|renderTranslatedTemplate|template={{subst:FULLPAGENAME}}|uselang={{PAGELANGUAGE}}|noshift=1}}
}}

Ver também

Referências