NetLogo icon indicating copy to clipboard operation
NetLogo copied to clipboard

Turkish capitalization rules cause issues with compiler, widget creation

Open nicolaspayette opened this issue 12 years ago • 5 comments

NetLogo keywords involving the letter i cause compilation errors, e.g.:

Nothing named THİCKNESS has been defined

when writing thickness in lowercase.

A recent user email brought the issue forward again, but it had been reported before:

http://groups.yahoo.com/group/netlogo-users/message/7798 http://groups.yahoo.com/group/netlogo-users/message/15356

The basic issue is that a lowercase i doesn't capitalize to a regular uppercase I when using the Turkish locale:

scala> "i".toUpperCase(new java.util.Locale("tr"))
res7: java.lang.String = İ

To reproduce, just start NetLogo with -Duser.language=tr.

To workaround, start NetLogo with -Duser.language=en (this can be added to NetLogo.sh) or manually uppercase all problematic names in your NetLogo code (i.e., use THICKNESS instead of thickness).

A permanent fix involves explicitly using .toUpperCase(java.util.Locale.ENGLISH) in places where it matters.

nicolaspayette avatar Apr 03 '13 21:04 nicolaspayette

although I marked #459 as a duplicate, it does have the additional information that creation of monitors and switches is also affected. I've edited this ticket name to be more general

SethTisue avatar Oct 15 '13 16:10 SethTisue

Thank you Seth,

I added 2 lines to the end of (NetLogo 5.0.4.vmoptions) file instead exNetLogo 4.0.2.lax file in NetLogo directory and worked :)

-Duser.language=en
-Duser.country=US

boraxtr avatar Oct 15 '13 18:10 boraxtr

Quick update on the workaround - another user ran into this problem recently. The workaround should still be good, but it needs to be applied somewhat differently. NetLogo no longer has a .vmoptions file, instead it now has a NetLogo.cfg file. Instructions on where to find this file are here. Add the following two lines at the end of the [JVMOptions] section (you don't need to add the make the changes described in the FAQ).

-Duser.language=en
-Duser.country=US

mrerrormessage avatar Jan 11 '18 21:01 mrerrormessage

Could this issue explain why a Turkish student of mine found NetLogo did not recognize the extensions keyword? Our workaround was to create an English-language account for her. (NetLogo 6.0.2 on OSX.)

alan-isaac avatar Feb 04 '18 19:02 alan-isaac

Yes, this would almost certainly explain why the extensions keyword will not work for a student with a Turkish locale. I'm not certain that a separate account is necessary, the workaround described above (editing the NetLogo.cfg file) should work for the student.

mrerrormessage avatar Feb 05 '18 14:02 mrerrormessage