Wednesday, 4 January 2012

Writings in Swedish only


Skriva

This posting is now removed

Saturday, 29 January 2011

PDF to CAT and Back

PDF - Portable Document Format
The file format PDF - Portable Document Format was developed by Adobe, and is an open standard. PDF files can be read (and in some cases edited) with Adobe Acrobat reader, a free application or with Acrobat Pro. The purpose of the PDF file format is to be able to produce readable documents from whatever application or paper document in a format that can be read on all computers and all platforms, without having access to the source files or having to buy the application. This also means, that there are no documents that are produced in Acrobat as source files. All PDFs originates from other source file formats.
The problem for the translator is, that customers often sends a PDF, and they are not aware of the fact that there always exists another document in the background. In most cases it is easy to obtain the source documents from e.g. FrameMaker, InDesign, AutoCAD or Word, which of course is more adapted to the translation workflow.
But Studio is able to translate PDF directly?
Well, yes I am aware of that the advertisements tell you that. The problem is that if you use the built in PDF converter in Studio, you cannot do a proper pre-editning, which I find is essential. Do feel free to try, it might work ok in some cases. But if you find your document full of rouge tags and in-line paragraph breaks, then follow my advice in this document and pre-process your PDF.
First rule of PDF translation ­- Do not do it!
Never accept to translate from PDF without first putting in a certain amount of asking, begging, investigating and extorting your customer to find the source files! Tell your customer that the pre-processing and post-processing of every PDF will add 1 h to the translation bill, and still the result will be of poor quality or a text-only file.
If this fails, and you do not have any other customers to work for, then it is actually possible to work also in PDF. In some cases, there actually are good reasons why the source files cannot be obtained.
PDF conversion to text
In contrast to converting other file formats to and from your CAT tool, the conversion from PDF is an irreversible process. You will never get back the same formatting that you started from. So never promise anything else than a plain text file without pictures and formatting when working with PDF. But, it is actually possible in many cases to keep the formatting somewhat close to the source, if you know how to. There are two main types of PDF:s, graphics based and text based. If you do a scan from paper and save as PDF, you get a graphic image of the text. If you make a PDF by electronically "printing" the result from an InDesign or a Word document, you get a better format, as the PDF will still retain the text as editable. In the following I will call the types graphic PDF and text PDF.
Conversion of text PDF
For this type of PDF you will need a good converter. I have tested several, and I now use Nuance PDF Converter Professional. PDF Converter manages to keep sentences in one piece (no paragraph breaks in end of lines) and also fixes most pictures, tables and columns. I always try to save in full graphic format first, but if that does look too ugly, then I save as text only.
Conversion of graphic PDF
If the text is a picture of text, you have to use OCR. There is some kind of OCR function also in the above mentioned PDF converter, but a real OCR program like ABBYY FineReader is much better to use for this kind of documents. In some cases I have also found, that the PDF converter cannot handle a text PDF very good, then it is better to use FineReader instead. Also in FineReader you have the option to try saving as fully formatted or plain text Word document.
Pre-editing of PDF
After the conversion, before translating a PDF, there is always some pre-editing to do. I have found it most time-saving to do as much pre-editing as possible before translation. If you save as plain text, some of the points below can of course be skipped.
1) Set Word to "Show invisibles" and look for misplaced paragraph breaks in the middle of sentences. Also check for new line characters and change them to paragraph or remove them. This will avoid having sentences split in several segments. I also recommend to search and replace soft hyphens with nothing. That reduces the rouge tagging.
2) Sometimes you can also get problems with language specific diacritics, e.g. åäö or ü. In such cases, select all and set a font that contains your specific letters. Note that some special symbols might change doing this, if other fonts are used. This must be restored after translation.
If you save as formatted text:
3) Select all of the text, select Home/Font/Character spacing and do the following settings:
Scale 100 %
Distance Normal
Position Normal
Kerning remove tick
This will prevent much of the rouge tags in the CAT editor.
Post-editing PDF
It is also a good idea to proofread your document and compare with the source PDF. In most cases you will find some deviations to correct, even if you have done a good post-editing.


