Pages in topic:   < [1 2]
CAT tool for .Java files
Thread poster: Andrea Protti
Andrea Protti
Andrea Protti
Switzerland
Local time: 03:01
English to German
+ ...
TOPIC STARTER
Sounds interesting Mar 16, 2015

Samuel Murray wrote:

Andrea Protti wrote:
Looking for a CAT tool capable of handling .java files.


Personally, I'd do it in MS Word using Wordfast Classic. You could do it in any other tool that supports internal and external styles as well (Trados 2007 springs to mind). I'd use regex find/replace to change the non-translatable text to tw4winExternal, and if there are any placeables inside translatable text, I'd mark those as tw4winInternal. Piece of cake. However, this solution may not be for you because it would require you to learn all about regex, styles and (of course) WFC.




Tried that approx., got a little bit stuck with regex, will continue, though. Trying with Trados 2007. How would you start? Saving the java file into a txt file?


 
Michael Beijer
Michael Beijer  Identity Verified
United Kingdom
Local time: 02:01
Member (2009)
Dutch to English
+ ...
another option Mar 16, 2015

Another, related, solution might be to stick the content in a Word file, hide all text that is not between quotes, translate in your CAT tool of choice, export, unhide all hidden text.

I bet Stanislav would add it to TransTools if you asked him nicely: http://www.translatortools.net/word-about.html

Michael


 
esperantisto
esperantisto  Identity Verified
Local time: 05:01
Member (2006)
English to Russian
+ ...
SITE LOCALIZER
Just don’t translate them Mar 16, 2015

Andrea Protti wrote:

…However, TM is a must in this project, and OmegaT doesn't allow me to define non-translatable segments…


In OmegaT, for your convenience you may turn on Allow translation to be equal to source (Options → Editing Behaviour) and make sure that the source text is inserted when no match found (in the same dialog). Then if you need a segment to be left as is, just hit Enter and proceed to a next one. After finishing, disable Allow translation to be equal to source, reload the project and (re)create translation document(s), this will produce a clean final TM.


 
Andrea Protti
Andrea Protti
Switzerland
Local time: 03:01
English to German
+ ...
TOPIC STARTER
SOLVED Mar 16, 2015

Can't believe it, but thanks to the suggestions by Samuel Murray i managed to get to the bottom of this.

WORKFLOW>

1. Open Java source code file with Notepad++, save as .txt
2. Open .txt in Word, save as .RTF
3. Using find&replace & wildcards, mark the sections that do not need to be translated with ''external'' style, save .rtf
4. Translate/cleanup .rtf in TagEdior/Workbench
5. Save rtf. as .txt in Word
6. Save .txt as Java/File in Notep
... See more
Can't believe it, but thanks to the suggestions by Samuel Murray i managed to get to the bottom of this.

WORKFLOW>

1. Open Java source code file with Notepad++, save as .txt
2. Open .txt in Word, save as .RTF
3. Using find&replace & wildcards, mark the sections that do not need to be translated with ''external'' style, save .rtf
4. Translate/cleanup .rtf in TagEdior/Workbench
5. Save rtf. as .txt in Word
6. Save .txt as Java/File in Notepad++
7. Go to the movies

Thanks again to all, special big up to Samuel Murray!!!
Collapse


 
Samuel Murray
Samuel Murray  Identity Verified
Netherlands
Local time: 03:01
Member (2006)
English to Afrikaans
+ ...
@Andrea Mar 17, 2015

Andrea Protti wrote:
How would you start? Saving the java file into a txt file?


