jtorchat / jtorchat-old

Academic, Java, p2p, Messaging, Messenger, cyptography
21 stars 12 forks source link

Language Files #1

Closed Porlington closed 12 years ago

Porlington commented 12 years ago

The current language files use numbers to organize the different entries, this makes it confusing when reading code that uses it. For example.

popup.add(getMenuItem(language.langtext[76], new ActionListener() {

It is incredibly annoying to have to go look up whatever entry 76 is. I propose changing the language system to something like

popup.add(getMenuItem(language.get("#gui.contact.blacklist"), new ActionListener() {

or something of the like, as this immediately tells someone looking at the code what it does.

jtorchat commented 12 years ago

I' not think so. Beside eclipse i have the language file open and so it is very easy to show the right tag and compare it. When i change it, it need more code and when there more and more lines it is very bad.

smithrachael commented 12 years ago

Guys,

I strongly suggest using java's Resource Bundle for handling translated text in the application. Please, take a look at the links below:

[1] Tutorial for internationalization of messages (aka i18n) http://www.avajava.com/tutorials/lessons/how-do-i-use-locales-and-resource-bundles-to-internationalize-my-application.html

[2] Eclipse plugin for editing the messages (I love this one!) http://sourceforge.net/projects/eclipse-rbe/

[3] Screenshot of the Eclipse plugin. Notice how it looks beautifully organized. http://oslc.files.wordpress.com/2006/12/resource-screenshot.jpg

userid0dev commented 12 years ago

i actually would use smithrachael's suggestion and even maybe merge the lang files so the entries can be used more than once.

like transfer is needed to translate at least 3 times. that's just a waste of time.

NOW: lang000069=transfer aborted lang000071=starting transfer lang000072=transfer complete

THEN: jtc.aborted=aborted jtc.starting=starting jtc.complete=complete jtc.transfer=transfer

and also contact:

NOW: lang000074=Edit contact. lang000075=Pardon contact. lang000076=Blacklist contact. lang000077=Delete contact.

THEN: jtc.edit=Edit jtc.pardon=Pardon jtc.blacklist=Blacklist jtc.delete=Delete jtc.contact=Contact

and then in code put them together as needed.

jtorchat commented 12 years ago

Ok, when soo many people like it then i change it when i work next time on the source.

zerotamaitsu commented 12 years ago

I guess I shall close this for now, as it doesn't look like it's going to happen (seems like nobody is working on it)