So, I have a program that I’d like to translate to Croatian…
But I’ve learned that swing may sometimes create dialogs and windows I have not expected (e.g. when trying to rename a file into existing name in JfolderChooser).
So instead of trying to expect the unexpected, I have decided to translate whole swing into Croatian and submit my translation to Oracle (or whoever I should) (if that is posible, I’ve heard it’s encouraged). Then I can use Localization classes just to select my language and that’s it (one day, at least)…
However, I don’t really know how to do it, or which files of src folder to look into, so I need your help.
What (java) files do I look into, and what is standardized procedure of translating Swing into a new language?
Are there any other things I should do except dealing with language (like currency, etc.)?
And last of all, how do I submit it to Oracle?
You can do that, but it is very unlikely they will include your translations. That’s just because once you include the translations for given language, you need to support it. Even though these translations doesn’t change often, it is still rather serious effort and personally, I wouldn’t risk including something that might soon be out of date.
There is a second side of this story: somebody has to review your translations. Believe it or not, it ain’t cheap. So unless Oracle decide to crowd-source their translations for JDK, I am afraid you’re out of luck.
On the other hand, most of the User Interface (actually all except for hardcoded strings…) could be translated by assigning appropriate UIManager’s keys to translated values… This is quite an effort, but it can be done.
The problem here is, you don’t know what keys are valid (or appropriate), so if you want to really translate the whole thing, you need to reverse engineer their controls (using the source code attached to JDK’s distribution).
It is pretty surprising that we don’t have sub-classed controls with externalized messages easily available… It is a common problem… I did something like this for my studies, but I am afraid I don’t know where do localized JFileChooser is… I am pretty sorry about that.