Call for volunteers [was: Re: Localization]
Dirk Hohndel
dirk at hohndel.org
Fri Oct 12 12:20:40 PDT 2012
"Lubomir I. Ivanov" <neolit123 at gmail.com> writes:
> 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... */
Wow this is ugly. Have you done some searching what other localized gtk
projects with Windows binaries do? I'm sure we are not the first ones to
try this.
/D
More information about the subsurface
mailing list