Update: UltraVNC 1.4.3.6 and UltraVNC SC 1.4.3.6: viewtopic.php?t=37885
Important: Please update to latest version before to create a reply, a topic or an issue: viewtopic.php?t=37864

Join us on social networks and share our announcements:
- Website: https://uvnc.com/
- GitHub: https://github.com/ultravnc
- Mastodon: https://mastodon.social/@ultravnc
- Facebook: https://www.facebook.com/ultravnc1
- X/Twitter: https://twitter.com/ultravnc1
- Reddit community: https://www.reddit.com/r/ultravnc
- OpenHub: https://openhub.net/p/ultravnc

Auto-detect locales

Any features you would like to see in UltraVNC? Propose it here
Post Reply
shadowfax
40
40
Posts: 77
Joined: 2010-05-06 12:28
Location: Spain

Auto-detect locales

Post by shadowfax »

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.
User avatar
Rudi De Vos
Admin & Developer
Admin & Developer
Posts: 6832
Joined: 2004-04-23 10:21
Contact:

Re: Auto-detect locales

Post by Rudi De Vos »

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
shadowfax
40
40
Posts: 77
Joined: 2010-05-06 12:28
Location: Spain

Re: Auto-detect locales

Post by shadowfax »

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.
redge
1000
1000
Posts: 6797
Joined: 2004-07-03 17:05
Location: Switzerland - Geneva

Re: Auto-detect locales

Post by redge »

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
twagner
40
40
Posts: 74
Joined: 2008-09-09 20:43
Location: Germany

Re: Auto-detect locales

Post by twagner »

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!!!
User avatar
JDaus
Friend of UVNC
Friend of UVNC
Posts: 537
Joined: 2007-03-17 11:00
Location: Sydney, Australia
Contact:

Re: Auto-detect locales

Post by JDaus »

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
SCPrompt - OpenSource Free Remote Screen\Desktop Sharing Solution
SecureTech.com.au
User avatar
Rudi De Vos
Admin & Developer
Admin & Developer
Posts: 6832
Joined: 2004-04-23 10:21
Contact:

Re: Auto-detect locales

Post by Rudi De Vos »

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
Post Reply