AutoHotkey Community

It is currently May 27th, 2012, 6:00 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: September 24th, 2010, 10:45 pm 
Offline

Joined: March 24th, 2007, 8:10 pm
Posts: 39
Hello, everyone.

When you create a new folder in Windows Explorer it's probably named "New folder" by default. Me? I get "Nueva carpeta" because my Windows is in Spanish.

Does anyone knows how can I get such localized strings with AHK? I've found some information about this issue via Google but I don't know enough to translate it (pun not intended) to AHK.

Thanks in advance.

_________________
Regards,
Antonio


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 24th, 2010, 11:36 pm 
Offline

Joined: September 7th, 2010, 9:59 pm
Posts: 23
Location: Rosario, Argentina
I work in localization and this is something that interests me, too. I used to use SilkTest for this that had an excellent feature: When you recorded/wrote some controls-operating code, it would look like this:

Code:
wMain.Menu("File|#1").MenuItem("Exit|#13|$57665").Pick ()
if wMain.DialogBox("WordPad|$MessageBox").Exists ()
   wMain.DialogBox("WordPad|$MessageBox").PushButton("Yes|#1|$6").Click ()
   wMain.DialogBox("Save As|#1").ComboBox("File name:|#1|$1148").SetText ("Somefilename.rtf")
   wMain.DialogBox("Save As|#1").PushButton("Save|#1|$1").Click ()
   if wMain.DialogBox("Save As|#1").DialogBox("File already exists|$MessageBox").Exists ()
      wMain.DialogBox("Save As|#1").DialogBox("File already exists|$MessageBox").PushButton("Yes|#1|$6").Click ()

And the great thing was that when you ran such script on e.g. Japanese which has the Save button translated, Silk would still click the right button because after it didn't find the Save text, it took the # index and used it instead, and as a safety thing there was always the $ index that could also be used, so three identifiers per each control. This resulted in great stability and reliability of the scripts. It got a bit more complicated with .NET controls but it was manageable.

I am missing such functionality in AHK a LOT. It took me a while before I discovered the ControlClick function but it's too basic and I think AHK is not entirely localization-ready. Not that it matters that much but it would be great if there were some workarounds.

Anyway, to your question, what exactly do you mean by "get such localized strings with AHK"? You mean how do you read it from the screen? Since a folder is not a recognizable control but rather an element of the OS, you will probably need to navigate to the folder using a script and then read it's name, e.g. by pressing F2 and CTRL+C. That will copy its name to your clipboard and you "have it in AHK". But I doubt this is what you are trying to achieve. Can you describe what you are actually trying to do?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 25th, 2010, 8:32 am 
Offline

Joined: March 24th, 2007, 8:10 pm
Posts: 39
Hello again.

What I want is to be able to use "OK" in a button if the system uses English and "Aceptar" if it uses Spanish. The same with "New folder" and "Nueva carpeta". I could make my own localization module and store these strings for some languages, but it would be better to use what Windows already has.

I already know where to get the decimal, time and list separators (in the Registry, at HKEY_CURRENT_USER\Control Panel\International). One of those values is the Locale (00000409 for US English, 00000C0A for Spanish from Spain). I've also found a bunch of localized strings at HKEY_CLASSES_ROOT\Local Settings\MuiCache\331\A7EAB198.

I even found where the "Nueva carpeta" string is supposed to be (a resource string of %windir%\System32\Shell32.dll). I've looked with Resource Hacker but I didn't find anything useful. Probably because Win7 seems to be more language-independent than XP.

I'm hoping someone knows what AHK voodoo :P can be done with such Locale and some other value that returns "Nueva carpeta", "New folder" or whatever can be the regional equivalent.

_________________
Regards,
Antonio


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: 0x150||ISO, batto, Bing [Bot], dra, HotkeyStick, mKnight, sjc1000, Wicked, XstatyK and 60 guests


You can post new topics in this forum
You can 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:
Powered by phpBB® Forum Software © phpBB Group