• 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 ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

How do you localize your database data?

Ranch Hand
Posts: 173
Netbeans IDE PHP Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Best ranchers!

I need some help with localizing data in an embedded derby database. So far the project will support only two languages and thats Swedish and English.
I am a beginner at internationalization I have not gotten that very far in this area. This is more of a question to se how this is done in real world applications.
I know how do change the language in an application

and then

But its the database part that I am having great issues with. Could someone start an example that populate a localized database table with words in any languages.
How do you localize your applications when it comes to the database part?

Thank you so much for your time!

Best regards,

Saloon Keeper
Posts: 6515
Android Mac OS X Firefox Browser VI Editor Tomcat Server Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What kind of data is this? How is it structured, and what purpose does it have?

The most common use of localized text is to display the GUI in different languages, based on the user's choice of language. Those texts would generally be held in properties files in the Java world. You can find extensive tutorials on that at https://docs.oracle.com/javase/tutorial/i18n/intro/.
Saloon Keeper
Posts: 22265
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are two aspects to this.

One is the database itself. When you create a database, one of the parameters that generally forms it is the code page that its tables will use. It often has a default, such as UTF-8, and thus many people won't see it, but it's important if you have I18N requirements. A strictly ASCII code page, for example, couldn't manage Swedish text, as it's strictly un-decorated USA characters. NOT English, incidentally. No £ symbol! ASCII-Z, on the other hand, extends to most European alphabets. UTF-8 and Unicode can handle even more, going all the way up to Chinese and cuneiform.

So you want to make sure you can hold everything properly.

Then there's the consideration of the applications themselves. General business data would typically not be segregated by language. Señor Rodrigues is still Señor Rodrigues  no matter what language you are using. But if you're storing constant values such as a list of application error messages, you'd either have a different table for each language or - more likely - have one table with a language key. But after that, the burden is on the application.
    Bookmark Topic Watch Topic
  • New Topic