• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

localising in jdbc - rookie question

 
Robert Ingmarsson
Greenhorn
Posts: 27
Java Netbeans IDE PHP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Best forumists!

What is the general approach to localising an application based using jdbc? My approach to localising has always been using
resource bundles for data that will be translated to a certain language after a users choice if available. Is it "general" to use a
table structure like the one listed below this line



and then to query this insert statement by using the following sql



I am not a beginner to java but most likely light years behind the majority here. I need some clearence to this issue.
So far i avoid localising in sql and stick to bundles or properties files. Many thanks in advance to any one interested
in helping me out here.

Best wishes and a happy new year to all!
Robert.

 
Knute Snortum
Bartender
Pie
Posts: 2890
62
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've see localization done with property file, where the name of the file is the language, and the text is retrieved by key. But I don't know why it couldn't be a DB file. You just need a key (ID) for the text you're localizing.
 
Campbell Ritchie
Sheriff
Posts: 51349
87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is an internationalisation page in the Java™ Tutorials. That should give you a start.
 
Robert Ingmarsson
Greenhorn
Posts: 27
Java Netbeans IDE PHP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Knute Snortum wrote:I've see localization done with property file, where the name of the file is the language, and the text is retrieved by key. But I don't know why it couldn't be a DB file. You just need a key (ID) for the text you're localizing.



Knute!

Thanks for the reply! I think i've hacked it, well as for as my guess goes, but did you meant something like



and then in java say something like this



Thanks for your answer again.
 
Knute Snortum
Bartender
Pie
Posts: 2890
62
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was thinking more along the lines of the table name being the language, then select by a key for the text:
 
Robert Ingmarsson
Greenhorn
Posts: 27
Java Netbeans IDE PHP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Knute Snortum wrote:I was thinking more along the lines of the table name being the language, then select by a key for the text:


Hi, again!

I think i begin to understand, i am very lost at this issue. But your thinking appears as if it follows my own, but instead of localising the column
in the table that i do, you are localising, the table in its name? Should i then create one table for every language in every source of
content i want to translate?

/robert.
 
Knute Snortum
Bartender
Pie
Posts: 2890
62
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, I was thinking more along the lines of localizing only text that is displayed to the users, but if you are thinking of localizing every column, I would be more inclined to add a language abbreviation to each table.

customer_en
customer_es
customer_de
customer_sv
item_en
item_es
item_de
item_sv
etc.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic