Help:Extension:Translate/Page translation administration/pt

O quê. A funcionalidade de tradução da página permite uma tradução controlada das páginas wiki para outros idiomas. Isto significa que o conteúdo da página traduzida é, normalmente, equivalente ao da página original. Isto é o oposto, por exemplo, das diferentes versões por idioma da mesma página nas diversas Wikipédias, que são completamente independentes entre si. Parte-se do princípio que as páginas só são traduzidas a partir da versão no idioma original, mas os tradutores podem aproveitar as traduções noutros idiomas, se existirem.

Porquê. Sem qualquer ajuda, traduzir mais do que algumas páginas para outras línguas torna-se numa perda de tempo, na melhor das hipóteses, e numa confusão insustentável, na pior. Com a funcionalidade de tradução de páginas pode evitar esta confusão e estruturar o processo de tradução. A ideia central é segmentar o texto de origem em unidades menores, cada uma das quais será traduzida individualmente. Quando o texto de origem é segmentado em unidades, as alterações podem ser isoladas e os tradutores só precisam de atualizar a tradução das unidades que sofreram alterações no texto original. Isto também permite que os tradutores trabalhem em unidades de tamanho reduzido e possam dividir o esforço entre vários tradutores ou continuar a tradução em sessões posteriores, porque não precisam de fazer a tradução toda de uma só vez.

Quem. Esta página elabora o tutorial de tradução de páginas com uma descrição mais detalhada da forma como o sistema funciona, e a sugestão de boas práticas para uma ampla variedade de casos. Destina-se a administradores da tradução de páginas e, em geral, a todos aqueles que editam o texto original das páginas traduzíveis, mesmo que não tenham acesso às funcionalidades administrativas de aprovação de alterações para que estas sejam traduzidas.

Para solicitar por direitos estendidos como um administrador de tradução, vá para Projeto:Projetos.

A duração de uma página traduzível
Funções. O processo de criação e tradução de uma página da wiki envolve várias pessoas: o editor inicial cria a página, alguém corrige erros de ortografia, um administrador de traduções marca a página para tradução, os tradutores traduzem-na, alguém altera a página original, um administrador de traduções marca as alterações para tradução e os tradutores atualizam a tradução dos segmentos alterados. Estas funções podem sobrepor-se em maior ou menor grau, mas a responsabilidade final por uma tradução sem problemas é deixada para o administrador de traduções. É o administrador quem decide que a página está pronta para a tradução inicial, quem garante que a segmentação serve o seu propósito e quem aprova (ou corrige) alterações.

Preparação. Para um texto ser traduzido tem primeiro que ser escrito. Se já traduziu sem a extensão Translate, consulte abaixo a secção sobre migração de traduções. Se pretende obter bastantes traduções rapidamente, é fundamental que o texto de origem esteja em boas condições. Antes de marcar uma página para tradução, peça a alguém que a reveja e, se possível, recorra a um linguista para tornar o texto mais claro e conciso. Vocabulário complicado e frases de difícil compreensão não resultam em muitas traduções voluntárias. Os elementos de formatação também podem causar problemas aos tradutores, mas, na função de administrador de traduções, pode evitar esses problemas; consulte abaixo a secção sobre elementos de formatação. Naturalmente, as alterações ao texto original forçam a atualização de todas as traduções existentes, por isso, é melhor esperar até o conteúdo da página estar estabilizado. Por outro lado, alterações acontecem e o sistema lida bem com elas, por isso, consulte a secção sobre como lidar com alterações abaixo.

Etiquetagem Quando o texto está pronto para ser traduzido, qualquer pessoa pode marcar as partes traduzíveis rodeando-as por tags e adicionando a barra  à página. Esta barra adiciona uma lista de todas as traduções da página, com a respetiva percentagem de traduções completas e atualizadas. Não existe nenhuma outra indicação de que existem traduções. Veja abaixo como fazer a marcação. O sistema irá detetar quando as marcações são colocadas numa página traduzível, e a página irá ter uma hiperligação para a marcar para tradução. Este também irá detetar reclamações e impede a gravação se, por exemplo, se se esqueceu de adicionar uma tag à tag de fecho. A página traduzível também será listada em Special:PageTranslation como pronta para marcação.

