This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 157943

Summary: Entity Class Generation Problem on Turkish Locale Systems
Product: javaee Reporter: sanilunlu <sanilunlu>
Component: PersistenceAssignee: Sergey Petrov <sj-nb>
Status: RESOLVED FIXED    
Severity: blocker CC: pslechta
Priority: P3 Keywords: I18N
Version: 4.x   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:
Attachments: screenshot

Description sanilunlu 2009-02-04 21:19:11 UTC
When we generate entity classes using NetBeans wizards on a system with Turkish locale, generated sources have many 
wrong characters while converted to lower case (ex. personıd, jobtıtle, ...), because of lower case ı character in 
Turkish is the same as upper case I (i) in English. I think source code generation components must convert these cases 
in English locale, as Java source code syntax rules are designed in English alphabet. The same problem can be seen in 
RESTful Web Services code generation for JAX-RS API.
Comment 1 pslechta 2009-05-14 19:42:54 UTC
This may be intentional -- in case when identifiers or column names are in Turkish language...
Waiting for opinion from NB developers...
Comment 2 Sergey Petrov 2009-07-30 09:28:21 UTC
do you mean you expect names like (personId, jobtItle etc)?
first one seems reasonable, but second one looks strange, what are names of tables/columns, are names in english/ascii?
do you mean all places with i and I are replaced with ı? if tables/database etc have non-ascii chanracters in names, can
you attach schema?
Comment 3 sanilunlu 2009-07-30 09:37:15 UTC
I expect getting column names like personid, jobtitle, ... I agree that it may be intentional to do like I stated, but
then there should be an option to select a Locale which will be used in case conversation operations, because many times
you don't design table column names in the same language your platform operates.
Comment 4 Sergey Petrov 2009-07-30 09:45:16 UTC
ok, what's about real column names?
what is your os/locale/system encoding?

is there any problem with how it works?
have you filed an issue  for "RESTful Web Services code generation for JAX-RS API"?
Comment 5 sanilunlu 2009-07-30 10:17:59 UTC
Real column names are designed in upper case like PERSONID and JOBTITLE, but they are case-independent in sql, query
engines operate in English locale, I think, so we can access columns with "personid". When we generate entity classes
with these column names, I think there can be a Locale selection box in the wizard, so if the developer wants to
preserve platform locale he/she can select, but if he/she want to select a specific locale, English in my case, he/she
can select.

I didn't file an issue about JAX-RS API, which I couldn't decide which component it's about.
Comment 6 Sergey Petrov 2009-07-30 10:32:51 UTC
thanks,
one more question what does it mean "lower case ı character in 
Turkish is the same as upper case I (i) in English", what is the same?
Comment 7 sanilunlu 2009-07-30 10:54:35 UTC
In Turkish, upper case of i character is İ, but in English it is I; also little ı (which is not in English alphabet)
character's upper case is I. So it's a problem when we name a column JOBID and it is converted to lower characters not
jobid, but jobıd. 
Comment 8 reneedr 2010-04-23 22:41:24 UTC
Created attachment 97944 [details]
screenshot

screenshot of missing tabs immediately after fresh install
Comment 9 Sergey Petrov 2010-05-21 11:58:47 UTC
usage of toLowerCase(Locale.ENGLISH) may help, at least to convert JOBTITLE properly, but I'm not sure how it will handle case with local characters usage in names.
Comment 10 Sergey Petrov 2012-05-10 11:37:14 UTC
3 years for the issue. main problem it's hard to test fix with different locales, for future release I can consider an option for generation to be able to choose conversion type localized vs english based. this change will be backward compatible.
Comment 11 Sergey Petrov 2014-01-27 16:43:45 UTC
ok, decide to folдow initial suggestion about English locale.
even if some db allow Turkish and other non default locales for table names it looks to be less common case(I can't verify if it have sense) and it's better to get proper behaviour in more general use-case with Latin names.
Comment 12 Sergey Petrov 2014-01-28 13:53:16 UTC
http://hg.netbeans.org/web-main/rev/b07af82807a2
Comment 13 Quality Engineering 2014-01-29 02:53:20 UTC
Integrated into 'main-silver', will be available in build *201401290001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/b07af82807a2
User: Sergey B. Petrov <sj-nb@netbeans.org>
Log: #157943 decide to implement initial suggestion for English local usage
Comment 14 ongun 2014-04-04 09:11:45 UTC
check TAO's Sun page for the fix,
Link is 
https://blogs.oracle.com/tao/entry/set_netbeans_user_interface_language

This is quotation of what it says.

Set Netbeans user Interface language 

By Zhiqi Tao on Feb 13, 2008


Netbeans automatically uses the Windows system default language as the default user interface language. I believe that it means to be a nice feature for localization. But I personally find it uncomfortable because I have been used with English interface. 


After I did some Google search, I learned a few tips to set the Netbeans UI language.

1. Temporary Solution

Add "--locale en:US" at the end of Netbeans startup command. 

"C:\\Program Files\\NetBeans 6.0.1\\bin\\netbeans.exe"  --locale en:US 

2. Permanent Solution

Go to Netbeans installation directory, for example, 

C:\\Program Files\\NetBeans 6.0.1\\etc

Open "netbeans.conf" and find netbeans default option line


netbeans_default_options="-J-client -J-Xss2m -J-Xms32m -J-XX:PermSize=32m -J-XX:MaxPermSize=200m -J-Xverify:none -J-Dapple.laf.useScreenMenuBar=true"


Add "-J-Duser.language=en -J-Duser.region=US" to the end of this line

netbeans_default_options="-J-client -J-Xss2m -J-Xms32m -J-XX:PermSize=32m -J-XX:MaxPermSize=200m -J-Xverify:none -J-Dapple.laf.useScreenMenuBar=true -J-Duser.language=en -J-Duser.region=US"





It would be nice that there is an option to allow me choose the user interface language in the next Netbeans release.


Reference:

http://hantsy.blogspot.com/2007/05/netbeans.html

http://www.9php.com/FAQ/cxsjl/java/2007/11/555583596050.html