• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Desktop application in 2 language

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Saloon Keeper
Posts: 10687
85
Eclipse IDE Firefox Browser MySQL Database VI Editor Java Windows ChatGPT
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 17644
300
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Likes 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Bartender
Posts: 3323
86
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Marshal
Posts: 79151
377
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
To do a great right, do a little wrong - shakepeare. twisted little ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic