Page 1 of 1

catalogs

Posted: Fri Jun 11, 2010 9:05 pm
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.

Re: catalogs

Posted: Sat Jun 12, 2010 1:40 pm
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...

Re: catalogs

Posted: Sat Jun 12, 2010 4:21 pm
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

Re: catalogs

Posted: Sat Jun 12, 2010 5:15 pm
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

Re: catalogs

Posted: Sat Sep 18, 2010 12:37 pm
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