Marcação. Após a introdução de tags, um administrador de traduções marca a página para tradução. A interface é explicada no exemplo de tradução de páginas. A responsabilidade do administrador de traduções é certificar-se de que a segmentação faz sentido e que a inserção de tags está correta. A página pode ser marcada outra vez se tiver sido alterada entretanto. Veja abaixo como fazer alterações que minimizem perturbações. A marcação da página inicia um processo de segundo plano que usa a fila de tarefas do MediaWiki. Este processo passa por cada página traduzida e regenera-a: as mudanças na página original são refletidas e as traduções desatualizadas são substituídas temporariamente pelo texto original. Pelo contrário, a interface de tradução é atualizada de imediato.

Alterações. Os utilizadores podem continuar a alterar a página original traduzível. As mudanças serão visíveis para utilizadores que visionem a página na língua de origem, mas as traduções são feitas contra as unidades de tradução extraídas da última versão da página traduzível que foi marcada para tradução: as páginas traduzidas são reportadas como 100% atualizadas se todas as unidades de tradução foram traduzidas, mesmo que a página original tenha novas alterações. Pode ver facilmente se há alterações não marcadas ao ver a página traduzida na língua de origem: há um aviso na parte superior da página que informa que pode traduzi-la e conduz às alterações, se existirem.

Invalidação. Se forem efetuadas alterações na origem da página traduzível, o administrador de tradução irá dar-lhe a opção de «» para cada secção. If a section is invalidated, then the translated languages will get a pink background color for those sections, and a clock icon will be shown to translators in the translation interface. If a section is not invalidated, then no changes will be visible to readers of the translated pages, and translators will have to examine the section within the translation interface in order to see the changes.

Idioma de origem. Há também uma página de tradução com o código de idioma do idioma de origem: este não contém as etiquetas extras e outras marcações relacionadas coma a tradução da página que são utilizadas na origem da página traduzível. Esta página não está vinculada a partir da interface, mas é útil, por exemplo, quando deseja incluir a página (normalmente para modelos traduzíveis) ou exportá-la. Por exemplo, a página em que está, está disponível sem as marcações em Help:Extension:Translate/Page translation administration/en.

Changing the source language. The extension will normally assume that the translatable source page is in the wiki's default language. Administrators can change a specific page's language setting, using the Special:PageLanguage page, so that it can be used as a source page for translation. See Page content language for details.

Translation language. Translation pages may contain text in different languages if it is not fully translated. On translation pages, untranslated translation units will be tagged with appropriate language and text direction so that CSS rules are applied correctly. MediaWiki, however, does not currently allow setting the language for parsing other than at the page level. All magic words and parser functions use the translation target language, even if the surrounding text is not translated. This can create an unwanted mismatch for example when formatting numbers or dates. Some magic functions and parser tags allow setting the output language, in which case you can use magic word  that returns either the source language for untranslated units or the target language for translated units.

Closed translation requests. Some translatable pages have a content that is only interesting for a certain period of time. For example announcements and regular status updates, like the Wikimedia monthly highlights. You can keep those pages around with translations, but hide them from the translation interface. This does not prevent further translations to the pages, but it greatly reduces the chance that a user accidentally starts translating the page. Discouraging and its reversion are done from Special:PageTranslation.

Prioritizing languages. You can also define a list of languages that you specifically want translations into; leaving the language list empty is interpreted as all languages allowed. The page will behave like a discouraged page (see previous paragraph) for the languages not in the priority list and, when translating into them, translators will be given a notice. You can also prevent the translation in other languages, say if translations are actually used elsewhere and you won't be able to use them but in some languages.

Grouping. It is possible to group related pages together. These groups work like all the other message groups. They have their own statistics and contain all the messages of the subgroups: in this case translatable pages. This functionality is currently in Special:AggregateGroups. Aggregate message groups are collapsed by default in Special:LanguageStats in the group selector at Special:Translate.

Moving. You can move translatable pages as you would move any other page. When moving you can choose whether you want to move any non-translation subpages too. The move uses a background job to move the many related pages. While the move is in progress, it is not possible to translate the page. Completion is noted in the page translation log.

