catalogs

Discuss any general programming issues here
Post Reply
ilbarbax
Posts: 117
Joined: Thu Apr 01, 2010 6:41 pm

catalogs

Post by ilbarbax »

Hi,

I've seen on Holywood the commands to read the catalog entries, however there is not mention on how those files need to be structured or in general how is their behaviour.
pecaN
Posts: 124
Joined: Thu Jun 10, 2010 4:15 pm

Re: catalogs

Post by pecaN »

Hi,i've been thinking about catalogs too. I think that you should drop an email to the autor of LookHERE! This viewer makes use of them...
User avatar
Allanon
Posts: 732
Joined: Sun Feb 14, 2010 7:53 pm
Location: Italy
Contact:

Re: catalogs

Post by Allanon »

Hello all,
I'm the author of LookHere! :D

I've not used catalogs because I don't know how they works and because I suspect they are complicated to manage, instead I've used tables indexed with a semplification of the text string to translate, let's say that I've in my program the following text:

'About'
'This is a sample application'
'Quit'

I have one table for every language with the following format:

English

Code: Select all

Translation = { about = "About",
                      simple_app = "This is a simple application",
                      quit = "Quit" }
Italian

Code: Select all

Translation = { about = "Circa",
                      simple_app = "Questa è una semplice applicazione",
                      quit = "Termina" }
Inside the code, instead of using strings I use table items:

Code: Select all

Function About()
   ; This function prints informations about the application
   DebugPrint(Translation.about)
   DebugPrint(Translation.simple_app)
EndFunction
LoadTable and SaveTable do the rest.

Regards,
Fabio
pecaN
Posts: 124
Joined: Thu Jun 10, 2010 4:15 pm

Re: catalogs

Post by pecaN »

Oh sorry Fabio didn't know you were Allanon and also sorry for blaming you using catalogs:-)...i have to study docs about catalogs but i only saw 3 commands for handling them so i hope it isn't so difficult. In BoingPairs i used tables e.g
a[0][0]="czech" a[0][1]="english". If player chose czech,game prints a[0][0],if english,then [0][1] pecaN
ilbarbax
Posts: 117
Joined: Thu Apr 01, 2010 6:41 pm

Re: catalogs

Post by ilbarbax »

Well... after some digging I arrived to the end to the catalog behaviour.

Nithing simpler ... they fully comply with Amiga catalog system.

You have to create a directory structure on your progdir as catalogs\yourcountryname (it must comply with the definition of the languages found on sys:locale\catalogs\yourcountryname). If you want you can save your catalog file in this last directory.

Then you have to use some tool to edit the catalog files. I used Simplecat available on aminet. It is a bit tricky because it does not allow you to imput the data from scratch, you have to copy one of the example .cs file and edit it with any text editor and modify with your messages. Then exoport as .catalog file

Once created the catalog file on your hollywood code use exactely the code suggested on the help/manual (you have to add dim for the vestors and obiosly define the defeualt values)

and... it works

Sandro
Post Reply