How to support this blog?

To support this blog, you can hire me as an OmegaT consultant/trainer, or you can send translation and project management jobs my way.

Search the site:

Showing posts with label TMXValidator. Show all posts
Showing posts with label TMXValidator. Show all posts

Maxprograms is back, take 2.

Free software by a world class XLIFF expert

I first wrote about Maxprograms in 2007. That was after Rodolfo M. Raya left Heartsome to pursue his activity as the Maxprograms software company. I’ve been meaning to write about his work for a long time now, especially since he decided to put all his products on Github, thus allowing translators to get the code, build the things, get the updates and run them on their side, for free.

Maxprograms also offers a lot of technical articles on the subjects of DITA, XLIFF and XML in localization. Check the page here if you are interested.

Rodolfo M. Raya is an editor of the XLIFF 2.0 specification and is a member of the OASIS XLIFF technical committee. He is also co-author of A Practical Guide to XLIFF 2.0.

April 15, 2023 update: Rodolfo has updated the build requirements.

  • JDK 17 or newer is required for compiling and building
  • Apache Ant 1.10.12 or newer
  • Node.js 18.15.0 LTS or newer
  • TypeScript 5.0.0 or newer
I've updated the version numbers below. Make sure you check the various requirements on the respective repository pages.

July 4, 2021 update: all of Maxprograms products are now available under an OSI approved Open Source license

Most of Maxprograms' products come with an easy-to-use installer and only the packages listed in italics below do not, because in their case an installer is not relevant.

If you check the repository list at https://github.com/rmraya?tab=repositories you will see the following software packages (among others). I added the product page on Maxprograms' site (the "..." links) to make it easier for you to find extra information:

  • Eclipse Public License 1.0 (OSI approved)
    • Fluenta (DITA translation manager) ...
    • Swordfish (standards based XLIFF CAT, supports Trados Studio packages) ...
    • TMXEditor (TMX editor, as the name suggests) ...
    • Stingray (document aligner) ...
    • XLIFFManager (GUI for OpenXLIFF) ...
    • OpenXLIFF (command line utility to create, merge, validate XLIFF files) ...
    • TMXValidator (validator/cleaner for TMX files) ...
    • TMEngine (translation memory engine) ...
    • SRXEditor (SRX editor) ...
    • MVDServer (simple web server) ...
    • XLIFFValidation (web-based XLIFF validation tool) ...
    • RemoteTM (remote TM server) ...
  • MIT (FSF and OSI approved)
    • Conversa (DITA publisher) ...
    • KeysAnalyzer (DITA keys analyzer) ...

A "normal" freelance translator would use Swordfish as an XLIFF translation editor/project manager. With eventually TMXEditor to work on client TMX, Stingray to align file sets, and TMXValidator to check and clean TMX files.

More advanced users, or PMs would use XLIFFManager or OpenXLIFF, along with XLIFFValidation and SRXEditor.

DITA specialists would use Fluenta, Conversa and KeyzAnalyzers.

Users who want to self-host services would use XLIFFValidation, MVDServer, RemoteTM.

Maxprograms' packages offer pretty much anything a translator would need, in very cleanly packaged solutions, with excellent user support, either community-based (on groups.io), or directly from Maxprograms if you are a subscriber.

And if your main translation editor in not Swordfish, you can still benefit from all the other packages depending on your needs.

DIY software

Fluenta, Swordfish, TMXEditor and Stingray are subscription-based, but allow translators to run the software for free from the source code (RemoteTM is proposed as a "software as a service" hosted by Maxprograms, but you can host it on your own server if you want).

What that means is that the packaged installer comes as a subscription, but if you don’t mind using Terminal to run your software, which is, let’s be honest, not much of a hurdle, you can use the software, access its updates, eventually make modifications for your own use, etc. for free.

The requirements to download, build and run the software are all given on each product’s Github repository, but here is the gist:

Ant, Node.js and Typescript are also available from Homebrew (https://brew.sh).

To build the software you’ll need to checkout (clone) the repositories. You also need to make sure that Ant uses Java 17 to build the package.

Rodolfo gives all the steps for building (for ex. Stingray):

    $ git clone https://github.com/rmraya/Stingray.git
    $ cd Stingray
    $ ant
    $ npm install
    $ npm start

Java ?

Maxprograms' applications used to be multiplatform Java only applications. Now they use a combination of Java and Javascript (even if the names are close, the two languages are totally unrelated) see below for Rodolfo's explanations.

Apple used to ship Java when macOS was young. It was in fact one of its selling points. Apple has stopped distributing Java a long time ago and now suggests that users install Oracle Java. Changes in the Oracle license and the availability of free Java distributions have allowed users to still benefit from Java without having to pay for a commercial user license.

Even after installing Adoptium's JDK, your machine will still prefer to use an older Java version if you have one installed on your machine.

Which means that if you run:

$ echo $JAVA_HOME

in Terminal and it won’t point to Java 17, you won’t be able to build the software.

On my machine, the above command gives

/Library/Java/JavaVirtualMachines/temurin-11.jdk/Contents/Home

A short investigation shows that the newly installed Java 17 is here:

/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/

The way to have ant use Java 17 instead of Java 11 for the build process is simply to give ant the right pointer:

$ export JAVA_HOME=/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/; ant

Once you’re done with the process, you can export your Java_Home back to its original value, just to be on the safe side. You’ll need to point to Java 17 only to build the software after a code update ($ git pull).

Back to the command line

Once you’ve run

$ npm install

you’re free to launch the application any time you want with

$ npm start

That’s it. This procedure works for Swordfish, Stingray, TMXEditor.

You can also create an Applescript that packages the whole process into a nice application that you can use to launch the various packages as you'd launch standard macOS applications.

A simple Applescript to do that could be:

use AppleScript version "2.4" -- Yosemite (10.10) or later use scripting additions set SwordfishPath to "/path/to/Swordfish/local/repository" set myCommand to "cd " & SwordfishPath & "; npm start" tell application "Terminal"'s front window delay 0.1 do script myCommand in its last tab end tell

Electron ?

Maxprograms' applications used to be Java only applications. But Oracle (Java's main caretaker) neglect of GUI libraries led to a not very satisfactory situation for Java GUI application developers. Here is Rodolfo's rationale for his move away from Java-based GUI libraries:

I use HTML + JavaScript + CSS for the UI and Java for core libraries. In essence, my apps are web pages running on a Java server.

NodeJS provides access to Chrome's V8 JavaScript Engine. Electron is a bridge that provides native windowing environment for JavaScript pages displayed on top of Chrome.

JavaScript is a powerful language, but it is dangerously sloppy. Instead of coding directly on JavaScript, I use TypeScript (which is a safer language) and "transpile" my code to JavaScript for deployment.

I have not switched completely to TypeScript because there aren't good XML libraries for JavaScript. All translation standards are defined using XML and Java is still the best option for handling them. The good news is that JLIFF (a JSON-based version of XLIFF) is currently in development.

Why switch to HTML + CSS for the UI if Java is a cross-platform tool?, you may ask. The answer is simple: Java dropped its major UI libraries.

Initially, Java shipped with AWT, a horrible toolkit with poor design and feature lacking. AWT was so bad that two options replaced it: Swing (originally developed by Sun and currently used by OmegaT) and SWT (the one I used in Swordfish, developed by Eclipse Foundation).

Oracle deprecated Swing in Java 8 and replaced it with JavaFX. When Java 9 was released, JavaFX was abandoned and development moved to its own open-source project, away from Oracle.

The Eclipse Foundation, which developed and maintained SWT for years, stopped improving SWT when JavaFX appeared. It did not fully embrace JavaFX and SWT is languishing since then.

With SWT dying, I looked at JavaFX. It tries to mimic HTML + CSS without success. Not good enough. The real alternative: adopt HTML and CSS.

Et voilà!

I'm not even scratching the surface of what Maxprograms has offered to translators since Heartsome disappeared. Each software package deserves a whole article.

Maxprograms' packages are yet another proof that working on macOS as translators, project managers or localization engineers is possible. And we're lucky that most of the multiplatform packages that allow us to work on macOS are backed by very talented people and communities who do their best to keep us from having to change of platform.

Disclaimer: I am not affiliated in any way to Maxprograms. Just so that you know...

Text alignment on Mac

When you start a translation, it is important to prepare your reference materials so that you can use them in the most efficient way possible.

Computer Aided Translation (CAT) tools have a special way to do that. They can use translation memories (TM) that contain source and target language information that will be matched against the source text to provide translation suggestions.

Using translation memories has two major benefits. The first is that any text present in the memory and also in a similar form in the file to translate can see its TM translation be recycled in your work. The other benefit is that the translation memory, if properly used will increase the style consistency of your final work.

Creating TMs is also called aligning bilingual texts. The end format will depend on your CAT flavor but the standard today is TMX (Translation Memory eXchange), an XML dialect maintained by LISA .


There are 3 ways to align text.

  1. by hand
  2. with a-free software
  3. with free software (including free of charge)

I used to do it by hand (copy the texts in 2 text editors windows with line numbers displayed, hack the contents so that strings on the same line number correspond, paste TMX code all over this).

In a good text editor, you can do all the work with the keyboard using only shortcuts. The paste TMX code all over this part is a little tricky but some smart people have created simple scripts in Perl or Python to ease the pain .

Then, I bought Heartsome's Translation Suite, a set of Java applications for translators. The set includes TMXEditor, a TMX file editor as its name says, and I did most of my alignment there for a while. I've always had mixed feelings about TMXEditor. There are display glitches, it does not seem easy to work only with the keyboard, it uses a lot of memory... TMXEditor does a few things very well (TMX merging and various checks), but on Mac, it is not the best tool for aligning texts .

The best tool (for now) on Mac is a native application called Appletrans, previously known as Alair. Appletrans had been on my hard disk for so long that I had almost forgotten about it, always promising myself that I'd test it to write a blog entry about it.

Appletrans is a text editor for translators. It is available free of charge directly from Apple, from their localization page, and besides for being a very nice aligner, it also is a full fledged CAT tool that a number of people have adopted as their tool of choice .

The following is an introduction to text alignment in Appletrans. I'd like to thank Steven DeWitt for helping me when I was lost in the shortcuts and for confirming that what follows is not merely the product of my feverish imagination.

