OpenCatalog

Find quick help here to get you started with Hollywood
Post Reply
User avatar
emeck
Posts: 169
Joined: Fri Apr 03, 2015 3:17 pm

OpenCatalog

Post 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.
PowerBook 5.2 MorphOS 3.15
PowerBook 5.8 MorphOS 3.15
Amiga 1200 BPPC/BVision AOS4.1 FE
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: OpenCatalog

Post 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?
User avatar
emeck
Posts: 169
Joined: Fri Apr 03, 2015 3:17 pm

Re: OpenCatalog

Post 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?
PowerBook 5.2 MorphOS 3.15
PowerBook 5.8 MorphOS 3.15
Amiga 1200 BPPC/BVision AOS4.1 FE
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: OpenCatalog

Post 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.
User avatar
emeck
Posts: 169
Joined: Fri Apr 03, 2015 3:17 pm

Re: OpenCatalog

Post 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
PowerBook 5.2 MorphOS 3.15
PowerBook 5.8 MorphOS 3.15
Amiga 1200 BPPC/BVision AOS4.1 FE
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: OpenCatalog

Post by airsoftsoftwair »

Yes, I can confirm that this is a bug. Hollywood only handles "español" at the moment. Will be fixed.
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: OpenCatalog

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