Deleting. Like move, deletion is accessed from the normal place. You can delete either the whole translatable page, or just one translation page, from the delete button on it. Deletion will also delete all the related translation unit pages. As in move, a background process will delete the pages over time and completion is noted in the page translation log. Deletion requires "delete" and "pagetranslation" permission, but individual translation unit pages can always be deleted with standard "delete".

Reverting. Similarly, reverting incorrect edits works as usual (including the rollback button): you only have to edit the affected translation unit and the translation page will be updated as well. To find the edit to the translation unit from the edit to the translation page, just click the "" link for the editor and look for an edit at a similar time.

Protecting. It is possible to protect the translatable page. Translation pages cannot be protected, nor does the protection of the translatable page extend to them. To prevent further edits to translations, you should add the source language as only priority language and disable translations to other languages, see prioritizing languages above. Together these two actions effectively prevent changes to both the source page and translation pages with its translation unit pages. It is possible to protect individual translation unit pages, though it is not advisable.

Removal from translation. It is also possible to unmark a page for translation. You can use Special:PageTranslation or follow the link in the top of translatable page to remove it from translation. This will remove any structure related to page translation, but leave all the existing pages in place, freely editable. This action is not recommended.

Language aware transclusion. It is possible to transclude a translatable page into another page as a template. In such a case, the translatable page will be loaded in the language of the source page if it has been translated to that language. If that translation does not exist, the translatable page will be loaded in the source language. This behavior of a translatable page is controlled by the Enable translation aware transclusion for this page option when marking the page for translation. New translatable pages will have this behavior turned on by default.

Anatomia de uma página traduzível
The translation of a translatable page will produce many pages, which all together compose the translatable page in the broadest sense: their title is determined by the title of the translatable :


 * (the source page)
 * (the translation pages, plus a copy of the source page without markup)
 * (all the translation unit pages)

In addition to this, there are the translation page template and the sources of translation units, extracted from the source page and stored in the database. The system keeps track of which versions of the source page contain translation tags and which version of them have been marked for translation.

Every time a translation unit page is updated, the system will also regenerate the corresponding translation page. This will result in two edits. The translation unit page edit is hidden by default in recent changes and can be shown by choosing show translations from the translation filter. Any action other than editing (like deleting and moving) the translation unit pages will not trigger the regeneration of the corresponding translation page.

If you need the copy of the source page without markup, e.g. to be pasted in another wiki without Translate,


 * identify the source language code (for English, en ) and visit
 * click the "" button to reach an address like this and replace  with   in the address bar, press enter
 * the text will be displayed or saved.

Segmentação
Princípios gerais:


 * 1) Todo o texto destinado à tradução deve ser envolvido com tags . Pode ter vários pares de tags numa única página.
 * 2) Everything outside those tags will not change in any translation page. This static text, together with the placeholders which mark the place where the translation of each translation unit will be substituted, is called the translation page template.
 * 3) Too much markup in the text makes it difficult for translators to translate. Use more fine grained placing of  tags when there are lots of markup.
 * 4) The text inside  tags is split into translation units where there is one or more empty lines between them (two or more newlines).

Restrictions. The page translation feature places some restrictions on the text. There should not be any markup that spans over two or more translation units. In other words, each paragraph should be self-contained. This is currently not enforced in the software, but violating it will cause invalid rendering of the page, the severity depending on whether MediaWiki itself is able to fix the resulting HTML output or not.

Parsing order. Beware, the tags work differently from other tags, because they do not go through the parser. This should not cause problems usually, but may if you are trying something fancy. In more detail, they are parsed before any other tags like or, except for  which is recognized by the Translate extension.

Tag placing. If possible, try to put the tags on their own lines, with no empty lines between the content and the tags. Sometimes this is not possible, for example if you want to translate some content surrounded by the markup, but not the markup itself. This is fine too, for example:

To make this work, the extension has a simple whitespace handling: whitespace is preserved, except if an opening or closing  tag is the only thing on a line. In that case the newline after the opening tag or before the closing tag is eaten. This means that they don't cause extra space in the rendered version of the page.

