Call for volunteers [was: Re: Localization]

Lubomir I. Ivanov neolit123 at gmail.com
Fri Oct 12 08:09:11 PDT 2012


On 12 October 2012 17:27, Lubomir I. Ivanov <neolit123 at gmail.com> wrote:
> example of what has to be done (untested):
> ----------
> /* main.c */
>
> char *cur_loc = setlocale(LC_ALL, NULL);
> char *converted =
> some_function_to_convert_locale_based_on_a_lookup_table_or_something(cur_loc);

the alternative is to supply different folders in the windows installer:
"English_United States.1252"
instead of:
"en_US.UTF-8"

and setting the env. variables to the return value from:
setlocale( LC_ALL, "");

but i would prefer the first method where there is a lookup table
_only_ for the supported languages.:

	#define LEN 3
	
	int hash_win32_locales[LEN];	
	int i = 0;
	/* declare strings */
	const char *locales[LEN][2] =
	{
		{"win32_locale1", "posix_locale1"},
		{"win32_locale2", "posix_locale2"},
		{"win32_locale3", "posix_locale3"}
	};
	/* populate hash table */
	while (i < LEN) {
		hash_win32_locales[i] = some_hash_function(locales[i][0]);
		i++;
	}
	
	/* then once we have a windows locale to compare with, search for the
same hash value it in the table... */

lubomir
--


More information about the subsurface mailing list