Friday, 28 January 2011

Filtering in the Studio editor

You can use regular expressions in Studio to filter what you want to see/edit in the Editor view.
If you do not see the Filter toolbar, use View/Toolbars/Display Filter.
You will now see a field called Containing:
This field can be used for writing search criteria and/or regular expressions. Write something in the field and hit return.
Try the following:
\d                                           Shows all lines that contains numbers or numbers + text. Text only units are excluded. Same as [0-9].
^[0-9]                                     Shows lines starting with numbers
^([-+] ?)?[0-9]+(,[0-9]+)?$       Shows +/- integers and decimal comma numbers
^([-+] ?)?[.0-9]+(.[0-9]+)?$       Shows +/- integers, comma and dot numbers [corrected expression]
^([-+] ?)?[.0-9]+(.[0-9]+)?$      Shows also headers like 1.2.3
^\d+\d+\d+$                            Shows integers only, without sign              

To produce the sign ^, copy from here or use Alt94

Regular expressions in Studio
It is also possible to use regular expressions for other functions in Studio:
- Filtering text files when defining a new job/adding files
- Defining segmentation rules
- In the Search/Replace function
More on Regex:
Also see Tuomas' findings on this subject:


Monday, 24 January 2011

Tagging text files in SDL Trados Studio

Regular expressions is a general method for matching strings. In Studio, there are several ways of using regular expressions to change the behaviour of the system. I will describe one case here. This relates to my previous posting
about translating CAD drawings with use of the converter TranslateCAD.
If you open the translatable file from TranslateCad, trans1 file in a text editor, it looks something like this:
-----------------
##000019##
FIRMA OY
##000020##
1:10
##000021##
1010
##000022##
Piirustukset ovat ohjeellisia.
##000023##
-----------------
The codes with numbers ##000XX## are created by the converter, to keep track of the reimport of texts. But you do not want to have them in Studio, of several reasons. They have to be untouched; and if you use Autopropagate in Studio, they are propagated to all similar lines every time you confirm a row, which is time consuming. A drawing typically also includes a lot of standalone numbers (measurements), that shows up as integers in Studio.
However, there is a nice function in Studio that allows you to define nontranslatable units when importing in text format. In the CAD case I have chosen to hide both the code and numbers/integers, so they do not show up in the Studio editor.
Workflow for text import
The best way to work with this would probably be to create a dummy project first in the desired language combination. Then you have a place for your experiments, without changing any parameters that will affect the global settings or any ongoing projects.
1) Go to menu Project/Project settings
2) Expand file types by clicking on the preceding +
3) At the bottom of the list, choose the file type Text.
4) Click on Inline patterns.
5) Click on Add rule... and paste the following into the field Opening:
##\d+##
That will make the tags into not translatable placeholders.
6) Click on Add rule... and paste the following into the field:
^([-+] ?)?[.0-9]+(.[0-9]+)?$ [corrected expression]
Note: the ^ symbol is not found on your keyboard, so either use cut and paste from here or use the alt code Alt 94.
Note: http://usefulshortcuts.com/downloads/ALT-Codes.pdf
The second rule will remove all standalone numbers. I am actually not quite sure what this expression does, I found it on a computer geek site. But it at least removes the standalone integers. Probably it will also remove numbers preceded by +- and with commas in them.
The above example, the trans1 from TranslateCAD will now look like this:
-----------------
FIRMA OY
1:10
Piirustukset ovat ohjeellisia.
-----------------
If you still would like to see the codes and measurements while working, use the Display Filter bar. If you do not see the Filter toolbar, use View/Toolbars/Display Filter. The display field probably says All segments; change that to All content. Now you will see a number tag on all rows that contains untranslatable tags only, the Tag ID is displayed. To see the whole tag content, click on Full Tag content on the QuickInsert toolbar. Now you can see all codes and numbers as non-editable tags.
Save and reuse your settings
When you are ready with the settings, you should save your work in a project template.
Go to Project/Create project template
Give the template a file name, e.g. FinnishToSwedishCAD and save. Now you can use this template for your present and future AutoCAD projects without having to do all the settings again.