Variables. It is possible to use variables similar to template variables. The syntax for this is. For translators these will show up only as, and in translation pages will automatically be replaced by the value defined in the translatable page (so they are global "constants" across all its translation pages). Variables can be used to hide untranslatable content in the middle of a translation unit. It also works for things like numbers that need to be updated often. You can update the number in all translations by changing the number in the translatable page source and re-marking the page. You do not need to invalidate translations, because the number is not part of the translation unit pages.

Comma-separated values. For content such as Graph data, that needs to be parsed by the software as comma-separated values, you should separate the translation units between each comma, so that the translating editors don't use localized commas which will confuse the software.

Plain-text values. To prevent any kind of modification of the translation value, use  attribute like this:. By default outdated and untranslated values are modified in order to support highlighting and language tagging.

Exemplos de marcação
Below are listed some alternatives and suggested ways to handle different kinds of wiki markup.

{| class=wikitable
 * - style="visibility:collapse"
 * colspan="3" |
 * Categorias
 * width=40% | Categories can be added in two ways: in the translation page template or in one of the translation units.
 * width=40% | Categories can be added in two ways: in the translation page template or in one of the translation units.

If you have the categories in the translation page template, all translations will end up in the same category.

If you have categories inside translation units, you should teach the users a naming scheme.

On the right we show two possible schemes which are independent of the technical means to adopt them. Tradução adicionando o sufixo do idioma: Categoria:Carros/fi (recomendado)


 * Nome da página da categoria não traduzido (assim como os nomes de página).
 * Uma categoria para cada idioma.
 * A tradução de página poderia ser utilizada para a própria categoria: as categorias seriam associadas e os cabeçalhos seriam traduzidos (mas não o nome da categoria nas hiperligações e afins).

Sem tradução: Category:Cars


 * Todas as traduções na mesma categoria (bom, se apenas poucos idiomas; mau, se muitos).
 * Nome de categoria não traduzido (pode ser colocado como no modelo de tradução).
 * Cabeçalhos
 * Headers can in principle be tied to the following paragraph, but it is better to have them separated with an empty line. This way someone can quickly translate the table of contents before going into the contents.
 * Headers can in principle be tied to the following paragraph, but it is better to have them separated with an empty line. This way someone can quickly translate the table of contents before going into the contents.

When tagging headers, it is important to include the header markup inside the tags and insert a newline between the opening translate tag and the header markup, or MediaWiki will no longer identify them properly. For example, section editing only works with the recommended mark-up given in the example. The markup also immediately gives translators a context: they are translating a header.  Wrong:  (no newline after tag, heading out of translate tags) {{#tag:syntaxhighlight|

translateCultura/translate

 * lang="html"}}

Errado: (no newline)

Segmentação recomendada: {{#tag:syntaxhighlight| {{^(}}translate{{)^}}

Cultura
Lorem ipsum dolor. /translate
 * lang="html"}}


 * Imagens
 * Images that do contain language specific content like text should include the full image syntax in an unit. Other images can only tag the description with optional hint in message documentation of the page after it has been marked.
 * Images that do contain language specific content like text should include the full image syntax in an unit. Other images can only tag the description with optional hint in message documentation of the page after it has been marked.


 * Hiperligações
 * Links can be included in the paragraph they are inside. This allows changing the link label, but also changing the link target to a localized version if one exists.
 * Links can be included in the paragraph they are inside. This allows changing the link label, but also changing the link target to a localized version if one exists.

If the target page is (or should be) also translatable, you should link to it by prepending  to its title. Only the link label will need to be translated, because this automatically redirects users to the translation page in their own interface language, as selected for instance via the UniversalLanguageSelector. However, to achieve a constant behavior the syntax must be used for all links.

Because headers are translated, you cannot rely on the automatically generated id's for headers. You can add your own anchors. To have them outside of the translation template you need to break up the page into multiple tag pairs around each header you want to have an anchor to. Hiperligações internas:

Hiperligações para as páginas traduzíveis:

Hiperligações externas:

Hiperligações dentro de uma página: {{#tag:syntaxhighlight| span id=culture{{^(}}/span{{)^}} {{^(}}translate{{)^}}

Cultura
Lorem ipsum dolor.

...

Para mais informação acerca de comida, consulte a secção sobre cultura. /translate
 * lang="html"}}

Prefira esta alternativa apenas se as lista derivadas forem conceitualmente independentes entre si, a fim de facilitar a tradução separada para várias línguas: por exemplo, você deve evitar dividir uma única sentença em pequenas unidades, evitar separar, logicamente, partes dependentes entre si, as quais se complementam. To split a list, use -tags for each item without including leading asterisks/hashes/semicolons. Não insira novas linhas pois isso poderá quebrar a saída do HTML.
 * Lista
 * Uma lista pode se tornar excessivamente longa, então prefira dividí-la em listas de até cinco itens correspondentes.
 * Uma lista pode se tornar excessivamente longa, então prefira dividí-la em listas de até cinco itens correspondentes.

or


 * Números
 * With numbers and other non-linguistic elements you may want to pull the actual number out of translation and make it a variable. This has multiple benefits:
 * With numbers and other non-linguistic elements you may want to pull the actual number out of translation and make it a variable. This has multiple benefits:


 * You can update the number without invalidating translations.
 * Translation memory can work better when the changing number is ignored.

Note that this prevents the translators from localising the number by doing currency conversion. The  call makes sure the number is formatted correctly in the target language.


 * Predefinições
 * Templates have varying functions and purposes, so the best solution depends on what the template is for. If the template is not a part of longer paragraph, it should be left out, unless it has parameters that need to be translated. If the template has no linguistic content itself, you don't need to do anything for the template itself.
 * For an example of templates translated with page translation, see . To use this template, you need to have another template similar to Translatable navigation template, because you cannot include the template by  anymore. This is not yet provided by the Translate extension itself, but that is in the plans.
 * For an example of templates translated with page translation, see . To use this template, you need to have another template similar to Translatable navigation template, because you cannot include the template by  anymore. This is not yet provided by the Translate extension itself, but that is in the plans.

Another way is to use the unstructured element translation to translate the template, but then the language of the template will follow the user's interface language, not the language of the page they are viewing.

In some circumstances the additional markup added by this wrapping is not suitable.
 *  Attributes 
 * By default the Translate extension may wrap outdated translation units to highlight them and untranslated units to set proper language metadata.
 * By default the Translate extension may wrap outdated translation units to highlight them and untranslated units to set proper language metadata.

can be used to avoid that. 2020-09-15 is The above input may render as:
 *  Translation language 
 * When text is using language-dependent formatting methods, a mismatch may appear for untranslated sections.
 * When text is using language-dependent formatting methods, a mismatch may appear for untranslated sections.
 * : 2020-09-15 is Tuesday.
 * : 2020-09-15 on tiistai.

Without the magic word, untranslated text on a Finnish translation page would render as:
 * 2020-09-15 is tiistai
 * }

Alteração do texto de origem
Princípios gerais:


 * Evite alterações
 * Efetue alterações tão isoladas quanto possível
 * Não adicione marcadores de unidades de tradução por sua conta

Unit markers. When page is marked for translation, the system will update the translatable page source and add unique identifiers, called "unit markers", for each translation unit. Veja o exemplo abaixo. These unit markers are crucial for the system, which uses them to track changes to each translation unit. You should never add unit markers yourself. The unit markers are always on the line before the unit; or, if it starts with a header, after the first header on the same line. The different placement for headers is needed to keep section editing working as expected.

{{#tag:syntaxhighlight| {{^(}}translate{{)^}}

Birds
!--T:1-- Birds are animals which....

!--T:2-- Birds can fly and... /translate
 * lang=html}}

Changing unit text. Changing is the most common operation for translation units. You can fix spelling mistakes, correct grammar or do other changes to the unit. When re-marking the page for translation, you will see the difference in the unit text. The same difference is also shown to translators when they update their translations. For simple spelling fixes and other cases where you don't want the existing translations to be highlighted on the translated pages, you can avoid invalidating them: translators will still see the difference if they ever update the translation for any reason.

Adding new text. You can freely add new text inside tags. Make sure that there is one empty line between adjacent units, so that the system will see it as a new unit. You can also add tags around the new text, if it is not inside existing  tags. Again, do not add unit markers yourself, the system will do it.

Deleting text. You can delete whole units. If you do so, also remove the unit marker.

Splitting units. You can split existing units by adding an empty line in the middle of a unit, or by placing tags so that they split the unit. You can either keep the unit marker with the first unit or remove it altogether. In the first case, translators see the old text when updating the old translation. If you removed the unit marker, both units will behave as if no translation ever existed, after the page is re-marked for translation.

Merging units. If you merge units, you have to remove at least all but one unit marker.

Moving units. You can move units around without invalidating translations: just move the unit marker together with the rest of the unit.

Before marking the new version of the page for translation, ensure that the best practices are followed, especially that translators get a new translation unit if the content has changed. Also make sure that there are no unnecessary changes to prevent wasting translators time. If the source page is getting many changes, it may be worthwhile to wait for it to stabilize, and push the work for translators only after that.

Unused unit translations are not deleted automatically, but that should not cause trouble.

Migração para a tradução de páginas
If you have been translating pages before using the page translation system, you might want to migrate the pages to the new system, at least the ones you expect to have new translations and want statistics for. You will probably have existing templates for language switching and maybe different page naming conventions.

You can start migration by cleaning up, tagging and marking the source page. You can keep the existing language-switching templates while you migrate the old translations. If your pages follow the language code subpages naming convention, they will be replaced with the source text after marking the source page for translation, but you'll still be able to access translations from history.

This manual task has been partly automated by Special:PageMigration, which shows the source and target units besides each other and allows the user to adjust the units by providing a set of features mentioned later in this page.

Como utilizar?
500px| Screenshot showing an example use of Special:PageMigration for "Help:Special pages" as page name and "fr" as language code.
 * 1) Ir para Special:PageMigration
 * 2) Enter the title of the page and the language code. For example, "Help:Special pages" & "fr"
 * 3) The source text which was divided into units by Translate and the imported translations will be shown besides each other with some initial alignment.
 * 4) Use the actions available for each unit to manually do the remaining alignment
 * 5) As translated units are editable, do required manual improvements (for add translation variables, fix links and markup, etc.)
 * 6) Click on the "" button. This will create pages under the Translations namespace of the form  . The old translations have been imported into Translate.
 * 7) Else, if you wish to abort the importing, click on the 'Cancel' button.

Ações disponíveis
Each row consisting of source and target unit has a set of action icons. They are used as follows:
 * 1) Add: Clicking on this action icon adds a new empty unit below the current one. Use this feature if you want to split the current unit and need a unit below.
 * 2) Swap: Clicking on this action icon swaps the content of the current unit with the unit below it. You can use this feature when the units get aligned improperly due to different ordering of sections. Or when you need to drag a unit below or above. In either case, remember it swaps with the unit below and does not create any additional units.
 * 3) Delete: Clicking on this action icon completely removes the corresponding target unit from the page and shifts the remaining target units up by one unit. Use this to remove unwanted content like code or imported translations which are present completely in the source language. Note: this irrevocable action (in the current session).

Resolução de problemas

 * 1) If you mark a page for translation and immediately go to the special page and try to import translations, you may get an error message like "". This is because FuzzyBot didn't fuzzy the messages on the old page yet: the tool won't find an edit by FuzzyBot on the translation page. In this case, simply wait for FuzzyBot to do its job. Once an edit is seen, you can proceed with the imports.
 * 2) Please wait for some time after pressing the "" button. While the button background remains gray, there is an ongoing process of importing non-empty units. Once the button becomes colored again, the import is completed.

Sugestões

 * 1) Migration will be easier if you first (before the mark to translation) check whether existing translations are similar to the original English text, and manually edit the structure of pages: break paragraphs and lists, add the missing headers (even if empty).
 * 2) Will be useful to check the result in the core translation interface - some of the units may be immediately marked as obsolete because of errors markup or if not all of the translation variables was added.
 * 3) Translation of the page title will have to be added manually. If you do not know very well the language of the imported page, you can try to find the translation of the page title among the "links here" or sometimes in redirects.