Date: prev next · Thread: first prev next last
2017 Archives by date, by thread · List index


Hi,

twice a year we get thousands of strings for translation. On the one
hand this is good but translation of strings which we have translated
many times in the past is pretty boring. So I have written a python
script, which can translate strings using unique existing translations.
These are then uploaded using Pootle. Its functionality is similar to
two tools from the translate toolkit: pretranslate and poconflicts. I do
not use these, because: pretranslate requires pot files (we do not have
them) and produces fuzzy translations, which we do not want. poconflicts
lists all conflicts, the script lists just those relevant to the
actually needed translations (I plan to use poconflits later to fix
conflicts).

The script is attached (I hope we can attach stuff here).

How to use:

1. Download existing translations from Pootle (master as well as the
previous version)

2. translate using:

./selftranslate.py -i idir -o odir

where idir is directory with po files to be translated. The output odir
contains only files with changes which can be uploaded to pootle. In
this case idir is used also as the source for translated strings. In our
case numerous translations may be missing (they were probably deleted
when updating). You may use:

./selftranslate.py -i idir -r rdir -o odir

where rdir is directory with other translation downloaded from Pootle
(for example the previous version) (in my case additional 300 strings
were translated)

3. Upload to pootle: zip the odir directory and upload to Pootle

In Slovak translation there are quite some conflicting translatios. The
command

./selftranslate.py -i idir  -g > conflicts.json

or

./selftranslate.py -i idir -r rdir  -g > conflicts.json

outputs their list in the form (json)

{
  "Start": "Začiatok/Spustiť",
  "Spacing:": "Rozostupy:/Riadkovanie:",
  "Collapse": "Zbaliť/Zmrštiť zo strán"
}

where the alternative translations are separated by "/". Edit the file
by deleting bad translations. (outputs of the previous two commands
should be merged). If the conflict is OK or you do not know, just delete
the line.

Then, translate using

./selftranslate.py -i idir -r rdir -o odir -c fixed_conflicts.json

It will fix the conflicts in the json file, too.

In Slovak this has reduced the number of strings to translate to about 1/3.

When uploading, I always test if it works by uploading just one zipped
file (with its full path). I've never had any problems.

If you have questions, do not hesitate to ask :). The script was tested
on Linux and a few python packaged needed to be installed (using pip)

best

milos



-- 
email & jabber: sramek.milos@gmail.com


-- 
To unsubscribe e-mail to: l10n+unsubscribe@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/l10n/
All messages sent to this list will be publicly archived and cannot be deleted

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.