Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Contributor
Posts: 38
Registered: ‎05-21-2011
My Device: 8900
My Carrier: rrr

unable to use SERBIAN, SLOVENIAN languages for translate

Hi,

i am working for translate an application  in multiple language by using "Locale.get(Locale.LOCALE_en" but now unable to convert"SERBIAN, SLOVENIAN languages" because blackberry plugins(1.3) 9800simulater could not support these languages. so please give me solution what should i do?

Contributor
Posts: 38
Registered: ‎05-21-2011
My Device: 8900
My Carrier: rrr

Re: unable to use SERBIAN, SLOVENIAN languages for translate

please give me revert with positive response.
Contributor
Posts: 38
Registered: ‎05-21-2011
My Device: 8900
My Carrier: rrr

Re: unable to use SERBIAN, SLOVENIAN languages for translate

hi developers,

 

no one give me answer of my question. so please tell me one thing why we use "Locale.get(Locale.LOCALE_en)"

for multiple language. if pulgin do not provide method for SERBIAN, SLOVENIAN so shoud i use any one method of plugin like "Locale.get(Locale.LOCALE_hn)" & provide the values of SERBIAN, SLOVENIAN keys. it would be write or wrong. please give me revert.

Developer
Posts: 1,807
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.3.2.858, Z10 (STL100-3)-10.3.1.2576, Z30 (STA100-5)-10.3.1.2582, Passport (SQW100-1)-10.3.1.2576, PlayBook (16GB)-2.1.0.1917
My Carrier: Verizon

Re: unable to use SERBIAN, SLOVENIAN languages for translate

Locale has other constructors besides those that take an constant integer. Have you tried something like "Locale.get("sr", "scg")"?

 

Documentation is your friend, if you go to the Locale API doc page, it says it's "Compatible with java.util.Locale in Java's standard edition." and links to the java.util.Locale API docs.

 

In the explanation section of that page it lists out ISO-639 and ISO-3166 codes which are used in the creation of a Locale. If you are making resource files and localizing them then you would simply append the language codes to the end of the resource file's name and BlackBerry will handle picking the correct language for you (unless you want a specific language, then you need to use the Locale class).

 

Last, since you said that you are making a translation app, know that BlackBerry does not do translation. You need to use the previously mentioned resource files and store different translations, or use an online service. BlackBerry's (and any other device's) handling of languages is simply to pick the correct resource file since errors, messages, etc. are usually locale specific, they don't do any translation internally.

 

Just trying to cover all bases.

---Spends time in #blackberrydev on freenode (IRC)----
Three simple rules:
1. Please use the search bar before making new posts.
2. "Like" posts that you find helpful.
3. If a solution has been found for your post, mark it as solved.
--I code too much. Well, too bad.
Contributor
Posts: 38
Registered: ‎05-21-2011
My Device: 8900
My Carrier: rrr

Re: unable to use SERBIAN, SLOVENIAN languages for translate

Thanks for your response. but i didn't try something like "Locale.get("sr", "scg")". can you provide me a demo, how to use this, & how to use Locale class for SERBIAN, SLOVENIAN languages?

Developer
Posts: 1,807
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.3.2.858, Z10 (STL100-3)-10.3.1.2576, Z30 (STA100-5)-10.3.1.2582, Passport (SQW100-1)-10.3.1.2576, PlayBook (16GB)-2.1.0.1917
My Carrier: Verizon

Re: unable to use SERBIAN, SLOVENIAN languages for translate

That kinda was the (unplanned) demo.

 

I don't use Locale and since you seem like you are using it, but you can't FIND a certain locale, I looked up the ISO codes and attempted to produce the proper Locale get function.

 

The only place I know you can use it is with getting a ResourceBundle. That way you can get language specific resource bundles.

---Spends time in #blackberrydev on freenode (IRC)----
Three simple rules:
1. Please use the search bar before making new posts.
2. "Like" posts that you find helpful.
3. If a solution has been found for your post, mark it as solved.
--I code too much. Well, too bad.
Contributor
Posts: 38
Registered: ‎05-21-2011
My Device: 8900
My Carrier: rrr

Re: unable to use SERBIAN, SLOVENIAN languages for translate

Thanks,

but i am unable to use ISO codes. i found the ISO decoding table to this link "http://www.iso.org/iso/country_codes/iso_3166_code_lists/iso-3166-1_decoding_table.htm" please tell me how to use it. sorry to say but i am fresher so please coprate me.

Developer
Posts: 1,807
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.3.2.858, Z10 (STL100-3)-10.3.1.2576, Z30 (STA100-5)-10.3.1.2582, Passport (SQW100-1)-10.3.1.2576, PlayBook (16GB)-2.1.0.1917
My Carrier: Verizon

Re: unable to use SERBIAN, SLOVENIAN languages for translate

I used this for ISO-3166 codes: http://www.chemie.fu-berlin.de/diverse/doc/ISO_3166.html

---Spends time in #blackberrydev on freenode (IRC)----
Three simple rules:
1. Please use the search bar before making new posts.
2. "Like" posts that you find helpful.
3. If a solution has been found for your post, mark it as solved.
--I code too much. Well, too bad.
Contributor
Posts: 38
Registered: ‎05-21-2011
My Device: 8900
My Carrier: rrr

Re: unable to use SERBIAN, SLOVENIAN languages for translate

Thanks for that link,

but i am unable to use country code. how to use it. please give me a little bit demo with using country code for SERBIAN, SLOVENIAN .

Highlighted
Developer
Posts: 1,807
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.3.2.858, Z10 (STL100-3)-10.3.1.2576, Z30 (STA100-5)-10.3.1.2582, Passport (SQW100-1)-10.3.1.2576, PlayBook (16GB)-2.1.0.1917
My Carrier: Verizon

Re: unable to use SERBIAN, SLOVENIAN languages for translate

Sorry for the delay, have been very busy lately.

 

I went through 2 sites to see how to use Locale (the normal J2SE version) just because I havn't really had a need for it:

The second link lists a bunch of locale values, so I tried 2 of the ones for Serbian and Slovenian.

 

Slovenian (generic): Locale.get("sl")

Slovenian (Slovenia): Locale.get("sl", "SI")

Serbian (generic): Locale.get("sr")

Serbian (Yugoslavia): Locale.get("sr", "YU")

 

They worked just fine, if this isn't what your looking for then I don't know.

---Spends time in #blackberrydev on freenode (IRC)----
Three simple rules:
1. Please use the search bar before making new posts.
2. "Like" posts that you find helpful.
3. If a solution has been found for your post, mark it as solved.
--I code too much. Well, too bad.