Most of the translations managed by the translation coordinator for the MX project are for strings of words occurring in applications. These can be handled in a systematic way. See the wiki article for “handling apps”.
But there are a few cases where the translations are for text files of various kinds and formats. These files require a custom approach:
- apt notifier policy files
- desktop files
- gazelle installer services list
- MX package installer files
- Thunar file manager custom actions
Note that the scripts referred to in the following are all in the repo https://github.com/MX-Linux/translation-tools
apt notifier policy files
GitHub repo: apt-notifier
Transifex resource: apt-notifier-policies
Text file layout
There are currently 7 policy files. They are part of the apt-notifier repo, and should be updated with translations at the same time as the apt-notifier app itself. An example:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE policyconfig PUBLIC
"-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
<description>Run MX Linux application</description>
<message xml:lang="am">መሰረታዊ ማሻሻያ</message>
<message xml:lang="ar">basic upgrade</message>
<message xml:lang="bg">basic upgrade</message>
<message xml:lang="ca">actualització bàsica</message>
<message xml:lang="cs">basic upgrade</message>
<message xml:lang="da">grundlæggende opgradering</message>
<message xml:lang="de">grundlegende Aktualisierung</message>
<message xml:lang="el">βασική αναβάθμιση</message>
<message xml:lang="es">actualización básica</message>
The only part that needs translation is the English in the <message> tags.
Checking for changes
- Ensure your apt-notifier repo is up to date with a git pull.
- Download the English file from the Transifex resource apt-notifier-policies.
- Compare the entries in the English file with the English message lines in all the policy files in the repo.
- If different, revise the downloaded English Transifex file, upload to Transifex, and wait for translations. Otherwise, proceed directly to next step.
Adding translations to the policy files
- Download the Transifex language files for the resource apt-notifier-policies.
- Run the script remake_policies. Cut and paste the blocks of messages into the respective policy files in the apt-notifier repo. (This could perhaps be automated.)
- Do git add, commit, and push to update the GitHub repo.
GitHub repo: not applicable
Transifex resource: mx-all-desktop-entries
Every gui app has associated with it a desktop file that resides in its repo.
For new apps, an entry is created in the Transifex resource at that time. For existing apps, the desktop file should be checked for new translations whenever the app is being updated for other reasons (addition of new strings, for example). This is covered in the wiki article on the normal handling of apps.
A mass update of every app’s desktop file is done when a complete translation refresh is being done. The process for this is covered in the wiki article on doing a refresh.
gazelle installer services list
GitHub repo: https://github.com/gazelle-installer/gazelle-installer-data.git
Transifex resources: gazelle-services-categories, gazelle-services-descriptions
Text file layout
The gazelle installer has a services.list file. It looks like this:
#services to include in installer
#format is servicename=category, Description
#for example ntp might be ntp=Admin, Network Time Protocol
#list is comma delimited
#use servicename_LN=category,Description for localizations
anacron=Admin, Runs commands periodically
cron=Admin, Time-based job scheduler
sudo=Admin, Execute a command as another user
plymouth=Admin, Plymouth boot splash
anacron_fi=Ylläpitäjä, Suorittaa komennot säännöllisesti
cron_fi=Ylläpitäjä, Time-based job scheduler
sudo_fi=Ylläpitäjä, Suorittaa komennon toisena käyttäjänä
plymouth_fi=Ylläpitäjä, Plymouth boot splash
The English text at the top is followed by blocks for specific languages. Note that the first component in each line, servicename, is invariant except for the addition of the language code, eg cron_fi. The second and third components, category and description, are what gets translated. They exist as two resources on Transifex: gazelle-services-categories and gazelle-services-descriptions.
Checking for changes
The first step is to see if there are any changes to the English categories or descriptions as they exist in the GitHub repo as compared to what’s already on Transifex.
- Download the English files of the two Transifex resources.
- If you already have a copy of the services.list file in your PC repo that reflects the current English values of the two Transifex resources, then save that copy somewhere and do a git pull to get the latest version. Compare the English lines at the top of the two versions.
- Otherwise, do a git clone of the GitHub repo. Compare the English in the services.list file with the two downloaded Transifex reources.
- In either case, if there are differences, then add the changes to the downloaded Transifex files, and update the Transifex resources. It’s likely that only the descriptions are affected as the categories change less frequently.
Remaking the services.list file
Once translations are ready, it is necessary to use them to make a new services.list file.
- Download the translations from Transifex for both the categories and description resources using the usual getmxtrans script.
- Use the script remake_services to combine the downloaded category and description files for every language into one services.list file. See the comments in that script for further explanation and detailed instructions on how to proceed.
- Add, commit, and push as normal.
MX package installer files
GitHub repo: mx-packageinstaller-pkglist
Transifex resources: mx-packageinstaller-categories, mx-packageinstaller-descriptions
Text file layout
The MX package installer is a bit like the gazelle installer data in that they both use a collection of categories and descriptions. However, the file structures are very different, and consequently so are the corresponding procedures used for handling the translations.
The MX package installer uses for data a series of .pm files contained in the directory /usr/share/mx-packageinstaller-pkglist. Each package has a single description that must be translated. And each package is grouped within one of the categories given in the category.dict file in the same directory and which also must be translated.
Here is abiword.pm:
<am>lightweight word processor</am>
<ar>lightweight word processor</ar>
<bg>lightweight word processor</bg>
<ca>Processador de text lleuger</ca>
<cs>lightweight word processor</cs>
<de>Eine voll funktionsfähige und effiziente Textverarbeitung</de>
<el>ελαφρύ επεξεργαστή κειμένου</el>
<en>lightweight word processor</en>
<es>Procesador de textos liviano</es>
Note that the pm files have English within <en> tags like any other language, while the category file has the English as the section header within .
Checking for changes
- Make sure you have an up to date copy of the GitHub repo mx-packageinstaller-pkglist.
- We could check for changes in categories by examining the category.dict file. But to be sure, we look at all the categories used in the pm files. To do that, we use the extract_pkglist script.
- copy your repo directory mx-packageinstaller-pkglist to here (where you have your extract_pkglist script), so that the directory name (not the files) are on the same level as the script
- ./extract_pkglist category
- sort category.extract > category.sort
- uniq category.sort > category.uniq
- now download the English from the Transifex resource mx-packageinstaller-categories and compare with category.uniq
- if different, upload a revised file to Transifex and ask for translations
- To check for changes in the descriptions as a result of new/revised/deleted pm files, do this:
- ./extract_pkglist_en en
- download the English from the Transifex resource mx-packageinstaller-descriptions and diff that with en.extract.
- if different, upload the en.extract file to Transifex and ask for translations
Remaking the category and packages files
Before attempting to remake the package installer files, you must ensure that the lines in your Transifex resource are still in a one-to-one correspondence with the list of .pm files on GitHub. Check the activity for GitHub repo mx-packageinstaller-pkglist. Have there been any commits since you did the “Checking for changes” procedure above? To be even more sure, do a git pull inside your cloned repo.
If there are any changes, then you must go through the previous procedure again, extracting and uploading new resource files to Transifex. After doing that, you may either wait for more translations, or proceed directly with the remake procedure that follows knowing that translations for the most recent changes will not be there.
To remake the category.dict file:
- Download the Transifex files for mx-packageinstaller-categories. Include the English version.
- Use the remake_pkglist_cat script. Check its comments first to make sure you have the prerequisites.
- Compare your remade work-cat/category.dict file with the one in your cloned mx-packageinstaller-pkglist GitHub repo. Check for reasonableness. If your remade file is different and looks good, use it to overwrite the category.dict in your cloned repo.
To remake the pm files:
- Download the Transifex files for mx-packageinstaller-descriptions. Include its English version here too.
- Use the remake_pkglist_des script to remake the .pm package files. Check its comments first. Note especially that the non .pm files have to be removed from the pm work directory.
- The script compares for you the remade files with the ones you copied from your cloned repo. Files that were updated with new translations are in work-des/diff_pm/. The file work-des/diff.txt shows the differences. If they are reasonable, copy these updated pm files from work-des/diff_pm/ to your cloned repo.
Now you can do the regular git status, add and commit. Then push and notify the developer.
Thunar file manager custom actions
GitHub repo: desktop-defaults-xfce-mx
Transifex resource: mx-thunar-custom-actions
Text file layout
The Thunar file manager has a set of custom actions, accessed by right-clicking a file or directory in the list it displays. The names and descriptions of these custom actions ultimately end up in the file /etc/skel/.config/Thunar/uca.xml. It looks like this:
<?xml encoding="UTF-8" version="1.0"?>
<name>Run command ...</name>
<name xml:lang="am">ትእዛዝ ማስኬጃ ...</name>
<name xml:lang="ca">Executa ordre ...</name>
<name xml:lang="da">Kør kommando ...</name>
<name xml:lang="de">Befehl ausführen ...</name>
<name xml:lang="el">Εκτέλεση εντολής ...</name>
<name xml:lang="es">Ejecutar orden ...</name>
<description>Launch a program</description>
<description xml:lang="am">Launch a program</description>
<description xml:lang="ca">Engega un programa</description>
<description xml:lang="da">Start et program</description>
<description xml:lang="de">Ein Programm starten</description>
<description xml:lang="el">Ξεκινήστε ένα πρόγραμμα</description>
<description xml:lang="es">Iniciar un programa</description>
<name>Install Deb Files</name>
<name xml:lang="am">Install Deb Files</name>
<name xml:lang="ca">Instal·la fitxers Deb</name>
<name xml:lang="da">Installer deb-filer</name>
<name xml:lang="de">Deb Dateien installieren</name>
<name xml:lang="el">Εγκατάσταση αρχείων Deb</name>
<name xml:lang="es">Instalar Ficheros Deb</name>
<description>Install deb packages and dependencies with apt</description>
<description xml:lang="am">Install deb packages and dependencies with apt</description>
<description xml:lang="ca">Instal·la paquets deb i dependències amb apt</description>
<description xml:lang="da">Installer deb-pakker og -afhængigheder med apt</description>
<description xml:lang="de">Installieren von deb-Paketen und Abhängigkeiten mit apt</description>
<description xml:lang="el">Εγκαταστήστε πακέτα και εξαρτήσεις deb με apt</description>
<description xml:lang="es">Instalar paquetes deb y dependencias con apt</description>
Checking for changes
- Do a git pull to bring your repo desktop-defaults-xfce-mx up to date. The custom actions file is uca.xml in the repo sub-directory desktop-defaults-mx.
- Download the English file from Transifex resource mx-thunar-custom-actions.
- Compare the English names and descriptions to see if there have been any changes. There are only a few so you can check by eye, or write a little script to extract/compare.
- If there are changes, revise the downloaded English Transifex file so it matches the English in the repo uca.xml file, upload to Transifex, and wait for translations.
Remaking the custom actions file
- Download the Transifex files for mx-thunar-custom-actions using the getmxtrans script. Because you have uploaded any changes to the English in the current uca.xml file in your repo, the downloaded files from Transifex will have their names and descriptions in the exact same order. This is essential. If in doubt, do a cross-check between the uca.xml and the English Transifex file.
- For other resources, we use all the downloaded translation files. But for the Thunar custom actions, we weed out the ones with no translations just to make things more manageable. Transifex will tell you which languages have no translations (select order by completion percentage on Transifex). Also, do NOT include the English file.
- Use the remake_actions script from the same repository. This builds the name and description blocks (sans English). It does not recreate the entire uca.xml file. The blocks have to be cut and pasted back into the repo uca.xml file. Be careful to leave the existing English of the uca.xml file. (Eliminating the cut and paste would be a good future step.)
- Do the usual git add, commit, and push to update the GitHub repository.