Winstep

Software Technologies


 Winstep Forums


Print view
Board index : Winstep Forums : General Discussion  [ 22 posts ] Go to page 1, 2  Next
Author Message
 Post subject: Language issues
PostPosted: Sat Jan 29, 2011 6:04 am 
Offline
User avatar

Joined: Sat Jan 08, 2011 5:57 pm
Posts: 898
Location: Athens, Greece
Hey mate.
As I'm making progress with the translation, I've stumbled on what appears to be an issue with language settings.
I just had this idea of looking at how my translations show, now that I've done more than half, and...
...well... you can see for yourself. The important element here is the system setting of "Language for non-Unicode programs" (Control Panel > Clock, Language and Region > Change keyboards or other input methods > Administrative > Language for non-Unicode programs). One of my systems has this set to "Greece" and another to "United States". I got screenshots, where you can see the results.

Maybe it would be simpler just to compile Nexus as Unicode?

Image
Even the translator shows garbage in the US non-Unicode language (NUL) system.

Image
Right-click menus are again a mess in the US NUL system.

Image
Same goes for the pop-up balloons. Greek so far is perfect.

Image
The US NUL is consistently messy, HOWEVER in the prefs even the Greek NUL has problems in many fields. It is weird how some fields show perfectly fine, though...

Image
Easter egg: the exit button (leftmost in the bottom) remains in Greek (or in mess) even after I select "English".

Any ideas?

_________________
Live long and prosper...


Back to top
 Profile WWWYIMICQ 
 
 Post subject: Re: Language issues
PostPosted: Sat Jan 29, 2011 7:04 am 
Offline
Site Admin
Site Admin
User avatar

Joined: Thu Feb 26, 2004 8:30 pm
Posts: 11936
The problem is that the language in which Winstep applications are built-in is NOT Unicode-aware (ironically, it uses Unicode strings internally), but ANSII. This means language-specific 'character sets' are used.

This is not a problem provided the system locale settings are correct (e.g.; you have the Greek version of Windows, the character set used for non-Unicode programs is automatically set to Greek by Windows). This is also how Winstep applications figure out which language to use by default on installation: they look at the current character set being used by Windows for non-unicode applications and match it with a language.

It can only become a problem when you have, say, the English version of Windows (in which case the character set for non-unicode programs is set to English) but want the application to display Greek (non-western) characters. In that case you get the gibberish you saw.

Still, it can be solved by going to the Regional Settings applent in the Windows Control Panel and telling Windows which language (character set) to use for non-unicode programs. The only limitation is that you cannot then have two non-unicode applications running at the same time displaying different languages (unless one of those languages is English, as ALL character sets have ALL the required characters for the English language).

And that concludes my lesson in application localization for today. :wink:

As for the Exit button, that was caught and fixed already, but thank you anyway. :D

_________________
Jorge Coelho
Winstep Xtreme - Xtreme Power!
http://www.winstep.net - Winstep Software Technologies


Back to top
 Profile WWW 
 
 Post subject: Re: Language issues
PostPosted: Sat Jan 29, 2011 1:58 pm 
Offline
User avatar