Sunday, 23 January 2011

CAD to CAT and Back
Introduction
This article describes a workflow for translating the text in AutoCAD drawings without buying an AutoCAD license. It is also applicable on other graphical formats that can be converted to dxf (Drawing Interchange Format). The translation tool in this example is SDL TRADOS Studio, but the method, with minor modifications, is possible to use also with other CAT (Computer Aided Translation) tools, as the translatable format is txt.
Programs needed
CAD program
AutoCAD (developed by Autodesk) produces a file format called dwg. For transfer to other programs, Autodesk also developed a format called dxf, (Drawing Interchange Format). There are also other CAD programs on the market that can edit and convert the dwg and dxf formats. In this example I use a program called progeCAD Professional that costs € 291, developed by ProgeSOFT. If you can get your customer to save the drawings in dxf format, you actually do not have to buy neither AutoCAD nor progeCAD for the translation work. But, I would strongly recommend to buy a CAD program or a program that at least can read dxf, else you are unable to see the result of your work. And, you cannot verify the conversion results.
Conversion program
The conversion to and from the translatable text format (.txt) is done with a conversion tool called TranslateCAD from TranslationToSpanish.com and actually only costs $ 29 which is a very low price considering they also have free support for the program! The converter is a standalone program and not integrated in the CAD program, thus you only need a dxf file for input.
Text Editor
As there is a glitch in the back conversion to text from SDL Trados Studio, you also need a good text editor that can convert the txt format. For this conversion I use EditPad Pro that costs 40 €.
Workflow
The workflow is based on a real case where I translated 37 dwg drawings. The workflow starts with the source files saved in a folder named DWG_source
Step 1 - Convert dwg to dxf
The converter needs a dxf for input.
Open progeCAD professional and open the files.
Save As, choose AutoCAD 2010 ASCII.dxf (binary does not work in the converter)
Save the dxf files in another folder DXF_translate
Step 2 - Convert dxf to txt
Open TranslateCAD. In the left upper pane, choose the folder DFX_translate. Select all files in the lower left pane.
Push Extract text!
You should now see a Status window that shows
The target files were successfully created.
The converter has now produced two files for every source dxf. They have the extensions -trans1.txt and -trans2.txt. The translatable file is -trans1.txt, and this can be opened in Studio or another CAT application, or actually even edited manually in the text editor. If there are a lot of files it is a good idea to copy the trans1 files to another folder for translation.
Step 2.5 - Optional: Filtering with Regular Expressions
I recommend to use filters when importing, this is explained in a separate blog posting.
Step 3 - Translate with Studio
Optional: file merging
If you have many files, which is typical in a drawings translation project, it would be nice to have all drawings in the same file. Drawings also tend to contain a lot of repetitive standard texts, thus it is easier to handle in a single file. That is easy to achieve (but optional) in Studio. Use New project, which starts the project wizard. When you come to the Add files pane, first add the files, then select all files with Ctrl+A, push Merge Files. Name the file AllDraws.
The merge function will produce a single file of all drawings. Now open the file in the Studio editor. Note that it is till is easy to see in which individual drawing you are working, as the drawing name is highlighted in the list in the Editor pane to the left of the dual editing window. To expand the Editor window, if you do not see the file names, click the double arrow.
Note that Studio changes the scale figures, like Scale 1:10 to 01:10. (Do not ask me why). This leading zero must be removed manually.
Step 4 - Save As Target
In a merged file, you cannot save as target from the dual editor. Change to the Files pane, right click the merged file, choose Batch task/Generate target translations. That produces individual files for every drawing.
Step 5 - Convert to correct text format
This step is necessary only if you use Trados Studio. That is because Studio saves back the text files as Macintosh-formatted text, which cannot be converted in TranslateCAD! It is now you need your text editor, e.g. EditPad Pro. Open the trans1 files. Click to open the Convert menu. You now see, that the To Macintosh is greyed out, which means you have a genuine Macintosh file. Now click on To Windows (CR LF). Now the To Windows should be greyed out, indicating that the file is back in Windows format. Save the file, and exit EditPad. I suppose this could be done in any proper text editor. Note: If you by mistake use the Mac format, you do not get any error message in TranslateCAD. The error shows when you try to open the dxf in progeCAD!
Step 6 - Copy the translated trans1 to the source folder
First, make a copy of the folder DXF_translate, where the source dxf, trans1 and trans2 files are. Then, copy (and replace) with the translated trans1 files from your Studio project folder. The source trans2 and the translated trans1 must be in the same folder to run the back conversion. That is why it is important to make the copy of the source folder; if anything goes wrong you must be able to start again from the source trans1 texts.
Step 7 - Create translated dxf files
Open TranslateCAD, now use the right side panes. In the upper pane, locate the DXF_translate folder. You should now see all of the -trans1.txt files. Select all files and push Re-construct. It happens that you get the message "The target file is already open by another application. Please close it and try again." and that happens even if progeCAD is closed. I think that this error has something to do with the trans1 files, and a remedy that works is to delete all the trans1 files in the folder DXF_translate and the copy them again from your Studio project folder. You also might have an error message in progeCAD next time you open it after this error, but just click it away.
The converter produces new dxf files, that are named -trans.dxf, the source dxf are not overwritten.
Step 8 - Create the translated dwg
Open progeCAD (clicking on dxf does not work) and open the -trans.dxf files. Note that you have to change file type to dxf in the file format dropdown, else you will only see dwg files. You can now check your translation and formatting in progeCAD, and then Save As... and select AutoCAD 1010.dwg (AutoCAD 2007 seem to be the default).
Editing in progeCAD:
To move the drawing in the pane, push and hold down the scroll wheel on the mouse, and then drag. The scroll wheel zooms in and out in the drawing. And, you have all CAD functions available to edit the drawings if needed.
Thanks to
Paul Filkin, SDL, for help with regular expressions and text format.
Vicente Victorica, TranslationToSpanish.com, for fast support on the Mac file problem.

Thursday, 28 October 2010

PDF-konvertering

Översättning av PDF-filer i CAT-program
This text is in Swedish, please use Google Translate!
Mitt CAT-program Studio kan enligt marknadsföringen klara av att "översätta PDF". Det är givetvis en grov överdrift. Testa gärna denna funktion och efter att ha konstaterat att det inte blir bra, återgå till de metoder jag anger här.
Den viktigaste regeln angående översättning av PDF är att aldrig någonsin acceptera "enbart PDF"! Det existerar nämligen inga dokument som *ursprungligen* har gjorts i PDF-format med Acrobat. Syftet med att använda PDF är att enkelt kunna hantera dokument som gjorts med komplicerade och dyra program.
Om du har bönat och bett, hotat, övertalat och väntat i veckor, men ändå inte kan få originalfilerna så finns det faktiskt vissa möjligheter att arbeta med PDF.
Det finns två typer av PDF; den bästa typen, text-PDF, är textbaserad och görs ur andra elektroniska dokument från desktop-program som InDesign eller FrameMaker, eller från Word-dokument, genom att skriva ut dokumentet som PDF. Den andra typen, bild-PDF, är inscannade pappersdokument som alltså är bilder av text. De här typerna av PDF kräver helt olika behandling och olika program för att kunna översättas. Om du vill veta vilken typ av PDF det är så prova att markera ett ord i texten eller söka efter ett ord med Acrobats sökfunktion. Om det inte går, så har du en bild-PDF. Notera att det förekommer dokument där båda typerna finns, så testa på lite olika ställen om det är ett långt dokument som du misstänker kan vara hopklippt av flera.
Konvertering av text-PDF
Jag beskriver den enklaste varianten först; för text-PDF behöver du bara ett bra konverteringsprogram. Jag har provat flera, och enligt min mening är Nuance PDF Converter Professional det bästa. Om man har lite tur kan man till och med få bilder och formatering att lite grann likna originalet! Men lova aldrig annat en "oformaterad text" om du åtar dig PDF-översättning. Allt annat är en bonus. PDF Converter klarar ganska bra att hålla ihop meningar (inga stycktetecken i meningarna) och klarar även spalter och tabeller hyfsat. Alla konverterade PDF kräver dock för- och efterbehandling och en noggrann jämförelse med originalet.
Förbehandlingen bör åtminstone bestå i att skumma igenom dokumentet med "visa P" aktiverat så att de osynliga tecknen för ny rad och nytt stycke visas. Ta bort alla stycketecken mitt i meningarna. Gå sedan igenom alla radbrytningstecken (ny rad). De måste nämligen hanteras olika; ifall de finns mitt i en mening ska de tas bort, ifall de kommer direkt efter en mening ska de ersättas med nytt stycke-tecken. Det är givetvis i sin ordning att debitera kunden 1-2 timmar per dokument för konvertering, förbehandling och efterbehandling.
Konvertering av bild-PDF
Vissa PDF-konverteringsprogram påstår sig klara alla typer av PDF, men det är tveksamt om de verkligen håller vad de lovar. För bild-PDF är det bästa att istället använda ett renodlat OCR-program (Optical Character Reading) som verkligen klarar av att tolka textbilder på ett bra sätt. OCR-programmen finns i olika prisklasser, jag har fastnat för ABBYY FineReader som inte är alltför dyrt men ändå ger ett förvånansvärt bra resultat.
Ett OCR-behandlat dokument kräver en hel del handarbete för att bli översättningsbart, även om man bara ska använda texten. Ifall du lägger in ett obehandlat OCR-dokument i ditt CAT-verktyg får du sannolikt en väldig massa onödiga taggar överallt. Det beror på att OCR-programmet försöker arbeta så noggrant som möjligt och tittar på teckenavstånd, olika storlekar och typsnitt. I vissa fall konverteras även åäö för sig och får ett annat typsnitt vilket ibland leder till att man får osynliga ordbrytningar mitt i orden. Det i sin tur gör ordräkningen i CAT-verktyget alltför stor, och eventuella hittar mot gamla TM försvagas.
Förbehandling av OCR-behandlad text
Det mest radikala är naturligtvis att spara hela dokumentet som ren text och sedan öppna som Word-dokument igen, då slipper man alla formateringsproblem, men dokumentet kan ju bli lite tråkigt, och alla bilder försvinner.
Ifall du vill försöka bevara formateringen och bilderna ungefär som i originalet kan du försöka med följande:
För Office Word 2007:
- Markera hela texten och välj Start/Tecken/Teckenavstånd, och gör följande inställningar
Skala 100 %
Avstånd Normal
Läge Normal
Kerning ta bort bocken
Ifall åäö ser annorlunda ut än de övriga bokstäverna så bör du också ställa in samma typsnitt för hela dokumentet (Arial). Det innebär nämligen att det i CAT-programmet blir en ordseparator före och efter varje åäö. Ibland syns detta inte i originalet utan kommer fram först när du lägger in texten i CAT-verktyget. Ett säkert tecken på att du har åäö-problem är om CAT-verktyget ger en avsevärt (30 %) högre ordräkning än Word. Små skillnader förekommer alltid i ordräkningen mellan Word och CAT-programmet.
Det kan givetvis ha vissa nackdelar att ha samma teckensitt i hela dokumentet, ifall man använt sig av detta för specialsymboler. Dessa måste i så fall återställas manuellt. Samma gäller om du väljer att även ha samma stilstorlek i hela dokumentet, vilket även minskar antalet taggar i CAT-verktyget.
Generell förbehandling
Även om du får dokumentet i originalformat i Word kan det finnas anledning att titta lite på det innan du lägger in dokumentet i CAT-programmet. Det händer nämligen att skribenterna inte använder sina verktyg på rätt sätt.
Vanliga konstigheter:
- Meningar har delats på rader med stycketecken eller ny rad
- Tabelluppställningar har gjorts genom att använda flera tabbar i rad i stället för att ställa in tabulatorlägen och använda en tab
Så ibland kan det vara värt att göra en genomgång i förväg. Det är heller inget större jobb att börja om, ifall du redan har lagt in dokumentet i CAT-verktyget. Det är ofta enkelt att gå in i originalet, göra lite ändringar och spara dokumentet under ett nytt namn. Då kan du lägga in dokumentet i Studio med funktionen Lägg till fil. Observera att Studio beter sig lite egendomligt när man ska lägga till filer. Du måste växla till källspråket för att lägga till, sedan köra batchen Prepare without project TM, och sedan växla tillbaka till målspråket *innan* du klickar på filen för att öppna den i editorn. Ifall du klickar på filen i källspråket får du ett mycket mystiskt felmeddelande om "wrong language culture". Språkväxlingen görs i en liten ruta längst upp till vänster i Files.

Thursday, 4 March 2010

Min termhantering förr och nu - Studio SP 2

This article is in Swedish only!
Try Google Translate: http://translate.google.com/

MultiTerm har alltid varit Tradosprogrammens svarta får, men jag har ändå använt det flitigt, på grund av dess enda verkligt goda egenskap; att man får upp specialtermerna i en liten ruta i Trados och att källtextens termer markeras med en röd linje ovanför, ifall de finns i termbasen. Vitsen med att använda MultiTerm har alltså varit att lägga in specialterminologi i den, inte generella ordböcker, eftersom man ju då skulle få röda streck på varje ord och en alltför lång lista att välja från. Så det du ska lägga i MultiTerm är endast specialtermer eller kundtermer. Det var ganska besvärlig i gamla Trados att lägga till termer "on the fly" och MultiTerms funktioner för redigering och tillägg av nya termer var rätt klumpiga och komplicerade. Därför har jag använt Word-baserade tabeller där jag samlat kundspecifik projektterminologi under projekten. Sedan har jag vid årets slut tagit lite tid för att sammanställa årets termskörd och suga in den i MultiTerm via importfunktionen, till en stor ordlista. Jag har heller inte använt funktionen att kopiera in termer med knapptryckningar från MT till dokumentet, även om jag vet att det går i gamla Trados Workbench också.
Med Studio är förutsättningarna annorlunda, som gjort att jag ändrat mitt arbetssätt. MultiTerm är fortfarande ett ganska svart får, men det har ändå blivit vissa förbättringar, särskilt i kommunikationen med Studio. Det är också möjligt att jag nu har lärt mig att använda verktyget bättre, och upptäckt mer av dess funktioner, mycket tack vare den certifieringskurs jag gått igenom.

Det nya är att jag nu börjat använda ordlistorna mera direkt i översättningsarbetet genom QuickInsert och AutoSuggest, och jag använder nu också termverifiering via QA-funktionen. Därför vill jag gärna ha in terminologin i MultiTerm redan under arbetets gång i pågående projekt. Det är nu möjligt på ett relativt enkelt sätt. Eftersom MultiTerm och Studio numera hanterar hur många termbaser som helst på ett smidigt sätt, så gör jag helt enkelt en kundspecifik ordlista för varje återkommande kund som jag jobbar med, och bygger upp dem under arbetets gång direkt i MultiTerm.
Grunden till de kundspecifika ordlistorna skapar jag ofta från material i mina gamla projekt för en viss kund, och sedan fortsätter jag med att lägga till och redigera termer direkt i Studiomiljön. Det är faktiskt lika enkelt, eller kanske lite enklare än att skriva tvåställiga tabeller i Word. Du markerar orden i båda språken och trycker på Alt F11.

För att termverifieringen ska fungera bra är det inte heller vettigt att använda en omfattande ordlista med 20 000 poster, utan bara specialtermerna for den aktuella kunden. Annars får du bara en väldigt lång fellista på avvikande termer, som ofta inte är relevant i sammanhanget.