For English text, scroll down
Kio estas aligner.py?
aligner.py estas pitona skripto por kunligi teksojn kaj produkti TMX-formatajn tradukmemorajn dosierojn, uzeblajn per OmegaT.
Kiel uzi?
- instalu Pitonon, se ankoraŭ ne estas instalita viasisteme (pri Pitono: www.python.org);
- elarĥivigu la dosieron aligner.py ien ajn;
- konservu fontan tekston kiel D:\fonto.txt (por uzi alinoman dosieron, konforme ŝanĝu la 6-an linion de la skripto) en UTF-8;
- konservu tradukaĵon kiel D:\tradukajxo.txt (por uzi alinoman dosieron, konforme ŝanĝu la 7-an linion de la skripto) en UTF-8;
- zorgu, ke la fonta teksto kaj la tradukaĵo havu la saman alineokvanton, aliokaze la skripto ne funkcios kaj komunikos eraron; laŭbezone redaktu la dosiero(j)n;
- laŭbezone ŝanĝu la fontan kaj la celan lingvon (la linioj 12 kaj 13 respektive);
- lanĉu la skripton;
- la rezulta dosiero estos D:\tmx.tmx (por produkti alinoman dosieron, konforme ŝanĝu la 19-an linion de la skripto);
- se la fonta teksto kaj la tradukaĵo estis en UTF-8 kun BOM (bajtorda marko), la skripto faros unuan falsan tradukunuon — forigu ĝin permane (aliokaze la TMX-dosiero ne estos uzebla per OmegaT).
Konata problemo
Se la fonta teksto aŭ la tradukaĵo enhavas linio(j)n, kiu(j) konsistas el unu nerompebla spaceto, fariĝas difekta tradukunuo en la TMX-dosiero. Forigu la difektaĵon permane.
What is aligner.py?
aligner.py is a script, written in Python, to allign texts and produce TMX translation memory files, that can be used by OmegaT.
How to use?
- install Python, if it's not already installed in your system (about Python: www.python.org);
- unpack the aligner.py file to any place;
- save the source text as D:\fonto.txt (to use another file name, respectively change the 6th line of the script) in UTF-8;
- save the translation as D:\tradukajxo.txt (to use another file name, respectively change the 7th line of the script) in UTF-8;
- make sure, that the source text and the translation have the same quantity of paragraphs, otherwise the script won't work and will report an error; if necessary, edit the file(s);
- change the source and the target language as necessary (the lines 12 and 13 respectively);
- launch the script;
- the result will be in the D:\tmx.tmx file (to produce a file with another name, respectively change the 19th line of the script);
- if the source text and the translation are in UTF-8 with a BOM (byte-order mark), the script makes a first fake translation unit — delete it manually (otherwise the TMX file won't be suitable for OmegaT).
Known problem
If the source text or the translation has line(s), consisting of one non-breakable space, there will appear a defective translation unit. Delete the defect manually.