Win a copy of Machine Learning with R: Expert techniques for predictive modeling this week in the Artificial Intelligence and Machine Learning forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

Restart after loading Properties

 
Ranch Hand
Posts: 56
Netbeans IDE PHP Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, world!

I have an application that i wan't to translate into several languages, by now its only in swedish. I have never done this before.
I am using a Properties file to store my text. I wan't to select languages with a combo box but i don't know the procedure after
the selection has been made. How do you update an application after you have selected another language? Do you restart the
application and how do I accomplish that?

This is how a load my Properties file. The method load(Locale loc) resides in a class called "Localizer"



And this is how I wan't to select each language:




And also, what is the best way to load a Properties file and where? Im trying to load the Properties file at the top of my appliacaion,
but it is not working well. Is there a certain guideline for this? Sorry for all the bombardment of questions in this post, but I'm
very in to the subject at the moment.

Very kind regards,
Robert!





 
Bartender
Posts: 9584
13
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have a look at this tutorial.  You don't manage the property files themselves.  You set a Locale and let Java determine what properties are correct.
 
Robert Ingmarsson
Ranch Hand
Posts: 56
Netbeans IDE PHP Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Joe Ess wrote:Have a look at this tutorial.  You don't manage the property files themselves.  You set a Locale and let Java determine what properties are correct.



Best, Mr Ess!

Sorry for a late reply. I know how ResourceBundles work in theory but not in the "real world" so to speak. I am trying to
learn how to internationalize a program and how to "reload" ResourceBundles or Properties object. It's so difficult for me to
get a grasp on. My goal is to have an actionlistener that let the user select languages from a group of JMenuItems.

This is driving me crazy. I realize the solution must be simple, but i am blinded at the moment of confusion. I would be very
glad if anyone could help me out here. I have read the tutorial on localization but i get stuck when it comes down
to the practical part.

Very kind regards,
Robert!
 
What a show! What atmosphere! What fun! What a tiny ad!
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!