Joined: Sat Jan 08, 2011 5:57 pm
Posts: 898
Location: Athens, Greece
Trust me when I say, mate, I already knew all that (well, except the first paragraph, I don't know what language you've coded Nexus in). Greek on a PC has been a problem since, like, forever. Back in the DOS days we had to load a special keyboard switcher TSR (Terminate and Stay Resident) program in the autoexec.bat on top of the config.sys "change codepage" commands. [Jesus, I can't believe I still remember all that shit] After that, in Windows 3.1 we had yet another program and special, Greek-made fonts. That went on to Windows 95, 98 and was only sort-of solved in Windows 2000 (where all the files made with previous versions were unreadable). After Windows XP I thought we had solved the thing.
However, the problem is that a lot of programs, even though they're Unicode, check the system's non-Unicode language settings (or locale or both) and display that language. Of course, if you're ok seeing your own language, you're fine. But I don't want to see Greek on my computer! I have been using English (because when I started there was no Greek on computers), and I can't bear the sight of Greek menus and buttons and shit. So, I'd be fine having the locale to US or UK and still be able to type Greek by just having another keyboard, and read Greek, because all apps nowadays support Unicode.

Anyway... the problem is that even with the NUL set to Greek, half of the preferences of Nexus is gibberish. Check out the screenshots I took. WTF? Do you need to set some attribute to something else?
At least the pop-up text and the right-click text shows ok.
Are you sure there's no way to make Winstep Unicode-aware?


Crap, I just realised... I have to skin the right-click menu as well! Please make that skinnable too...


Attachments:
File comment: Buttons ok, title ok, but content... a mess.
Lang010.png
Lang010.png [ 88.75 KiB | Viewed 20267 times ]
File comment: The plot thickens... some of the content is ok, but still... most of it is gibberish.
Lang011.png
Lang011.png [ 91.16 KiB | Viewed 20267 times ]
File comment: This is even funnier: title ok, buttons ok, checkbox text ok, but raw text... ahem...
Lang012.png
Lang012.png [ 35.31 KiB | Viewed 20267 times ]

_________________
Live long and prosper...
Back to top
 Profile WWWYIMICQ 
 
 Post subject: Re: Language issues
PostPosted: Sat Jan 29, 2011 2:31 pm 
Offline
User avatar

Joined: Sat Jan 08, 2011 5:57 pm
Posts: 898
Location: Athens, Greece
Quick addition:
I've just verified that :
- buttons, checkboxes (text) and drop-down menus show Greek nicely
- plain text, sliders and anything else, shows gibberish

I don't know... are you using any libraries that don't pass or receive the locale properly?

_________________
Live long and prosper...


Back to top
 Profile WWWYIMICQ 
 
 Post subject: Re: Language issues
PostPosted: Sat Jan 29, 2011 8:26 pm 
Offline
Site Admin
Site Admin
User avatar

Joined: Thu Feb 26, 2004 8:30 pm
Posts: 11936
Hmmm... That's weird.

To make localization work, when a form (window) in the application is opened, all controls in it are first 'scanned' in a special routine: the text of the controls is translated and, at the same time, in what is a crucial step, the default charset of the control is changed to that of the system locale. This last step is required because the controls (labels, text boxes, check boxes, buttons, etc...) are ANSI and do not support Unicode either.

Looks like, for some reason, the Label controls (what you call 'plain text') are missing this last crucial step. If this happens, the text displayed in them might use the wrong Charset, and you would get gibberish.

The slider controls do not have text in them: the text you see next to them are actually separate Label controls.

It is also necessary that the font used in those controls supports the extended/foreign characters. In this case, Tahoma is the font used in all the controls, and it does, as you can see in the check box controls, etc..., support Greek characters.

What is weird is that, for instance, the Russians, which use Cyrillic characters, do not seem to have this problem. At least no Russian has ever complained about this.

_________________
Jorge Coelho
Winstep Xtreme - Xtreme Power!
http://www.winstep.net - Winstep Software Technologies


Back to top
 Profile WWW 
 
 Post subject: Re: Language issues
PostPosted: Sat Jan 29, 2011 9:03 pm 
Offline
Site Admin
Site Admin
User avatar

Joined: Thu Feb 26, 2004 8:30 pm
Posts: 11936
skagon wrote:
Crap, I just realised... I have to skin the right-click menu as well! Please make that skinnable too...


Right-click menus are (optionally) skinnable if you are using Winstep Xtreme instead of Nexus or Nexus Ultimate. They'll use NextSTART menu skins.

_________________
Jorge Coelho
Winstep Xtreme - Xtreme Power!
http://www.winstep.net - Winstep Software Technologies


Back to top
 Profile WWW 
 
 Post subject: Re: Language issues
PostPosted: Sat Jan 29, 2011 10:31 pm 
Offline
Site Admin
Site Admin
User avatar

Joined: Thu Feb 26, 2004 8:30 pm
Posts: 11936
Something else I noticed: if you look at the screenshots displaying results on the US system, the text is filled with '?' (question marks). However, that does not happen with the labels in the latest screenshots. Strange characters, yes, but no question marks. Hmmm...

_________________
Jorge Coelho
Winstep Xtreme - Xtreme Power!
http://www.winstep.net - Winstep Software Technologies


Back to top
 Profile WWW 
 
 Post subject: Re: Language issues
PostPosted: Sun Jan 30, 2011 2:23 am 
Offline
User avatar

Joined: Sat Jan 08, 2011 5:57 pm
Posts: 898
Location: Athens, Greece
Ok, so, here's a little experiment I did. I thought about what you said, and I tried finding some correlation, but the story is, Greek codepages are many and the correspondence with character positions totally erratic.
So... I was thinking... how do I get Windows to display Greek text, but override the codepage to be... something else?
Answer: load the greek.ini file into Firefox, and override the character encoding. ;)
The first thing I tried: override encoding to "Western (ISO-8859-1)".
Guess what: all the Greek text is shown *exactly* as Nexus shows it (on the Greek NUL system).
So, it looks like these strings are shown using the default "Western" encoding.

