• Post Reply Bookmark Topic Watch Topic
  • New Topic

Desktop application in 2 language

 
kamel mezni
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am developing a point of sale application in java using netbeans. Interfaces of the app are in english. I want to add Arabic interfaces also that my app can run in 2 language user can swish fron english to arabic or arabic to english. What is the best way do that. I am beginner in java development
 
Carey Brown
Bartender
Posts: 2256
28
Eclipse IDE Firefox Browser Java MySQL Database VI Editor Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Google "i18n", which is the short hand for "internationalization" (because there are 18 letters between the 'i' and the 'n'). Very flexible but tedious. Not exactly a beginner topic.
 
kamel mezni
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your response I will try to use google i18n for internationalisation. If you have an example for that or a link to a video this will be very helpful for me.
 
Junilu Lacar
Sheriff
Posts: 10038
120
Android Eclipse IDE IntelliJ IDE Java Linux Mac Scala Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
kamel mezni wrote:Thanks for your response I will try to use google i18n for internationalisation. If you have an example for that or a link to a video this will be very helpful for me.

Carey meant that you should use Google or whatever search engine you like to use and search for Java i18n internationalization
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I use this Resource Bundle Editor for Eclipse
https://sourceforge.net/projects/eclipse-rbe/

You might want to consider something similar for Netbeans. Such editors are much more easy to use than editing multiple files manually.
 
Tony Docherty
Saloon Keeper
Posts: 3142
72
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The advice given so far is correct and provided you are dealing with simple text and only using standard GUI components everything will work well and without too much work on your behalf. The problem starts getting more complex when you have to dynamically generate text and even more complicated if you are creating your own GUI components and/or decided to layout the text yourself.

Dynamic text: For example if you want to display a message such as "You have selected 5 items" the number '5' needs to be inserted into the static string. Now that in itself is not difficult in each of your language files you simply add a place holder(s) in your text for where you want the number to go (ie You have selected {0} items) and ResourceBundle provides methods to insert the value for you. The difficulty is in the way different languages deal with plurals, in the example given in English the word 'item' needs to be 'items' where the number is 0 or greater than 1 and 'item' if it is 1. I'm not sure what the rules are in Arabic but they probably aren't the same. Again ResourceBundle does provide means of handling this scenario but it can become very complicated.

Laying Out Text: My advice is don't try and do this unless you really really have to and even then think long and hard before heading down this path as it's almost certainly the wrong thing to do. Providing support for left to right, right to left and top to bottom text layouts is particularly complicated (and tedious) and whilst there are lots of classes to help you it's a lot of work to do properly. If you need to create your own components use a standard text component either as a composite part of your component or as a rubber stamp to handle the laying out of text.
 
Campbell Ritchie
Marshal
Posts: 52581
119
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

There is a section of the Java™ Tutorials devoted to this subject; I haven't used it myself, but I expect it will help you.
I shall move this discussion as too advanced for this forum.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!