Pages in topic:   [1 2] >
CAT tool for .Java files
Thread poster: Andrea Protti
Andrea Protti
Switzerland
Local time: 03:48
English to German
+ ...
Mar 13, 2015

Looking for a CAT tool capable of handling .JAVA files.

Direct link Reply with quote
 

Adrien Esparron
Local time: 03:48
Member (2007)
German to French
+ ...
JAVA files ? Mar 13, 2015

Could you explain what a .JAVA file is? Have you some examples? At time I do not see which kind of files it refers to. Best

Direct link Reply with quote
 
Andrea Protti
Switzerland
Local time: 03:48
English to German
+ ...
TOPIC STARTER
Hi Adrien Mar 13, 2015

Hi Adrien

the file i got has the extension .JAVA. Here's a snippet>

public class Locales_en extends java.util.ListResourceBundle {

@Override
public Object[][] getContents() {
return contents;
}

static Object[][] contents = {
{LID.DT_MATRIX,"[matrix]"},
{LID.P_CAL,"Calendar"},
{LID.P_MA_EF0,"Your action cannot be completed."},
{LID.P_NAVI,new String[]{"Top of page","Bottom of page"}},
{LID.SO_AUTO,"- automatically -"},
{LID.SO_ALL,"-- all --"},
{LID.SO_ANY,"-- any --"},
{LID.SO_MULT,"-- multi select --"},
{LID.SO_YES,"yes"},
{LID.SO_NO,"no"},
{LID.SO_EQUAL,"--"},
{LID.SO_PLS,"-- please select --"},

Text to translate would be within the '' ''-marks, i.e [matrix], Calendar etc.


Direct link Reply with quote
 
esperantisto  Identity Verified
Local time: 05:48
Member (2006)
English to Russian
+ ...
Customer's fault Mar 14, 2015

Your customer is wrong in suggesting to translate this kind of file. This file is a program source code file and MUST NOT be localized, otherwise the program GUI will be ruined. They should send you Bundle.properties (so called Java resource file) instead and you should return a translated file with its name changed to Bundle_de.properties for German.

[Edited at 2015-03-14 11:25 GMT]


Direct link Reply with quote
 

Adrien Esparron
Local time: 03:48
Member (2007)
German to French
+ ...
source code Mar 14, 2015

Well, what you called ".JAVA files" is just a source code and just a text file as you see. So you could do it with any CAT tool, but I'm not sure its useful. Just search the quotation marks in a text editor and translate. If necessary use a search and replace function.

I see you also posted in the German forum. OmegaT is not a bad choice (free).

Kind regards


Direct link Reply with quote
 

Michael Joseph Wdowiak Beijer  Identity Verified
United Kingdom
Local time: 02:48
Member (2009)
Dutch to English
+ ...
OmegaT & CafeTran support Java Resource Bundles (*.properties) Mar 14, 2015

It seems OmegaT might support .java (and .properties) files. See e.g.:

http://sourceforge.net/p/omegat/feature-requests/274/

I'm sure there are also other CAT tools.

I also know that my favourite CAT tool, CafeTran, supports Java Resource Bundles (*.properties), Mac String Resources (*.strings) and Windows NET Resources (*.resx). Not sure about .java files, but I'm sure the developer could add it in no time.

Passolo and Alchemy Catalyst of course also support them, but are very expensive.


[Edited at 2015-03-14 12:09 GMT]


Direct link Reply with quote
 

Didier Briel  Identity Verified
France
Local time: 03:48
Member (2007)
English to French
+ ...
This code is not internationalised Mar 14, 2015

esperantisto wrote:
Your customer is wrong in suggesting to translate this kind of file. This file is a program source code file and MUST NOT be localized, otherwise the program GUI will be ruined.

Actually, this code is not internationalised, which means the GUI *is* in the source code.


They should send you Bundle.properties (so called Java resource file) instead and you should return a translated file with its name changed to Bundle_de.properties for German.

That would be the case if the program had been internationalised.

Edit: I stand corrected. This program is internationalised, but not in a very efficient way, since it doesn't use external files ("bundles") for localisation:
http://docs.oracle.com/javase/7/docs/api/java/util/ListResourceBundle.html

Didier

[Edited at 2015-03-14 15:32 GMT]


Direct link Reply with quote
 

Didier Briel  Identity Verified
France
Local time: 03:48
Member (2007)
English to French
+ ...
No current .java support in OmegaT Mar 14, 2015

Michael Beijer wrote:

It seems OmegaT might support .java (and .properties) files. See e.g.:

http://sourceforge.net/p/omegat/feature-requests/274/

This is a request for improvement that was never implemented (hence the "open" status).

It corresponds to the "ListResourceBundles" format:
http://docs.oracle.com/javase/7/docs/api/java/util/ListResourceBundle.html

The code doesn't compile any more in OmegaT, so I don't know whether it would parse correctly the example given.

Didier


Direct link Reply with quote
 
esperantisto  Identity Verified
Local time: 05:48
Member (2006)
English to Russian
+ ...
Why, OmegaT still can be used Mar 14, 2015

Although there's no specific filter for Java source files, I'd still suggest using OmegaT for such a job as follows:
1. Add .java to possible name extensions for the text file filter.
2. Set UTF-8 as the encoding for translated files.
3. Translate what needs to be translated (messages in quotation marks) and leave pure code parts as they are.

I see two issues generally:
a) it's quite hard to assess the volume of work;
b) you have to understand the Java syntax.

But those issues don't make this mission impossible.


Direct link Reply with quote
 

Adrien Esparron
Local time: 03:48
Member (2007)
German to French
+ ...
How to localize ? Mar 14, 2015

Even if esperantisto and Didier could be right saying that what the client is asking to you is not the best way to localize a soft, I do not agree when I read "MUST NOT be localized" because it is not the code that has to be translated in our case, just some stings between quotation marks.

There is a big difference and its because I said it was not so useful to use a CAT tool (even if possible) : the purpose is not being able to parse or not some resources or properties, but to translate well defined strings.

It is not the Andrea's problem to know what the client will do with the translated files. The developers may know how they proceed and what is to be done, or?

In such a case, I would use Notepad++, nothing more. Just my point of view.


Direct link Reply with quote
 

Adrien Esparron
Local time: 03:48
Member (2007)
German to French
+ ...
Is the purpose to build also a TM? Mar 14, 2015

If you have to create a TM with the strings, use a CAT tool which support the files. If not, why bother with such things, with some possible issues not expected.

More,

esperantisto a écrit :



3. Translate what needs to be translated (messages in quotation marks) and leave pure code parts as they are.



Also a tool without any interest in such a case... and not beeing sure it would restitute the correct file when finished and cleaned.


Direct link Reply with quote
 
esperantisto  Identity Verified
Local time: 05:48
Member (2006)
English to Russian
+ ...
Some remarks Mar 14, 2015

Adrien Esparron wrote:

Even if esperantisto and Didier could be right saying that what the client is asking to you is not the best way to localize a soft, I do not agree when I read "MUST NOT be localized" …


Taking into account Didier’s comments, my remark is, of course, not valid. I got used to Java programs internationalized/localized via Java bundles, not via hard-coding in the source.

Adrien Esparron wrote:

There is a big difference and its because I said it was not so useful to use a CAT tool…


The difference is not so big because GUI strings are often repetitive. Besides, with a CAT tool you can, obviously, use glossaries and reference TMs, if you have any. Yes, a CAT tool won’t be as efficient as in a case of a well-structured localization file, but…

Adrien Esparron wrote:

In such a case, I would use Notepad++, nothing more. Just my point of view.


…still a CAT tool is more efficient, if it’s not just a single source file but a project. A Java project may include hundreds or even thousands of such .java files. Processing every of them with a text editor is quite a tedious task.

Adrien Esparron wrote:

Also a tool without any interest in such a case... and not beeing sure it would restitute the correct file when finished and cleaned.


Once again: it’s OmegaT. Provided that you adjust file filter settings.


Direct link Reply with quote
 
Andrea Protti
Switzerland
Local time: 03:48
English to German
+ ...
TOPIC STARTER
Thanks a bunch Mar 16, 2015

Thank you for all your kind replies. Tried OmegaT and it is indeed capable of handling the java source code files. However, TM is a must in this project, and OmegaT doesn't allow me to define non-translatable segments (as far as i can tell) which defies somehow the reason why we would want to use a TM. The less clutter, codewise, there is in there, the better, no?

I guess what i will look for is a routine permitting the segments that need to be localized to be exported from the source code file into a text/wordfile, which then, in turn, can be re-imported, once translated, into the original file. Alternatively, i will have to convince the client to go along with .properties files, but need to do some more research on this re: on how Trados Studio 2009 is handling these files.

Once again, many thanks to all.


Direct link Reply with quote
 

Samuel Murray  Identity Verified
Netherlands
Local time: 03:48
Member (2006)
English to Afrikaans
+ ...
I would use WFC... Mar 16, 2015

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.



Direct link Reply with quote
 

SDL Community  Identity Verified
United Kingdom
Local time: 03:48
English
You could probably... Mar 16, 2015

Andrea Protti wrote:

..., but need to do some more research on this re: on how Trados Studio 2009 is handling these files.



... handle this with a simple regex filetype. It's usually fairly straightforward to extract text between quotes and ignore everything else.

Regards

Paul
SDL Community Support


Direct link Reply with quote
 
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

Advanced search







TM-Town
Manage your TMs and Terms ... and boost your translation business

Are you ready for something fresh in the industry? TM-Town is a unique new site for you -- the freelance translator -- to store, manage and share translation memories (TMs) and glossaries...and potentially meet new clients on the basis of your prior work.

More info »
CafeTran Espresso
You've never met a CAT tool this clever!

Translate faster & easier, using a sophisticated CAT tool built by a translator / developer. Accept jobs from clients who use SDL Trados, MemoQ, Wordfast & major CAT tools. Download and start using CafeTran Espresso -- for free

More info »



Forums
  • All of ProZ.com
  • Term search
  • Jobs
  • Forums
  • Multiple search