OpenCatalog

Find quick help here to get you started with Hollywood

OpenCatalog

Postby emeck » Mon May 01, 2017 4:38 pm

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

Re: OpenCatalog

Postby airsoftsoftwair » Tue May 02, 2017 9:42 pm

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
airsoftsoftwair
 
Posts: 2202
Joined: Fri Feb 12, 2010 3:33 pm
Location: Germany

Re: OpenCatalog

Postby emeck » Tue May 02, 2017 11:07 pm

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

Re: OpenCatalog

Postby airsoftsoftwair » Sun May 07, 2017 5:35 pm

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
airsoftsoftwair
 
Posts: 2202
Joined: Fri Feb 12, 2010 3:33 pm
Location: Germany

Re: OpenCatalog

Postby emeck » Sat May 13, 2017 8:07 pm

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

Re: OpenCatalog

Postby airsoftsoftwair » Sun May 14, 2017 7:42 pm

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

Re: OpenCatalog

Postby airsoftsoftwair » Fri Aug 25, 2017 9:53 pm

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
User avatar
airsoftsoftwair
 
Posts: 2202
Joined: Fri Feb 12, 2010 3:33 pm
Location: Germany


Return to Newbie questions

Who is online

Users browsing this forum: No registered users and 1 guest

cron