Locale OC_PreferExternal (correct bult-in strings)

This forum is for general developer support questions.
Post Reply
User avatar
javierdlr
Beta Tester
Beta Tester
Posts: 389
Joined: Sun Jun 19, 2011 11:13 pm
Location: Donostia (GUIPUZCOA) - Spain
Contact:

Locale OC_PreferExternal (correct bult-in strings)

Post 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
User avatar
abalaban
Beta Tester
Beta Tester
Posts: 456
Joined: Mon Dec 20, 2010 2:09 pm
Location: France
Contact:

Re: Locale OC_PreferExternal (correct bult-in strings)

Post 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.
AmigaOne X1000 running AOS 4 beta
AmigaOne XE/G4
Amiga 1200/PPC 603e + BVision PPC
User avatar
javierdlr
Beta Tester
Beta Tester
Posts: 389
Joined: Sun Jun 19, 2011 11:13 pm
Location: Donostia (GUIPUZCOA) - Spain
Contact:

Re: Locale OC_PreferExternal (correct bult-in strings)

Post 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?
chris
Posts: 564
Joined: Sat Jun 18, 2011 12:05 pm
Contact:

Re: Locale OC_PreferExternal (correct bult-in strings)

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