Jump to content
MediaWiki

Ajuda:Extensão:Translate/Mover página traduzível

From mediawiki.org
This page is a translated version of the page Help:Extension:Translate/Move translatable page and the translation is 28% complete.
Documentação para Extensão: Translate
Leitura prévia recomendada: Ajuda: Mover uma página

Ao mover uma página de origem que foi traduzida para outros idiomas utilizando a extensão "Translate", juntamente com a página fonte, as páginas de tradução também têm de ser movidas. As páginas de tradução existem como subpáginas da página fonte. For example, if we have a source page with the name FooBar, and the page has been translated to French, and Spanish, then the translation pages will exist at FooBar/fr and FooBar/es

The process to move a translated source page is the same as a normal page. The difference is in the way the subpages are moved.

In the image, we are moving a translatable source page. There are a few sections to note here,

  1. Página de tradução - Estes são os idiomas para os quais a página de origem foi traduzida. Isto será movido.
  2. Páginas da unidade de tradução - These are the smallest individually tracked component of translatable pages: the page is divided into paragraph-sized translation units and each unit is a message. All of these will also be moved.
  3. Subpage marked for translation - These are other translatable source pages that exist as subpages under the source page that is being moved. These cannot be moved as part of the current move operation but has to be moved separately.
  4. Outras subpáginas - These are normal subpages under the source translatable page that is being moved. The user can choose to move this by selecting the Move all subpages option on the screen.

Talk pages if present are also moved. Pages that have talk pages are denoted with a (Has talk page) suffix. Similar to subpages marked for translation, translatable talk pages have to be moved separately.

Once the user initiates the move process, the actual moving will be done via background jobs. The status of the "move job" can be tracked via the Page translation log.

Leaving a redirect: we provide a checkbox option that adds redirects for everything except translation unit pages and translation pages (translatable page, talk pages, regular subpages and their talk pages) once a page is moved.

From the user interface, by default, a maximum of 500 pages can be moved. This can be changed by modifying the config $wgTranslatePageMoveLimit. We recommend using the moveTranslatableBundle.php to move a large number of pages.

Mover um grande número de páginas

To move a large number of pages, we recommend using the script moveTranslatableBundle.php as it can be slightly unreliable to do so via the UI, which uses the job queue to move the pages.

While moving the page, the script will perform the necessary validations, display what will be moved, and then take confirmation from the user before performing the move.

The script takes the following parameters:

current-page Required Nome da página atual
new-page Required Novo nome da página
user Required Utilizador que realiza a mudança
reason Optional Motivo para a realização da mudança
skip-subpages Optional Skip moving subpages under the current page
skip-talkpages Optional Skip moving talkpages under the current page
skip-redirect Optional Skip leaving a redirect behind for translatable bundle, subpages and related talk pages

Exemplo de utilização:

# Here "Main Page 60" is being renamed to "Main Page 70" by "Admin"
php extensions/Translate/scripts/moveTranslatableBundle.php "Main Page 60" "Main Page 70" Admin --reason "Just an example" --skip-redirect

Mover as páginas traduzidas entre wikis

At times it maybe necessary to move translatable pages and message bundles across different wikis. This can be done via multiple approaches:

  • Through maintenance scripts

Maintenance script

There are two scripts that can be used to export a translatable bundle from 1 wiki and then import it to another wiki.

Exporting

To export the translatable bundle, run the export script on the wiki where the translatable bundle exists.

This will create a file, that can be then used for import on the target wiki.

$phpmaintenance/run.php./extensions/Translate/scripts/exportTranslatableBundle.php--translatable-bundle"Page to translate"--filename/var/www/html/w/translate-2023年05月22日.xml--include-talk-pages--include-subpages
Exporting1page(s)oftypetranslatablebundle.
Exporting5page(s)oftypetranslation.
Exporting23page(s)oftypetranslationunit.
Exporting1page(s)oftypetalkpages.
Exporting0page(s)oftypetranslatabletalk.
Exporting1page(s)oftypesubpage.
Done!Exportedbundle'Translate-2023年05月22日'to'/var/www/html/w/translate-2023年05月22日.xml'.

The script expects the following parameters:

  • --translatable-bundleName of the translatable page to export
  • --filenameName and path to save the export file to
  • --include-talk-pages – (Optional) Include talk pages
  • --include-subpages – (Optional) Include subpages.

Importing

The file exported can then be imported into another wiki by running the import script:

phpmaintenance/run.php./extensions/Translate/scripts/importTranslatableBundle.phptranslate-2023年05月22日.xml--userAdmin--interwiki-prefix"1"--comment"Hello world"
Completedimportoffile.Createdpage'Translate-2023年05月22日'
Youcannowmarkthepage'Translate-2023年05月22日'fortranslation.

The script expects the following parameters:

Required? Description
Path Required Path to the exported XML file
--user Required Name of the user performing the import
--interwiki-prefix Required Prefix to apply to unknown (and possibly also known) usernames
--assign-known-users Optional Whether to apply the prefix to usernames that exist locally
--comment Optional Comment added to the log for the import.

Limitation

  • This only tags the translation, but does not mark the page for translation. That has to be done manually
  • For translatable pages, metadata such as priority languages are not exported / imported. Please add them when marking the page for translation.

Referências

AltStyle によって変換されたページ (->オリジナル) /