In the screenshot, I've highlighted the English text of the control shown, and I've moved the window right under the text, so you can see the match between the characters (gibberish).


Attachments:
File comment: Firefox encoding: Western (ISO-8859-1)
Proof of Concept.png
Proof of Concept.png [ 221.25 KiB | Viewed 20248 times ]

_________________
Live long and prosper...
Back to top
 Profile WWWYIMICQ 
 
 Post subject: Re: Language issues
PostPosted: Sun Jan 30, 2011 3:05 am 
Offline
Site Admin
Site Admin
User avatar

Joined: Thu Feb 26, 2004 8:30 pm
Posts: 11936
Right, means the charset property for Labels is not being applied property on your system. But why only the labels?

Can you please send me the Greek language file to the Winstep support address? Would like to try something here.

_________________
Jorge Coelho
Winstep Xtreme - Xtreme Power!
http://www.winstep.net - Winstep Software Technologies


Back to top
 Profile WWW 
 
 Post subject: Re: Language issues
PostPosted: Sun Jan 30, 2011 3:57 am 
Offline
User avatar

Joined: Sat Jan 08, 2011 5:57 pm
Posts: 898
Location: Athens, Greece
The file's on its way. Be gentle with it. :D

By the way, if you want to rig some test app quickly to try things, just let me know. ;)

_________________
Live long and prosper...


Back to top
 Profile WWWYIMICQ 
 
 Post subject: Re: Language issues
PostPosted: Sun Jan 30, 2011 4:43 am 
Offline
User avatar

Joined: Sat Jan 08, 2011 5:57 pm
Posts: 898
Location: Athens, Greece
winstep wrote:
Right-click menus are (optionally) skinnable if you are using Winstep Xtreme instead of Nexus or Nexus Ultimate. They'll use NextSTART menu skins.


I know that's not important right now (it's the little room in front of the plane where the pilots sit)...
...but why not Nexus too?
Surely that can't be a selling point... [throws cue ;)]

_________________
Live long and prosper...


Back to top
 Profile WWWYIMICQ 
 
 Post subject: Re: Language issues
PostPosted: Sun Jan 30, 2011 5:28 am 
Offline
Site Admin
Site Admin
User avatar

Joined: Thu Feb 26, 2004 8:30 pm
Posts: 11936
Menus are NextSTART's department. So, you want skinnable context menus, get Winstep Xtreme (which includes NextSTART. In fact, it includes everything).

