Internationalizing Strings

How should I set up my strings so that they can be translated to other languages?  JDeveloper does a very nice job of automatically creating a resource bundle that contains your strings.  Let's say you are creating a new button:

i18n1.png

 

By default, "commandButton 1" is the name that this button will display.  Now you can change this Text to be a value from your resource bundle and you can also define an AccessKey, something like "Close" with "C" will name your button "Close" with the "C" underlined as your accelerator.  However, if someone later translates "Close" to a language where "C" is no longer part of the new word, then your "C" AccessKey won't work.  What to do? 

Use the TextAndAccessKey field instead.  Click on the little down arrow next to the field and select "Select Text Resource..."

i18n2.png

 

Then enter your desired value with the AccessKey directly in the string:

i18n3.png
    

 

By using "&" before the letter "C", you are asking that "C" be the AccessKey.  JDeveloper will automatically underline the "C" for you and provide accelerator functionality.  Now if someone were to translate "Close" to another language, they would see that "C" is the AccessKey and they could pick a new AccessKey and not lose the accelerator functionality that JDeveloper provides.

 

Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

This blog contains technical "how-to's" of using Jdeveloper 11g to build a web based application.

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today