Difference between revisions of "Translating the Glossary"

(Created page with "==Introduction== Translating the Glossary poses particular challenges. This page describes them and provides a method of overcoming them. ==Structure of the Glossary== Each g...")
 
 
(2 intermediate revisions by the same user not shown)
Line 3: Line 3:
  
 
==Structure of the Glossary==
 
==Structure of the Glossary==
Each glossary definition is a separate page. The Glossary itself simply comprises a table with technical terms in the first column and their definitions in the second, transcluded from the definitions pages. So, for example, we can have separate glossary entries for both AC and Alternating Current but poth transcluding the same definition page.
+
Each glossary definition is a separate page. The Glossary itself simply comprises a table with technical terms in the first column and their definitions in the second, [[mediawikiwiki:Transclusion|transcluded]] from the definitions pages. So, for example, we can have separate glossary entries for both AC and Alternating Current, both of which transclude the same definition page.
  
It also means that individual definitions can be referenced from elsewhere in the wiki, providing useful pop-up definitions for terms as you hover over them.
+
It also means that individual definitions can be referenced from elsewhere in the wiki. Simply hovering over the links will give definitions as popups.
  
 
Tables are a littly tricky to set up in wikimedia, and in addition, there is a little extra infrastructure overhead. Thus it is ''essential'' that new entries in the Glossary follow the format of existing ones ''exactly''.
 
Tables are a littly tricky to set up in wikimedia, and in addition, there is a little extra infrastructure overhead. Thus it is ''essential'' that new entries in the Glossary follow the format of existing ones ''exactly''.
  
 
==Translation challenges==
 
==Translation challenges==
 +
The Mediawiki Language Extension Bundle does not allow the content of a page to be rearranged in translated pages, except within individual Translation Units, which are typically single paragraphs. This creates a problem since technical terms in different languages may be alphebetisised differently, for example, DC or Direct Current in English is CD or Courant Direct in French. This means we can't simply translate the Glossary but must create a new one in each language. Thus the French glossary will be Glossaire and will have its source language set as French (Special Pages - Page Tools - Change the language of a page).
  
 +
A useful facility within the Transate extension is Special:MyLanguage/. If this is prefixed to a link, your current language setting is not the source language of the link destination page but a translation of the page into your language exists, then following the link takes you to that translation rather than the source language page. However, a major disadvantage is that this breaks both popups and transclusion. A [https://phabricator.wikimedia.org/T145541 bug report] on Mediawiki covering this has been open for several years but with no immediate problem of it being fixed we must unfortuately avoid using this feature until it is. In the meantime, a script will be written which will list all links to source language pages in translated pages where there exists a translation into the same language of the target page. This will be run regularly and the links updated manually. The rate of updates to the wiki is such that this should not be excessively onerous.
 +
 +
A further minor irritation surfaces on translating a definition. Additional tags are automatically added on preparing the page for translation and marking it for translation. Unfortunately these then appear in transcluded ot popup text. To overcome this the tags <onlyinclude></onlyinclude> must be inserted to surround theactul definition in the source language version of a definition.
  
 
==Definition translation worked example==
 
==Definition translation worked example==
 +
Before initiating the translation of a glossary definition page it is highly recommended that the definition be braketed by the <nowiki><onlyinclude></onlyinclude></nowiki> tags. (You can add them later if you forget but meanwhile the tags inserted by the translation process will be visible in transcluded and popup text.)
 +
 +
Note that these tags should ''not'' be on separate lines but should be on the same line(s) as the start and end of the definition itself, e.g.
 +
<pre><onlyinclude>Electricity: tamed magic... well, mostly tamed.</onlyinclude></pre>
 +
otherwise surplus blank lines will appear in transcluded and popup text.
 +
 +
You can now Prepare the page for Translation and Mark it for Translation in the normal way. The <nowiki><onlyinclude></onlyinclude></nowiki> tags do not need to be transcribed into the translation but will do no harm if they are.
 +
 +
It remains to update the definition in the local language glossary. Thus, for example:
 +
<pre>|-
 +
|<span id="Electricity">Electricity</span>
 +
|
 +
{{Glossary:Electricity}}</pre>
 +
in Glossaire becomes
 +
<pre>|-
 +
|<span id="Electricité">Electricité</span>
 +
|
 +
{{Glossary:Electricity/fr}}</pre>
 +
In some cases (though not in this one) the item will need relocating in order to preserve alphabetic ordering.
 +
 +
Where there are synonymns or a definition and its abreviation are both listed, these will similarly need modification.

Latest revision as of 10:57, 4 June 2021

Introduction

Translating the Glossary poses particular challenges. This page describes them and provides a method of overcoming them.

Structure of the Glossary

Each glossary definition is a separate page. The Glossary itself simply comprises a table with technical terms in the first column and their definitions in the second, transcluded from the definitions pages. So, for example, we can have separate glossary entries for both AC and Alternating Current, both of which transclude the same definition page.

It also means that individual definitions can be referenced from elsewhere in the wiki. Simply hovering over the links will give definitions as popups.

Tables are a littly tricky to set up in wikimedia, and in addition, there is a little extra infrastructure overhead. Thus it is essential that new entries in the Glossary follow the format of existing ones exactly.

Translation challenges

The Mediawiki Language Extension Bundle does not allow the content of a page to be rearranged in translated pages, except within individual Translation Units, which are typically single paragraphs. This creates a problem since technical terms in different languages may be alphebetisised differently, for example, DC or Direct Current in English is CD or Courant Direct in French. This means we can't simply translate the Glossary but must create a new one in each language. Thus the French glossary will be Glossaire and will have its source language set as French (Special Pages - Page Tools - Change the language of a page).

A useful facility within the Transate extension is Special:MyLanguage/. If this is prefixed to a link, your current language setting is not the source language of the link destination page but a translation of the page into your language exists, then following the link takes you to that translation rather than the source language page. However, a major disadvantage is that this breaks both popups and transclusion. A bug report on Mediawiki covering this has been open for several years but with no immediate problem of it being fixed we must unfortuately avoid using this feature until it is. In the meantime, a script will be written which will list all links to source language pages in translated pages where there exists a translation into the same language of the target page. This will be run regularly and the links updated manually. The rate of updates to the wiki is such that this should not be excessively onerous.

A further minor irritation surfaces on translating a definition. Additional tags are automatically added on preparing the page for translation and marking it for translation. Unfortunately these then appear in transcluded ot popup text. To overcome this the tags must be inserted to surround theactul definition in the source language version of a definition.

Definition translation worked example

Before initiating the translation of a glossary definition page it is highly recommended that the definition be braketed by the <onlyinclude></onlyinclude> tags. (You can add them later if you forget but meanwhile the tags inserted by the translation process will be visible in transcluded and popup text.)

Note that these tags should not be on separate lines but should be on the same line(s) as the start and end of the definition itself, e.g.

<onlyinclude>Electricity: tamed magic... well, mostly tamed.</onlyinclude>

otherwise surplus blank lines will appear in transcluded and popup text.

You can now Prepare the page for Translation and Mark it for Translation in the normal way. The <onlyinclude></onlyinclude> tags do not need to be transcribed into the translation but will do no harm if they are.

It remains to update the definition in the local language glossary. Thus, for example:

|-
|<span id="Electricity">Electricity</span>
|
{{Glossary:Electricity}}

in Glossaire becomes

|-
|<span id="Electricité">Electricité</span>
|
{{Glossary:Electricity/fr}}

In some cases (though not in this one) the item will need relocating in order to preserve alphabetic ordering.

Where there are synonymns or a definition and its abreviation are both listed, these will similarly need modification.