Jump to content

Help:Extension:Translate/Group management: Difference between revisions

From mediawiki.org
Content deleted Content added
Adding «translate» tags
m Reverted edits by 2001:448A:5102:BC4F:E47A:4F9F:879A:108D (talk) to last version by Turkmen
Tag: Rollback
 
(37 intermediate revisions by 17 users not shown)
Line 1: Line 1:
<languages/>
<languages />
{{Extension-Translate}}
<translate><!--T:1-->
After [[<tvar|group-conf>Special:MyLanguage/Help:Extension:Translate/Group configuration</>|configuring groups]] they must be processed. This means that definition texts are indexed and needed caches are populated. For this, you need to run [[<tvar|cmscript>Special:MyLanguage/Help:Extension:Translate/Command line scripts</>|processMessageChanges.php]] to process the changes.
<translate><!--T:1--> After [[<tvar name=help>Special:MyLanguage/Help:Extension:Translate/Group configuration</tvar>|configuring groups]] they must be processed.</translate>
<translate><!--T:9--> This means that definition texts are indexed and needed caches are populated.</translate>
<translate><!--T:10--> For this, you need to run <tvar name=1>{{ll|Help:Extension:Translate/Command line scripts|processMessageChanges.php}}</tvar> to process the changes.</translate>
You can run this maintenance script as given below.
<translate><!--T:11--> You can run this maintenance script as given below.</translate>


<translate>
<!--T:2-->
<!--T:2-->
From the Translation extension directory:
From the Translate extension directory:
</translate>
</translate>


<syntaxhighlight lang="text" style="overflow:auto;">
<syntaxhighlight lang="bash">
php scripts/processMessageChanges.php
php scripts/processMessageChanges.php
</syntaxhighlight>
</syntaxhighlight>
Line 15: Line 18:
<!--T:3-->
<!--T:3-->
The above mentioned script finds out changes in the messages and makes only these changes available for processing to save time. The changes include:
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
<!--T:12-->
* changes in message documentation contents
* changes in English message contents</translate>
* mismatching contents for group/language
<translate>
<!--T:13-->
* changes in message documentation contents</translate>
<translate>
<!--T:14-->
* mismatching contents for group/language</translate>
<translate>
<!--T:15-->
* additional entries in a file for a group/language (i.e. externally maintained)
* additional entries in a file for a group/language (i.e. externally maintained)
</translate>


<translate><!--T:4--> For new style groups head to <tvar name=ManageMessageGroups>{{blue|Special:ManageMessageGroups}}</tvar> and rebuild (import) all languages.</translate>
<!--T:4-->
For new style groups head to {{blue|Special:ManageMessageGroups}} and rebuild (import) all languages. On this special page file based message groups can be managed (FileBasedMessageGroup). This page allows updating of the file cache, import and fuzzy for source language messages, as well as import/update of messages in other languages.
<translate><!--T:16--> On this special page file based message groups can be managed (FileBasedMessageGroup).</translate>
<translate><!--T:17--> This page allows updating of the file cache, import and fuzzy for source language messages, as well as import/update of messages in other languages.</translate>


<translate>
<!--T:5-->
== Strong synchronization == <!--T:20-->
{{TNT|note}} For old style groups use [[<tvar|cmscript>Special:MyLanguage/Help:Extension:Translate/Command line scripts</>|sync-group.php]]. This script also works for new style message groups, but you still need to use {{blue|Special:ManageMessageGroups}} to build the caches.
</translate>
<translate><!--T:21--> Strong synchronization is a mechanism which prevents corruption of translation data caused by synchronization issues.</translate>
<translate><!--T:22--> It does this by keeping track of synchronization events and blocking unsafe actions if synchronization is in progress, incomplete or has a failure.</translate>
<translate><!--T:23--> It was created to address problems that [[<tvar name=1>translatewiki:Repository management</tvar>|state synchronization]] could not.</translate>
<translate><!--T:24--> For example:</translate>


# <translate><!--T:25--> 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 <tvar name=1>--safe-import</tvar> to not process changes automatically).</translate>
<!--T:6-->
# <translate><!--T:26--> We update the read-only checkout from version A to latest version B.</translate>
For new style message groups you can use {{blue|Special:ManageMessageGroups}} to handle fuzzying. For old style message groups you need to track the changes manually and use [[<tvar|cmscript>Special:MyLanguage/Help:Extension:Translate/Command line scripts</>|fuzzy.php]] to mark translations as in need of an update.
# <translate><!--T:27--> We do '''not''' process changes using <tvar name=1>Special:MessageGroupChanges</tvar></translate>
# <translate><!--T:28--> We export and commit translations on top of B (but based on A) to create version C.</translate>


<translate><!--T:29--> Upstream changes in version B are lost.</translate>
<translate><!--T:30--> For the next import we automatically update our read-only checkout to version C, so we never see or process changes in B.</translate>

<translate>
=== The process === <!--T:31-->
</translate>
<translate><!--T:32--> Incoming changes from source repositories are processed via the <tvar name=1><code>MessageUpdateJob</code></tvar> background job.</translate>
<translate><!--T:33--> We've added a ''group synchronization cache'' that tracks:</translate>

# <translate><!--T:34--> groups in sync</translate> - <translate><!--T:35--> groups that have messages being processed via <tvar name=1><code>MessageUpdateJob</code></tvar> in the job queue</translate>
# <translate><!--T:36--> groups with errors</translate> - <translate><!--T:37--> groups that have had messages update processing errors</translate>
# <translate><!--T:38--> group in review</translate> - <translate><!--T:39--> groups whose messages are waiting to be reviewed</translate>

<translate><!--T:40--> 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.</translate>
<translate><!--T:41--> On rare occasions it may happen that the <tvar name=1><code>MessageUpdateJob</code></tvar> was completed but did not inform the group synchronization cache that it was done.</translate>
<translate><!--T:42--> Such errors can be identified by looking at the message's content to see if it has been updated.</translate>

<translate>
<!--T:43-->
When running exports, following groups are skipped:
</translate>

# <translate><!--T:44--> groups in sync</translate>
# <translate><!--T:45--> groups with errors</translate>
# <translate><!--T:46--> group in review</translate>

<translate>
<!--T:47-->
This ensures that changes from Translate are not pushed out until incoming changes from source repositories are processed first.

<!--T:48-->
Similarly when processing incoming changes, following groups are skipped:
</translate>

# <translate><!--T:49--> groups in sync</translate>
# <translate><!--T:50--> groups with errors</translate>

<translate>
<!--T:51-->
This will ensure that changes from remote sources do not override choices made when processing changes in <tvar name=1>Special:MessageGroupChanges</tvar>.
</translate>

<translate><!--T:52--> Administrators can see ''groups in review'' and ''groups with errors'' on <tvar name=1>Special:MessageGroupChanges</tvar>.</translate>
<translate><!--T:53--> For ''groups with error'', review the messages that have failed, and resolve them after verifying that the updates are properly applied.</translate>

<translate>
==== Global Synchronization Lock ==== <!--T:54-->
</translate>
<translate><!--T:55--> For the import and export scripts, a global sync lock has been added to ensure that exports and imports cannot be run simultaneously.</translate>
<translate><!--T:56--> The ideal workflow would involve first running the imports, allowing all groups to finish processing, and then running the exports.</translate>

<translate>
==See also== <!--T:7-->
==See also== <!--T:7-->


<!--T:8-->
<!--T:8-->
*[[translatewiki:Repository management]] and related pages have some information of general use
*[[<tvar name=1>translatewiki:Repository management</tvar>|Repository management]] and related pages have some information of general use
</translate>
</translate>


{{TNT|Extension-Translate}}
[[Category:Extension:Translate{{#translation:}}|Group management]]
[[Category:Extension:Translate{{translation}}|{{SUBPAGENAME}}]]

Latest revision as of 12:13, 15 January 2024

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 processMessageChanges.php to process the changes. You can run this maintenance script as given below.

From the Translate extension directory:

php scripts/processMessageChanges.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)

For new style groups head to Special:ManageMessageGroups and rebuild (import) all languages. On this special page file based message groups can be managed (FileBasedMessageGroup). This page allows updating of the file cache, import and fuzzy for source language messages, as well as import/update of messages in other languages.

Strong synchronization

[edit]

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. For example:

  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

[edit]

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

[edit]

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.

See also

[edit]