Install https://github.com/zcribe/translate-po according to the instructions given there (pip install)
Install the latest googletrans,
pip install googletrans==3.1.0a0to address translate-po issue 12
Download perl module+script Text::PO::SimpleParser + pomerge and unpack it in your $HOME/bin/
svn co -N svn+ssh://svn@svn.kde.org/home/kde/trunk/l10n-kf5 cd l10n-kf5 svn up --set-depth=empty templates eo svn up templates/messages eo/messages cd eo/messages
#!/bin/bash # postproc_xlpo.sh # Restore line breaks between po entries perl -p -e 'BEGIN { $hadcomment = 1; } my $l = $_; if ($l =~ /^#/) { unless ($hadcomment) { print "\n"; $hadcomment = 1; } } else { $hadcomment = 0; } ' -i $* # Remove space inserted between % and argument number perl -p -e 's/% (\d)/%$1/g' -i $*
mkdir xlpo
#!/usr/bin/python3 import translate_po from translate_po.main import run run(fro="en", to="eo", src="../../../templates/messages/kmuddy", dest=".")
svn mkdir $L/messages/kmuddy
svn copy templates/messages/kmuddy/kmuddy._desktop_.pot $L/messages/kmuddy/kmuddy._desktop_.po svn copy templates/messages/kmuddy/kmuddy.pot $L/messages/kmuddy/kmuddy.po
In the new $L/messages po-files manually insert the proper PO header lines.
cd templates/messages/kmuddy ln -s kmuddy._desktop_.pot kmuddy._desktop_.po ln -s kmuddy.pot kmuddy.po cd ../../..
Note that this only works for pot-files with less than 1000 phrases (msgid).
If a file has more phrases, it is necessary to split it into multiple po-files where each has less than 1000 phrases.
You will also have to copy the POT header lines to the split files such that they are valid as po-files.
After the machine translation, you will have to rejoin the split files into a complete po-file (also removing the additional PO-headers).
cd $L/messages/xlpo tr.py
After completion, in xlpo there will be the translated po-files; in this example: kmuddy._desktop_.po, kmuddy.po
postproc_xlpo.sh *.po
Open the generated *.po files in a text editor and
pomerge.pl ../kmuddy/kmuddy._desktop_.po kmuddy._desktop_.po > k.po # Make sure that the merged k.po is in good shape (run msgfmt --statistics --check-header), then move it to the target: mv k.po ../kmuddy/kmuddy._desktop_.po pomerge.pl ../kmuddy/kmuddy.po kmuddy.po > k.po # Make sure that the merged k.po is in good shape (run msgfmt --statistics --check-header), then move it to the target: mv k.po ../kmuddy/kmuddy.po
Update the datestamps "PO-Revision-Date" in the target files
cd ../ svn ci -m"l10n-kf5/$L/messages : add kmuddy" kmuddy
Note that this is not intended as criticism of Google, they do an amazing job given the many ambiguities of English
English | mistrans. | intended trans. |
---|---|---|
style="...", margin="..." etc. | stilo=, marĝeno= ktp. | DO NOT TRANSLATE: these are key attributes of HTML |
Open, Close, and other verbs intended as infinitives |
Malfermu, Fermu, etc. mistranslated as imperatives |
Malfermi, Fermi, etc. (infinitive forms) |
string | ŝnuro | ĉeno |
session | sesio or kunsido | seanco |
theme | temo | etoso |
icon | ikono | piktogramo |
global | tutmonda | ĉiea |
media | amaskomunikilo | aŭdvidaĵo or datumportilo (depende de la kunteksto) |
general | generala | ĝenerala |
battery | kuirilo | baterio |
job | laborposteno | tasko or laboraĵo |
load (a file etc.) | ŝarĝi | ŝargi (ŝarĝi nur en kazo de baterio) |
record (noun, e.g. database record) | rekordo | rikordo |
free (e.g. free software) | senpaga | libera |
plot (noun) | intrigo | diagramo |
offset | ofseto | deŝovo |
tick (scale, ruler, axis) | iksodo | skalero or other, depending on context |
share (noun, e.g. Windows filesystem share) | akcio | kunhavaĵo, komunaĵo, kundividaĵo |
commit (noun, e.g. Git commit) | komito | enmeto |
mount (device, filesystem) | monto | munto |
crash | kraŝi | panei |
Windows (GUI objects, not Microsoft) | Vindozo (Microsoft) | Fenestroj |
Save | Savi | Konservi |
storage | stoko | konservejo |
match (pattern matching) | matĉo | kongruo |
port (socket connection, hardware I/O) | haveno | pordo |
property | posedaĵo | propreco |
custom | kutima | propra |
state (button, device etc.) | ŝtato | stato |
bar (tool bar, menu etc.) | trinkejo | breto |
volume (audio/loudness) | volumo | laŭteco |
checksum | ĉeksumo | kontrolsumo |
Type (noun, e.g. datatype) | Tajpo / Tajpu | Tipo |