And don't call me Shirley.

Ah, and regarding those Greek characters? Well, I forced the charset of every control to 161 (Greek) and guess what? Labels now display Greek characters, but all the rest doesn't - so exactly the opposite from you. Go figure. Sigh.

Do you now understand why I told you I don't want to touch localization issues even with a 10 feet pole? :wink:

_________________
Jorge Coelho
Winstep Xtreme - Xtreme Power!
http://www.winstep.net - Winstep Software Technologies


Back to top
 Profile WWW 
 
 Post subject: Re: Language issues
PostPosted: Sun Jan 30, 2011 8:46 am 
Offline
Site Admin
Site Admin
User avatar

Joined: Thu Feb 26, 2004 8:30 pm
Posts: 11936
Ok, let me show you something:

Image

As you can see, labels and other controls are correctly displaying Greek characters. I suspected as much.

To accomplish this I downloaded, installed and run Microsoft's 'App Locale', which allows you to set the system locale for a legacy (i.e.; non-unicode) application without having to change this setting globally, which requires a reboot. For that application, it's the same as setting the 'language for non unicode programs' in the Control Panel but without forcing you to reboot Windows.

This on a English version of Windows. What is your version of Windows? English as well, isn't it?

I know it's not your fault, but I've wasted many hours chasing an issue which really isn't there (except, perhaps, on your system for some strange reason - maybe because of Hyperdesk, although I seriously doubt that?).

I've also learned that simply setting the charset for fonts on forms (windows), text boxes and label controls will actually work without having to change the system locale in the Control Panel, but will not work (no idea why, was unable to find any information on this) for other types of controls (command buttons, check boxes, etc...).

In effect, the exact opposite of what is happening to you.

Either way, what I can deduce from this is that your Greek fellowmen will be able to benefit from your Greek translation (even if you won't). :wink:

_________________
Jorge Coelho
Winstep Xtreme - Xtreme Power!
http://www.winstep.net - Winstep Software Technologies


Back to top
 Profile WWW 
 
 Post subject: Re: Language issues
PostPosted: Sun Jan 30, 2011 1:20 pm 
Offline
User avatar

Joined: Sat Jan 08, 2011 5:57 pm
Posts: 898
Location: Athens, Greece
Wow! Looks nice!
Anyway, I think I've got another notebook somewhere around here, with Greek Windows 7 (yes, all of my systems are English Windows), and without HyperDesk, on which I can give it a go and see how it behaves.
Actually, I can even make a test installation of any Windows 7 version you'd like, and see what happens.

Anyway, I know that's not what you'd like to hear but, like Microsoft says, the best course of action would be to migrate to Unicode. That way, even I could see what a Russian Nexus looks like, with proper Cyrillic characters, by just clicking on the appropriate language.

_________________
Live long and prosper...


Back to top
 Profile WWWYIMICQ 
 
 Post subject: Re: Language issues
PostPosted: Sun Jan 30, 2011 1:36 pm 
Offline
Site Admin
Site Admin
User avatar

Joined: Thu Feb 26, 2004 8:30 pm
Posts: 11936
I'll tell you a story: Netscape (remember them?) once thought it would be a good idea to re-do all their code from scratch. By the time they finished (several years later) IE was the new de-facto standard and the Netscape browser nothing more than a dim memory in the mind of most users.

Microsoft would like everybody to migrate to .NET, but what they don't tell you is that you can't do this kind of stuff under it. It has to be done in pure Win32, not managed code.

_________________
Jorge Coelho
Winstep Xtreme - Xtreme Power!
http://www.winstep.net - Winstep Software Technologies


Back to top
 Profile WWW 
 
Post new topic Reply to topic Board index : Winstep Forums : General Discussion  [ 22 posts ] Go to page 1, 2  Next
Display posts from previous:  Sort by  

Who is online

Users browsing this forum: No registered users and 288 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: