Difference between revisions of "Wiki Translation Infrastructure"

From Mudlet
Jump to navigation Jump to search
(Created page with "{{TOC right}} The Mudlet Wiki uses a set of extensions to enable translation of the wiki contents. The MediaWiki Language Extension Bundle provides all the tools needed to m...")
 
(Added update tool details.)
Line 7: Line 7:
  
 
Simply put, every day at 1:00 AM UTC the mudlet.org server runs some tasks to import translations from Crowdin and export existing sources from the Wiki.   
 
Simply put, every day at 1:00 AM UTC the mudlet.org server runs some tasks to import translations from Crowdin and export existing sources from the Wiki.   
The sources are extracted from the English version of any page that is ready for translation.  The sources are uploaded after importing translations has finished.
+
The sources are extracted from the English version of any page that is ready for translation.  The sources are uploaded after importing translations has finished.
 +
 
 
Translations can only be made once the source is uploaded, so this method may cause a delay.   
 
Translations can only be made once the source is uploaded, so this method may cause a delay.   
  
Translations can be made on the wiki and both sources and translations can be exported from the wiki using the [[Special:ExportTranslations|Export Translations]] page.   
+
Translations can be made on the wiki. Sources and translations can be manually exported from the wiki using either the [[Special:ExportTranslations|Export Translations]] page, or by using the web tool described in "Forcing Updates" section.   
 +
 
 
Sources and Translations can be uploaded to Crowdin manually, provided they are exported from the wiki using the "Export for off-line translation" option.
 
Sources and Translations can be uploaded to Crowdin manually, provided they are exported from the wiki using the "Export for off-line translation" option.
Do note, some page titles contain colon <code>:</code> characters and those must be replaced with <code>=</code> characters before uploading to Crowdin!
 
  
All the scripts required can be located in <code>/var/www/i18n/</code> and <code>/var/www/wiki/</code> on the server.   
+
Do note, some page titles contain colon <code>:</code> characters and those must be replaced with equals sign <code>=</code> characters before uploading to Crowdin!
 +
 
 +
All the scripts required can be located in <code>/var/www/i18n/</code> and <code>/var/www/wiki/</code> on the server.  The update task is scheduled via the service user's crontab.   
  
  
 
== How to Use ==
 
== How to Use ==
  
To enable a page for translations, a wiki admin or moderator first needs to [[Special:PagePreparation|Prepare for Translation]] their desired page(s).  The preparation adds some initial markup to review and help you get started.   
+
To enable a page for translations, a wiki admin or moderator first needs to [[Special:PagePreparation|Prepare for Translation]] the desired page(s).  The preparation adds some initial markup to review and help them get started.   
  
Once a page is prepared, you can edit the Translation Markup to better suit your translation needs, or prune out Wikitext for translators where possible.   
+
Once a page is prepared, they can edit the Translation Markup to better suit translation needs, or prune out Wikitext for translators where possible.   
  
After the page is prepared and the Translate Markup is finished, the pages must be [[Special:PageTranslation|Marked for Translation]] which will show you a list of "translation units" the page created based on the Translate Markup.  Be sure to enable translation of the page display title if it is not already enabled!   
+
After the page is prepared and the Translate Markup is finished, the pages must be [[Special:PageTranslation|Marked for Translation]] which will list off "translation units" the page created based on its Translate Markup.  Be sure to enable translation of the page display title if it is not already enabled!   
  
 
With a page properly marked for translation, the imports, exports, and translations can begin.  
 
With a page properly marked for translation, the imports, exports, and translations can begin.  
  
  
Extensive changes to a page may require it to be marked for translation again, to help keep translation units manageable for translators.
+
Extensive changes to a page may require it to be marked for translation again, to help keep translation units manageable for translators.  
 +
 
  
 +
== Forcing Updates ==
 +
Wiki Translations and Crowdin Sources can be updated manually by using the Wiki Translations update tool found at https://make.mudlet.org/wiki-translations.php 
  
Planned -- Web-enabled request to manually fire the translation update tasks.
+
You can pass the following values as a URL Parameter to force specific updates:
 +
* <code>update=all</code>  -- Forces both import and export, the same actions as the daily task.
 +
* <code>update=wiki</code>  -- Forces download and import of translations from Crowdin to the Wiki.
 +
* <code>update=crowdin</code> -- Forces export and upload of English source-texts from Wiki to Crowdin.  
  
  

Revision as of 05:16, 20 June 2020

The Mudlet Wiki uses a set of extensions to enable translation of the wiki contents. The MediaWiki Language Extension Bundle provides all the tools needed to make translations directly on the wiki. However, Mudlet makes use of Crowdin to translate texts throughout the Mudlet project. This page describes the infrastructure that was built to enable translations from Crowdin.


How it Works

Simply put, every day at 1:00 AM UTC the mudlet.org server runs some tasks to import translations from Crowdin and export existing sources from the Wiki. The sources are extracted from the English version of any page that is ready for translation. The sources are uploaded after importing translations has finished.

Translations can only be made once the source is uploaded, so this method may cause a delay.

Translations can be made on the wiki. Sources and translations can be manually exported from the wiki using either the Export Translations page, or by using the web tool described in "Forcing Updates" section.

Sources and Translations can be uploaded to Crowdin manually, provided they are exported from the wiki using the "Export for off-line translation" option.

Do note, some page titles contain colon : characters and those must be replaced with equals sign = characters before uploading to Crowdin!

All the scripts required can be located in /var/www/i18n/ and /var/www/wiki/ on the server. The update task is scheduled via the service user's crontab.


How to Use

To enable a page for translations, a wiki admin or moderator first needs to Prepare for Translation the desired page(s). The preparation adds some initial markup to review and help them get started.

Once a page is prepared, they can edit the Translation Markup to better suit translation needs, or prune out Wikitext for translators where possible.

After the page is prepared and the Translate Markup is finished, the pages must be Marked for Translation which will list off "translation units" the page created based on its Translate Markup. Be sure to enable translation of the page display title if it is not already enabled!

With a page properly marked for translation, the imports, exports, and translations can begin.


Extensive changes to a page may require it to be marked for translation again, to help keep translation units manageable for translators.


Forcing Updates

Wiki Translations and Crowdin Sources can be updated manually by using the Wiki Translations update tool found at https://make.mudlet.org/wiki-translations.php

You can pass the following values as a URL Parameter to force specific updates:

  • update=all -- Forces both import and export, the same actions as the daily task.
  • update=wiki -- Forces download and import of translations from Crowdin to the Wiki.
  • update=crowdin -- Forces export and upload of English source-texts from Wiki to Crowdin.


Helpful Reading