Auto-detect locales

Any feature you'd like to see in Ultr@VNC? Just propose it here.

Auto-detect locales

Postby shadowfax » 2011-04-19 16:40

Hi,

It would be nice if the server automatically detected the user's locale settings.

I've changed the language resources files show it compiles to locale specific names, for example:

  • vnclang_es.dll
  • vnclang_en.dll
  • ...


Next step... Where the resource DLL was being loaded I canhed the line

Code: Select all
hInstResDLL = LoadLibrary("vnclang_server.dll");


to

Code: Select all
   // Auto locales start
   LCID lcid;
   char langid[10];
   char dllPath[128];

   lcid = GetUserDefaultLCID();
   if (GetLocaleInfo(lcid, LOCALE_SISO639LANGNAME, langid, 9) != 0 ) {
      sprintf_s(dllPath, 128-1,"vnclang_%s.dll", langid);
      hInstResDLL = LoadLibrary(dllPath);
   }
   // Auto locales end


For Vista and above Microsoft recomends the use of the function GetUserDefaultLocaleName but couldn't get that one to compile, although the above code is running on Vista but not so sure it would run on Windows 7 :/

This code comes in handy for SingleClick style applications or SC_PROMPT as you can send a single file with the locales you wish to support and the user will get his locale automatically.

Best regards
Last edited by shadowfax on 2011-04-19 16:41, edited 1 time in total.
shadowfax
40
40
 
Posts: 77
Joined: 2010-05-06 12:28
Location: Spain

Re: Auto-detect locales

Postby Rudi De Vos » 2011-04-19 18:23

We need to migrate to a text.txt instead of a dll.
To complex and dll loading isn't 100% secure.

A lot of work... all text in dialogs need to be overwriten.
Usual i use this
langid= GetUserDefaultLangID();
lang=PRIMARYLANGID(langid);
for auto detection.
(hexadecimal code)
text_09.txt
Rudi De Vos
Admin & Developer
Admin & Developer
 
Posts: 5710
Joined: 2004-04-23 10:21

Re: Auto-detect locales

Postby shadowfax » 2011-04-19 21:59

Wouldn't it be easier to use the ISO639 codes? I think they are a bit more intuitive than Language IDs. Maybe instead of plain text files an XML would come in handy... With a simple parse it would be quite simple to update.

It could also be used for configuration files instead of the INI files...

I think I'll take a look at it :) Maybe http://www.applied-mathematics.net/tools/xmlParser.html can be used, as it seems simple (Although I've only looked over it).
Last edited by shadowfax on 2011-04-19 22:05, edited 1 time in total.
shadowfax
40
40
 
Posts: 77
Joined: 2010-05-06 12:28
Location: Spain

Re: Auto-detect locales

Postby redge » 2011-04-19 22:03

shadowfax

good idea and hope you have an practical example of your XML file ISO639 translation.
UltraVNC 1.0.9.6.1 (built 20110518)
OS Win: xp home + vista business + 7 home
only experienced user, not developer
redge
Super-Mod
Super-Mod
 
Posts: 6815
Joined: 2004-07-03 17:05
Location: Switzerland - Geneva

Re: Auto-detect locales

Postby twagner » 2011-04-20 06:09

hi shadowfax,
good idea, i think if rudi give a positive answer to integrate this solution in the uvnc-project,
it will be greate if you made an english example, so other uvnc-friend can use it for there work as base for translations in other languages, too

best wishes

twagner
Die Welt geht Remote . . . . / the World goes remote . . . .
www.vnc-world.com
Writer of the first book about UltraVNC!!!
twagner
40
40
 
Posts: 74
Joined: 2008-09-09 20:43
Location: Germany

Re: Auto-detect locales

Postby JDaus » 2011-05-05 13:49

I'm working on a web based translation engine that will allow rudi to add a new entry, emails would be sent out to the translators, notifying of the update, translators then visit site, translate the entry.

developer can then export to ini or xml.

already have database designed, code partially written, but ran out of time.

I wanted to make it Into a joomla plugin to allow integration into the site & allow authentication via joomla db ...

I think this would make it easy to keep tabs on translations into the future, and make it easier for non technical people to help us translate.
ask a silly question and remain a fool for 5 minutes...
don't ask, and remain a fool for life - JDaus 2003

without imperfections, neither you nor i would exist - Steven Hawkins
__
JD
VNC2Me - OpenSource Free Remote Screen\Desktop Sharing Solutions
SecureTech
JDaus
Friend of UVNC
Friend of UVNC
 
Posts: 516
Joined: 2007-03-17 11:00
Location: Sydney, Australia

Re: Auto-detect locales

Postby Rudi De Vos » 2011-05-05 14:12

Sound good, maintaining the translations with a dll is a hell, need to replace by a txt file.
If we could use the same format as application input as the web output....all should be simpler
Rudi De Vos
Admin & Developer
Admin & Developer
 
Posts: 5710
Joined: 2004-04-23 10:21


Return to Feature requests

Who is online

Users browsing this forum: No registered users and 3 guests

cron