Aligning text in Appletrans


  1. Prepare the files


  2. (This part is very well explained in the Appletrans manual. Don't hesitate to refer to it.)


    1. Appletrans does not open .doc files.
      → save the files to align to the RTF format in TextEdit

      Appletrans can also open a number of other file formats by default and plugins are available to add even more file formats.



    2. Open the source file and the target file from the finder or in Appletrans.
      → in the Finder, right click, Open With, Appletrans should come in the list.

      The files should be displayed with most of their styling but without any images, if any were present in the original files. Also, the files names now come with an .alair extension in replacement for the .rtf extension (see the title bar).



    3. Segment the two files (repeat the procedure for both files)
      → Do not select any contents in the opened files
      Tool menu, Segment submenu, Segment

      A dialog shows, select the segmentation type you want in the drop down menu, press segment all, you'll see small orange markers at the beginning and end of each segment Appletrans has created for you.



    4. Let Appletrans know that the two files are to be synchronized, do that for the two files.
      Tool menu, Synchronize

      A dialog shows, enter the language of the file.


      The synchronization causes the display to change a little bit. Use Cmd+1 (or Cmd+2) on the frontmost text and you'll see that the segments defined in that window are somehow linked to segments in the other window.

      By doing that, you can already see that some source segments are not associated to the correct target segment. The alignment process is about correcting such association mistakes.


  3. Correct the default segment associations


  4. (This part is not as clear in the user manual and required a bit of guessing.)

    You have now 2 windows open:

    1. The segmented source file
    2. The segmented target file


    Here are the Appletrans specific shortcuts that you will need to modify the alignment:

    Cmd+1 (Tool menu, Segment submenu)

    → selects the next segment and shows the associated segment in the other window

    Cmd+2 (Tool menu, Segment submenu)

    → selects the previous segment and shows the associated segment in the other window

    It is also possible to select any segment in the text by clicking on one of its orange segment marker.

    Opt+Cmd+R (Tool menu, Segment submenu)

    Restore, removes the segmentation for the selected segments, at least one full segment must be selected for the action to work

    Opt+Cmd+S (Tool menu, Segment submenu)

    Segment Selection, no need to go through the Segment dialog again !



    Now, here are some practical standard shortcuts that will make your life easier.

    Arrows

    → moves the cursor around the window

    Shift+arrows

    → selects while the cursor is moving

    Delete

    → deletes the selected part (segment or text)

    Cmd+X, Cmd+V

    → standard cut, paste that you can use to move segments or text around



    Merge segments


    • Select the segments to merge.
    • Press Opt+Cmd+R (Restore) to remove their original segmentation.
    • Press Opt+Cmd+S (Segment Selection) to make a segment from the selection.



    Split a segment


    • Select the segment to split.
    • Press Opt+Cmd+R (Restore) to remove its original segmentation.
    • Select the part you want to make a segment out of.
    • Press Opt+Cmd+S (Segment Selection) to make a segment from the selection.
    • Proceed similarly with the remaining of the original segment until every part is a segment.


    It is also possible to cut and paste segment contents around to achieve the same result. You may end up with empty segments that will have to be deleted. Do what fits best your workflow.

    In the system shortcuts (see System Preferences, Keyboard Shortcuts), you should have a Move focus to next window in active application.

    I have set this shortcut to Cmd+Esc, so that I can Cmd+Tab to navigate the running applications and Cmd+Esc to navigate the open windows of the frontmost one.

    Imagine the following scenario:

    Cmd+1, you select the next coming segment, you notice that it is not associated with the right segment in the other window.

    Cmd+Esc, you go to that window, you do what you have to do there, and when the segments are properly aligned, you don't need to go back to the first window, just proceed with Cmd+1.

    Anyway, with the above indications, you should be able to correct all the segments association in the files by using only the keyboard and by thus saving a huge amount of time.

  5. Create the alignment file


  6. The purpose of all this is of course to create an aligned file that you will later use for reference in your favorite CAT tool.

    Appletrans allows you to save such corpus in the familiar TMX format that most CAT tools support.

    First, you need to create a new corpus that will contain the data you just aligned.

    File menu, New Corpus


    A new dialog should be displayed but you don't have to worry about it. Click on any of the two text window that you have just aligned.

    Now, to save your data:

    Tools menu, Build Corpus


    Appletrans will be busy for a few seconds and then will release the focus.

    If you go back to the Corpus dialog, you will notice that the upper left red light now has a black dot in it, which indicates that the corpus has been modified.

    To create the final TMX:

    File menu, Save As


    Put a relevant file name and select TMX Format from the File Format drop down menu. Then save.

    The TMX that you have just created is a TMX 1.4 file that contains only textual information. All the style that was present in the RTF files has been removed. It is thus a TMX 1.4 level 1 file.

    A typical Appletrans created TMX file will look like this:

    <?xml version="1.0" encoding="UTF-8"?>
    <tmx version="1.4">
    <header creationtool="AppleTrans" creationtoolversion="38" datatype="unknown" segtype="sentence" adminlang="en" srclang="en" o-tmf="AlairCorpus">
    </header>
    <body>
    <tu>
    <tuv xml:lang="en"><seg>sentence</seg></tuv>
    <tuv xml:lang="fr"><seg>phrase</seg></tuv>
    </tu>


    You may want to change the srclang argument since Appletrans defaults to "en". If you use this TMX in OmegaT, the change won't be necessary as long as the xml:lang argument for the two tuvs corresponds to language variants of the languages you have set at the time of the project creation.

  7. Validate the TMX contents

  8. Appletrans (and a number of other tools) do not ensure that the TMX contents perfectly follows the TMX standard. In some cases, the textual contents that you have just aligned and converted will contain characters that should not be included in a TMX file. To ensure that the TMX you have just created does not contain such characters, you are going to need another utility.

    Maxprograms, the creator of a number of translation related tools, has released a free TMX validation utility that will be put at use here .

    Launch TMXValidator, and instead of using the Validate File in the File menu, use the Clean Invalid Characters from the same menu.

    TMXValidator will ask you to select your TMX file. After a very short time, the main window should display "File cleaned". No need to save, the file has already been modified.

    You can now use the TMX file in any CAT tool that support TMX files.






Links



About LISA:
TMX, XLIFF, etc...

Perl and Python scripts to create TMX files are available from the OmegaT official page.

Heartsome's page is here. You can download the software set and use it without limitations for 30 days.

Appletrans can be found from Apple's Localization Tools page, here.
There is a very active support group hosted by Yahoo Groups.

Maxprograms has been around for a while but limited itself to deliver free utilities eventually distributed with the Heartsome tool set. Now it has a full fledged XLIFF editor, Swordfish, along with all the smaller utilities that are all very useful.

Maxprograms is back !

About Maxprograms



Maxprograms is manned by Rodolfo Raya, of Heartsome and XLIFF fame. Maxprograms used to provide a few free Java utilites that were later included in Heartsome's Translation suite. Rodolfo quit Hearstome a few weeks ago and decided to put all his utilities back on Maxprograms' site.

The tools


The free tools that are now distributed directly from his site are:


TMXValidator

TMXValidator checks your documents against TMX DTD and also verifies if they follow the requiremenst described in TMX specifications.

TBXMaker

TBXMaker converts glossaries stored in CSV (Comma Separated Values) to TBX (TermBase eXchange) format.

CSVConverter

CSVConverter converts glossaries stored in CSV (Comma Separated Values) to TMX (Translation Memory eXchange) standard.

Java Properties Viewer

A tool specially created for viewing translated Java .properties files comprising languages not supported by the ISO 8859-1 character encoding.

MARTIF to TBX Converter

A program designed to convert glossaries in MARTIF format, also known as ISO 12200, to TBX format.

RTFCleaner

RTFCleaner removes hidden text and Trados/Wordfast markup from translated Tagged RTF files.



It is very nice to see that they are now available without having to download the full HTS package.

Dependancies


The utilities require Java 1.5 or better. Which means that for the time being they can be used only on OSX 10.4.8 or better. See Apple's download page if you only have Java 1.4. Java 1.5 is the default version on Leopard.

Since the utilities were included with Heartsome's Translation Suite they can be put to even better use in a workflow that involves HTS.

Free software ?


Currently, only TMXValidator has been released as a free to use source package. The license Maxprograms used is the Eclipse Plugin License v. 1.0. This makes TMXValidator free (as in free speech) software, but the EPL v. 1.0 not being compatible with the GPL it won't be possible to use the source code for inclusion in GPLed products.

All the other utilities are not (yet ?) available as free software, they are just free as in "free beer".


Anyway, thank you very much for your work Rodolfo ! And good luck to Maxprograms !

Popular, if not outdated, posts...

.docx .NET .pptx .sdf .xlsx AASync accented letters Accessibility Accessibility Inspector Alan Kay alignment Apple AppleScript ApplescriptObjC AppleTrans applications Aquamacs Arabic archive Automator backup bash BBEdit Better Call Saul bug Butler C Calculator Calendar Chinese Cocoa Command line CSV CSVConverter database defaults Devon Dictionary DITA DocBook Dock Doxygen EDICT Emacs emacs lisp ergonomics Excel external disk file formats file system File2XLIFF4j Finder Fink Font français Free software FSF Fun Get A Mac git GNU GPL Guido Van Rossum Heartsome Homebrew HTML IceCat Illustrator InDesign input system ITS iWork Japanese Java Java Properties Viewer Java Web Start json keybindings keyboard Keynote killall launchd LISA lisp locale4j localisation MacPorts Mail markdown MARTIF to TBX Converter Maxprograms Mono MS Office NeoOffice Numbers OASIS Ocelot ODF Okapi OLPC OLT OmegaT OnMyCommand oo2po OOXML Open Solaris OpenDocument OpenOffice.org OpenWordFast org-mode OSX Pages PDF PDFPen PlainCalc PO Preview programming python QA Quick Look QuickSilver QuickTime Player Rainbow RAM reggy regular expressions review rsync RTFCleaner Safari Santa Claus scanner Script Debugger Script Editor scripting scripting additions sdf2txt security Services shell shortcuts Skim sleep Smultron Snow Leopard Spaces Spanish spellchecking Spotlight SRX standards StarOffice Stingray Study SubEthaEdit Swordfish System Events System Preferences Tags TBX TBXMaker Terminal text editing TextEdit TextMate TextWrangler The Tool Kit Time Capsule Time Machine tmutil TMX TMX Editor TMXValidator transifex Translate Toolkit translation Transmug troubleshooting TS TTX TXML UI Browser UI scripting Unix VBA vi Virtaal VirtualBox VLC W3C web WebKit WHATWG Windows Wine Word WordFast wordpress writing Xcode XLIFF xml XO xslt YAML ZFS Zip Zotero