Jump to content

Help:Extension:Translate/Group management/tr

From mediawiki.org
This page is a translated version of the page Help:Extension:Translate/Group management and the translation is 3% complete.

After configuring groups they must be processed. This means that definition texts are indexed and needed caches are populated. For this, you need to run importExternalTranslations.php to process the changes. You can run this maintenance script as given below.

From the MediaWiki root directory:

php maintenance/run.php ./extensions/Translate/scripts/importExternalTranslations.php

The above mentioned script finds out changes in the messages and makes only these changes available for processing to save time. The changes include:

  • changes in English message contents
  • changes in message documentation contents
  • mismatching contents for group/language
  • additional entries in a file for a group/language (i.e. externally maintained)

Groups that have changes requiring review are listed on Special:ManageMessageGroups. On this special page, incoming changes to file based message groups (FileBasedMessageGroup) can be reviewed and accepted or rejected. Note: $wgCacheDirectory must be set in LocalSettings.php for Special:ManageMessageGroups to work. For each changed message, the admin can choose to import the change, mark it as fuzzy, or ignore it.

Automatic import options

By default, all detected changes are queued for manual review on Special:ManageMessageGroups.

Two flags allow safe changes to be imported automatically without review:

--safe-import
Automatically imports additions for a language when that language has only additions and no deletions or changes. Any language with a more complex changeset is still sent to Special:ManageMessageGroups.
--import-non-renames
Automatically imports additions and changes for a language as long as it has no deletions. Deletions are excluded because they may indicate a rename that requires manual review.
php maintenance/run.php ./extensions/Translate/scripts/importExternalTranslations.php --safe-import
php maintenance/run.php ./extensions/Translate/scripts/importExternalTranslations.php --import-non-renames

Exporting translations

After translations have been reviewed and imported, they can be exported back to files using export.php:

php maintenance/run.php ./extensions/Translate/scripts/export.php --group <group-id> --lang * --target /path/to/output

Useful options:

--threshold
Minimum translation completion percentage required before a new file is created.
--removal-threshold
If a language falls below this percentage, its file is deleted.
--no-fuzzy
Exclude messages marked as fuzzy from the export.
--skip-source-language
Do not export the source language file.

Strong synchronization

Strong synchronization is a mechanism which prevents corruption of translation data caused by synchronization issues. It does this by keeping track of synchronization events and blocking unsafe actions if synchronization is in progress, incomplete or has a failure. It was created to address problems that state synchronization could not. Örneğin:

  1. Upstream modifies all translation files: for example, by updating a copyright date in a string and removing some unused strings (basically, any changes that make --safe-import to not process changes automatically).
  2. We update the read-only checkout from version A to latest version B.
  3. We do not process changes using Special:MessageGroupChanges
  4. We export and commit translations on top of B (but based on A) to create version C.

Upstream changes in version B are lost. For the next import we automatically update our read-only checkout to version C, so we never see or process changes in B.

The process

Incoming changes from source repositories are processed via the MessageUpdateJob background job. We've added a group synchronization cache that tracks:

  1. groups in sync – groups that have messages being processed via MessageUpdateJob in the job queue
  2. groups with errors – groups that have had messages update processing errors
  3. group in review – groups whose messages are waiting to be reviewed

Message update processing errors are identified by looking at messages that are still present in the group synchronization cache as "in sync" after a certain period of time. On rare occasions it may happen that the MessageUpdateJob was completed but did not inform the group synchronization cache that it was done. Such errors can be identified by looking at the message's content to see if it has been updated.

When running exports, following groups are skipped:

  1. groups in sync
  2. groups with errors
  3. group in review

This ensures that changes from Translate are not pushed out until incoming changes from source repositories are processed first.

Similarly when processing incoming changes, following groups are skipped:

  1. groups in sync
  2. groups with errors

This will ensure that changes from remote sources do not override choices made when processing changes in Special:MessageGroupChanges.

Administrators can see groups in review and groups with errors on Special:MessageGroupChanges. For groups with error, review the messages that have failed, and resolve them after verifying that the updates are properly applied.

Global Synchronization Lock

For the import and export scripts, a global sync lock has been added to ensure that exports and imports cannot be run simultaneously. The ideal workflow would involve first running the imports, allowing all groups to finish processing, and then running the exports.

If a group becomes stuck in the synchronization cache, it can be cleared using the clearGroupSyncCache.php maintenance script:

php maintenance/run.php ./extensions/Translate/scripts/clearGroupSyncCache.php --group <group-id>
php maintenance/run.php ./extensions/Translate/scripts/clearGroupSyncCache.php --all

In exceptional recovery situations, the synchronization cache check can be bypassed entirely by passing --skip-group-sync-check to either the import or export script:

php maintenance/run.php ./extensions/Translate/scripts/importExternalTranslations.php --skip-group-sync-check
php maintenance/run.php ./extensions/Translate/scripts/export.php --group <group-id> --lang * --target /path/to/output --skip-group-sync-check

Ayrıca bakınız