Page 1 of 1

OpenCatalog

Posted: Mon May 01, 2017 4:38 pm
by emeck
Hello,

I want to learn how to localize my programs. So I have a script with this code:

Code: Select all

convi_cat$={}

OpenCatalog("convi.catalog")
convi_cat$[0]=GetCatalogString(0, "File")
convi_cat$[1]=GetCatalogString(1, "About...")
convi_cat$[2]=GetCatalogString(2, "About RapaGUI...")

For k= 0 To 2
	debugprint(convi_cat$[k])
Next
In the convi.catalog file I have 3 strings, each in its own line, but the debugprint always outputs the default english option. The catalog file is in the same drawer with the script. I also tried moving it to the respective locale drawer and changing system language, but no difference. Seems the catalog file is not opened? This is with HW 6.1 and MOS 3.9.

Re: OpenCatalog

Posted: Tue May 02, 2017 9:42 pm
by airsoftsoftwair
You need to use a "Catalogs" subdirectory, e.g. "Catalogs/français/convi.catalog" or "Catalogs/french/convi.catalog". Did you do that?

Re: OpenCatalog

Posted: Tue May 02, 2017 11:07 pm
by emeck
You need to use a "Catalogs" subdirectory, e.g. "Catalogs/français/convi.catalog" or "Catalogs/french/convi.catalog". Did you do that?
Ok, I thought that was only for non Amiga systems, as written in the guide. I was using the LOCALE:catalogs drawers. It works now using the current drawer. Thanks!

But shouldn't the LOCALE:catalogs drawer work also for Amiga systems?

Re: OpenCatalog

Posted: Sun May 07, 2017 5:35 pm
by airsoftsoftwair
emeck wrote:But shouldn't the LOCALE:catalogs drawer work also for Amiga systems?
LOCALE:Catalogs only works for catalogs in the IFF CTLG format. Platform-independent catalogs in plain text format are only supported by Hollywood and thus must not be copied to LOCALE:Catalogs because this would confuse other programs. If you want to use LOCALE:Catalogs, you need to store your catalogs in the IFF CTLG format.

Re: OpenCatalog

Posted: Sat May 13, 2017 8:07 pm
by emeck
Platform-independent catalogs in plain text format are only supported by Hollywood and thus must not be copied to LOCALE:Catalogs because this would confuse other programs.
Understood, thanks for the clarification. I got it working now but seems to be a bug with catalan language.

I have a small script with default english language and plain text catalogs for spanish and catalan. Spanish works but when setting catalan as language the default english is used instead of the catalan catalog.

I have copied the catalan catalog to other language drawers like dansk and greek and when setting those language as system's language, the script strings are in catalan, as expected. But now when system's laguage is catalan.

This is with HW7 and MOS3.9

Re: OpenCatalog

Posted: Sun May 14, 2017 7:42 pm
by airsoftsoftwair
Yes, I can confirm that this is a bug. Hollywood only handles "español" at the moment. Will be fixed.

Re: OpenCatalog

Posted: Fri Aug 25, 2017 9:53 pm
by airsoftsoftwair

Code: Select all

- New: GetSystemLanguage() supports almost all languages of the world now; lots of new language
  constants have been added  
- New: GetSystemCountry() supports almost all countries of the world now; lots of new country
  constants have been added