Page 1 of 1

Locale OC_PreferExternal (correct bult-in strings)

Posted: Sun Jun 23, 2013 10:43 pm
by javierdlr
Hi, I use to correct typos in my built-in strings the next piece of code:

Code: Select all

  li.li_Catalog = ILocale->OpenCatalog(NULL, "poff.catalog",
                                       OC_BuiltInCodeSet, 3, // US-ASCII
                                       OC_PreferExternal, TRUE,
                                       TAG_END);
But I don't see (snoopy) that my program tries to load (in my case) spanish catalog and if none found then it should look for english catalog.
My Locale prefs has only SPANISH as Default languages table, should I add english/english-britsh?
TIA

Re: Locale OC_PreferExternal (correct bult-in strings)

Posted: Mon Jun 24, 2013 4:20 pm
by abalaban
Catalogs are cached in memory once loaded the first time. Try to look at the snoopy output after a fresh boot, you should be able to see disk accesses in Snoopy.

Re: Locale OC_PreferExternal (correct bult-in strings)

Posted: Tue Jun 25, 2013 9:38 am
by javierdlr
Changing it to:

Code: Select all

..
  li.li_Catalog = ILocale->OpenCatalog(NULL, "poff.catalog",
                                       OC_BuiltInLanguage, "english",
                                       OC_PreferExternal, TRUE,
                                       TAG_END);
..
works the way I want, if no spanish catalog found (and my Locale prefs default languages is: SPANISH, ENGLISH) it tries to load the catalog in '..catalogs/ENGLISH/poff.catalog'.

BTW shouldn't this be somekind of default behaviour, I mean without having in Locale prefs ENGLISH set?

Re: Locale OC_PreferExternal (correct bult-in strings)

Posted: Tue Jun 25, 2013 3:32 pm
by chris
javierdlr wrote:Changing it to:

Code: Select all

..
  li.li_Catalog = ILocale->OpenCatalog(NULL, "poff.catalog",
                                       OC_BuiltInLanguage, "english",
                                       OC_PreferExternal, TRUE,
                                       TAG_END);
..
works the way I want, if no spanish catalog found (and my Locale prefs default languages is: SPANISH, ENGLISH) it tries to load the catalog in '..catalogs/ENGLISH/poff.catalog'.

BTW shouldn't this be somekind of default behaviour, I mean without having in Locale prefs ENGLISH set?
It should default to checking the languages in the order specified in Locale prefs, and using the built-in strings otherwise. I don't see why English needs to be a permanent fixture, the built-in strings should take care of that regardless of whether there is even an English translation.

There is certainly a problem with Locale not picking the correct language, but I don't think it is relevant to your particular situation: http://forum.hyperion-entertainment.biz ... f=14&t=359