Help:Extension:Translate/メッセージ群の保守

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

メッセージ群の構成が終了したら、それらを処理します。 この処理では、定義文のインデックスと必要なキャッシュが構築されます。 そのため、変更を処理するために processMessageChanges.php を実行する必要があります。 このメンテナンス スクリプトは、下記の手順で実行できます。

Translate 拡張機能のディレクトリで以下を実行します:

php scripts/processMessageChanges.php

上記のスクリプトは、メッセージの変更点を検出し、時間節約のためにこれらの変更点のみを利用可能にします。変更点は以下を含みます:

  • 英語のメッセージ内容の変更
  • メッセージの説明文の変更
  • メッセージ群/言語の本文の不整合
  • メッセージ群/言語単位でファイル内に現れる追加的な項目 (外部で保守される)

新しいスタイル群はSpecial:ManageMessageGroups に進み、すべての言語を再構築 (インポート) します。 この特別ページでファイル単位のメッセージ群 (FileBasedMessageGroup) を管理します。 このページではファイルのキャッシュの更新、翻訳元言語のメッセージのインポートと曖昧化、その他の言語のメッセージのインポート/更新を行います。

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. 例:

  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.

関連項目