You are here

Extract text for translation and reinsert

Hello everyone!

I am a translator working on a long-term project that involves various .xcf files. I know I can edit text directly in the .xcf files but I've noticed that much of this text is repetitive.

Now, this is what I'd like to do:

- Extract all editable text within the layers of the .xcf file to, for example, notepad
- Translate the text with a CAT tool (Trados, preferably Across)*
- Reinsert the translated text in the original .xcf file as it was before (same position, same format)

Does anyone have an idea how I an do this? Or if it is possible at all?

Of course, I could just copy-paste the text manually, but that would take much longer and I'm looking to optimize my workflow in order to process the files quickly.

I tried to use gimp's "export to..." (html) function - but the process was very slow and my PC crashed >.< Can't have that happen 2-3 times a week.

I found a script here (kp24_extract_text.scm), but it keeps missing individual text layers and doesn't separate the sentences. It also fails to extract the text to a .docx file. Also, it doesn't import text back into gimp...

I could also turn to a DTP provider who can give me files I can work with (i.e. when the customer sends InDesign files they can be converted to a tagged file, I do not know, however, how he creates the tagged file and reconverts the file to InDesign), but this particular client is on a very tight budget and would like to avoid extra costs.

*With a CAT tool, if you have translated a segment/sentence once and the exact same segment/sentence reappears, you can just automatically translate it - meaning you wouldn't have to copy/paste or retype "whatever sentence it is" a gazillion times. CAT tools can process word, txt, excel and any file format with tags.

Thank you in advance!

As the creator of the script you mention, I'm curious why it's missing text layers (unless your .xcfs contain layer groups) I think you need a much more sophisticated tool, probably written in Python instead of Script-Fu, that can process each text layer as it find them, automatically pass it to a translator and put the text back in.

However I feel you're probably going to find that the translated text is going to be different lengths to the original and will need to be re-aligned so you're back to a manual process anyway.

Hello paynekj,

the files I received didn't have layer groups... but I can try again with the files they'll be sending by the end of the week and can let you know.

The translated text having a different length is OK (and unavoidable), I was just looking for a way to process the text itself more effectively. I need to do minor adjustments for the English versions anyway, so re-aligning is not an issue.

Maybe I'll just create a base file with all recurring phrases and copy-paste them manually as well.

Thanks for looking into it!

Subscribe to Comments for "Extract text for translation and reinsert"