my dog learned polymorphism*
The moose likes Servlets and the fly likes Internationalization Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Internationalization" Watch "Internationalization" New topic
Author

Internationalization

rs venky
Greenhorn

Joined: Dec 25, 2000
Posts: 4
Following is my JSP code:
<%@page import =" java.util.*" %>
<%!
String language;
String country;
%>
<%
try
{
language = new String("fr");
country = new String("FR");
Locale currentLocale;
ResourceBundle messages;
currentLocale = new Locale(language, country);
messages = ResourceBundle.getBundle("MessagesBundle",currentLocale);


out.println(messages.getString("greetings"));
out.println(messages.getString("inquiry"));
out.println(messages.getString("farewell"));
}catch (Exception e) {out.println(e);}

%>
<html>
<body>
<h2>Kumar</h2>
</body>
</html>
If i try executing the page in IE i am getting following error and one more thing is all the resource bundle files are residing in the directory.
Error :
java.util.MissingResourceException: can't find resource for MessagesBundle_fr_FR
Any one can suggest how it has to be done.
Thanks
Venky

venky
Sharang Thorat
Greenhorn

Joined: Dec 07, 2000
Posts: 21
Hi
if properties file are in the classpath then you will not
get exception.
In case you r using tomcat keep properties file in already
set classpath or change it.
regards
sharang
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Internationalization
 
Similar Threads
Internationalization Problem
Problem in displaying Asian languages in Internationalization
Internationalization
ResourceBundle.getBundle
Internationalization