You can open the JAVA file in MS Word directly, if you use the "File > Open" method of opening it, and if you have "Confirm conversion at open" ticked in the settings (in Word 2003 it's Tools > Options > General). Word will then ask what kind of a file it is, and you select "Encoded text". Then resave it as DOC or RTF. When you save it as JAVA again, select "Encoded text" as the file type.


 
Samuel Murray
Samuel Murray  Identity Verified
Netherlands
Local time: 03:01
Member (2006)
English to Afrikaans
+ ...
@Michael Mar 17, 2015

Michael Beijer wrote:
Another, related, solution might be to stick the content in a Word file, hide all text that is not between quotes, translate in your CAT tool of choice, export, unhide all hidden text.


This approach would also work, yes, but one would have to make sure paragraph marks are not marked as hidden, otherwise adjecent hidden text will be joined together without spaces or segment breakers between them. Also, this approach won't work if you want to mark internal text (Andrea's sample didn't contain any, though). Also, this approach only works in CAT tools that support hiding hidden text (not all of them do).


 
RWS Community
RWS Community
United Kingdom
Local time: 03:01
English
Similar question was asked... Mar 17, 2015

... yesterday in the Trados Forum. The problem with the approach in Word is that if you have folders with hundreds of files then you have a lot of manual work neded to handle eachy file and prepare it for translation.

So an alternative is just to create a simple filetype to extract the translatable text. Explanation of how this might
... See more
... yesterday in the Trados Forum. The problem with the approach in Word is that if you have folders with hundreds of files then you have a lot of manual work neded to handle eachy file and prepare it for translation.

So an alternative is just to create a simple filetype to extract the translatable text. Explanation of how this might be done is here.

Regards

Paul
SDL Community Support
Collapse


 
Samuel Murray
Samuel Murray  Identity Verified
Netherlands
Local time: 03:01
Member (2006)
English to Afrikaans
+ ...
@Paul Mar 17, 2015

SDL Community wrote:
The problem with the approach in Word is that if you have folders with hundreds of files then you have a lot of manual work neded to handle eachy file and prepare it for translation.


That is true, if you need to be able to resegment files that were introduced after you started the translation, or remove any files from the list of translatable files during translation. If I know that a set of files such as you mention will remain unchanged for the duration of the translation job, then I simply merge all files into one, large file, and then tag it in MS Word, and afterwards split it all up again. Personally, for my own work, I would use a little AutoIt program for that:

http://www.leuce.com/autoit/merge%20and%20split%20files.zip

Say, doesn't the same apply to Trados 2007+ projects, i.e. you can't add or remove files from the project in mid-translation, without a degree of difficulty?

[Edited at 2015-03-17 15:08 GMT]


 
RWS Community
RWS Community
United Kingdom
Local time: 03:01
English
Not really... Mar 17, 2015

... if you have a filetype for them you add them whenever you like as there is no additional preparation required.

Trados 2007 doesn't really use projects anyway so the question seems odd, unless you used Synergy, but in Studio it's straightforward to add more files/folders to your project at any time.

Regards

... See more
... if you have a filetype for them you add them whenever you like as there is no additional preparation required.

Trados 2007 doesn't really use projects anyway so the question seems odd, unless you used Synergy, but in Studio it's straightforward to add more files/folders to your project at any time.

Regards

Paul
SDL Community Support
Collapse


 
RWS Community
RWS Community
United Kingdom
Local time: 03:01
English
This is definitely additional work... Mar 17, 2015

Samuel Murray wrote:

If I know that a set of files such as you mention will remain unchanged for the duration of the translation job, then I simply merge all files into one, large file, and then tag it in MS Word, and afterwards split it all up again. Personally, for my own work, I would use a little AutoIt program for that:



... as you have to merge the files first, and then copy paste into Word and then run your macros or search and replace as needed. At the end you clean up, copy and paste back ionto the merged form (I guess) and run the app to split them?

And you handle the files as a bilingual DOC.

Wouldn't be my choice of approach at all. But if it works for you that's good.

Regards

Paul
SDL Community Support


 
Samuel Murray
Samuel Murray  Identity Verified
Netherlands
Local time: 03:01
Member (2006)
English to Afrikaans
+ ...
Sorry, I meant 2009+ Mar 18, 2015

SDL Community wrote:
Trados 2007 doesn't really use projects anyway so the question seems odd...


Sorry, I meant to write 2009+.


 
Samuel Murray
Samuel Murray  Identity Verified
Netherlands
Local time: 03:01
Member (2006)
English to Afrikaans
+ ...
@Paul Mar 18, 2015

SDL Community wrote:
Samuel Murray wrote:
If I know that a set of files such as you mention will remain unchanged for the duration of the translation job, then I simply merge all files into one, large file [using a script], and then tag it in MS Word, and afterwards split it all up again.

This is definitely additional work...


I guess it depends on what solutions you're used to, based on what environment you choose to work in. If I had been an avid Trados 2009+ user, I probably would have taught myself how to create custom filters a long time ago. As it happens, I treat Trados 2009+ the same was as many of the other specialised CAT tools that clients require -- i.e. doing only the minimum of work in it.

...as you have to merge the files first


Yes, unfortunately it takes a long time to do that... about 30 seconds, altogether. *wink* Copy the merge script to the files' root folder, double-click it, type in which file extension should be merged, type in a name for the merged file, and wait another 5 seconds for it to merge.

...and then copy paste into Word


MS Word is capable of opening most file types almost directly -- no need to copy/paste.

If you drag/drop a file into MS Word, then MS Word will unfortunately always try to guess the file type and then open it according to its best quess, but if you use the File > Open method (and have the option "Confirm conversion" enabled in the settings), then MS Word will in 99% cases prompt you for the file type, and the appropriate answer is simply "Encoded text". Then just re-save the file as DOC or DOCX (and this is no extra effort, because you shouldn't work on a single file all the time throughout the job anyway).

...and then run your macros or search and replace as needed.


Yes, Alt+F8, type the first few letters of the macro, and hit Enter.

At the end you clean up, copy and paste back ionto the merged form (I guess) and run the app to split them?


At the end, I clean up (that is WFC's last finalisation task, but all CAT tools have such tasks, even Trados), save as "Encoded text" again (F12), and exit MS Word. Then I run the unmerge script, select which file is the merged file, and wait 5 seconds for the merged file to be unmerged.

And you handle the files as a bilingual DOC.


I'm not exactly sure what this comment means, but yes, the translation itself is done in MS Word, in DOC format, with tw4win styles, using WFC. So instead of converting the files to SDLXLIFF, I convert it to DOC, do the translation in that format, and then convert it back to the original format.

Wouldn't be my choice of approach at all.


Even if I personally had wanted to use Trados 2009+ for this particular job, I would probably have merged and styled/tagged the files in MS Word anyway, and then translate the DOC file in Trados, because (to me) marking up the text visually is much easier and simpler and quicker than trying to figure out how to write the correct regex to use in the Trados filter settings.

By visually styling/tagging the document, I can immediately see if I'm doing it right, whereas with a Trados filter I'd have to spend a lot of time tweaking and testing and reloading the files and the filter until it seems to do what I think it should do.

Naturally, if one is going to translate this type of file all the time, creating a filter in Trados may be a worthwhile investment in time and effort.


 
RWS Community
RWS Community
United Kingdom
Local time: 03:01
English
Took... Mar 18, 2015

Samuel Murray wrote:

Naturally, if one is going to translate this type of file all the time, creating a filter in Trados may be a worthwhile investment in time and effort.



... about 5 minutes The good part is now none of the other work is required. Just open the native files and translate.

But I agree with most of the things you have said here. If you're used to a particular tool then finding the best ways to make this work for you is always the way to go.

Regards

Paul
SDL Community Support


 
Pages in topic:   < [1 2]


To report site rules violations or get help, contact a site moderator:


You can also contact site staff by submitting a support request »

CAT tool for .Java files







Trados Studio 2022 Freelance
The leading translation software used by over 270,000 translators.

Designed with your feedback in mind, Trados Studio 2022 delivers an unrivalled, powerful desktop and cloud solution, empowering you to work in the most efficient and cost-effective way.

More info »
Anycount & Translation Office 3000
Translation Office 3000

Translation Office 3000 is an advanced accounting tool for freelance translators and small agencies. TO3000 easily and seamlessly integrates with the business life of professional freelance translators.

More info »