Is there a tutorial or example of adding catalogs to programs?

8 posts / 0 new
Last post
AmigaOneFan
AmigaOneFan's picture
Offline
Last seen: 7 years 6 months ago
Joined: 2011-11-14 16:18
Is there a tutorial or example of adding catalogs to programs?
I have a program that uses reaction objects and help bubbles and want to add to it the ability to display in a different language using new language catalogs. Is there an example of this somewhere? The Wiki from Hyperion has a reference to it but not a full up example of everything you need to do. What would be great is a simple reaction example - one version without the catalog features and one version of the same program with all the language cataloging added so the user can see the difference. Thanks!
thomas
thomas's picture
Offline
Last seen: 4 weeks 1 hour ago
Joined: 2011-05-16 14:23
Basically you need to replace
Basically you need to replace all string constants you want to be translated by the result of a call to GetCatalogStr. Whether you call GetCatalogStr everytime a string is needed or if you translate all strings at once when the program starts and then only work with variables is a matter of taste and the desired performance. Here is an example how I do it in my programs: http://thomas-rapp.homepage.t-online.de/examples/locale.lha The CatComp program can produce a piece of code into the catalog.h file, too, but I don't like it.
AmigaOneFan
AmigaOneFan's picture
Offline
Last seen: 7 years 6 months ago
Joined: 2011-11-14 16:18
Thank you for your example.
Thank you for your example. When I try to make though, I get the following errors: vc +aos68k main.o locale.o -o example -lamiga -lauto vc: Unknown command vc failed returncode 10 make: *** [example] Error 10 What dumb thing am I doing wrong? Thanks!
thomas
thomas's picture
Offline
Last seen: 4 weeks 1 hour ago
Joined: 2011-05-16 14:23
You haven't installed VBCC,
You haven't installed VBCC, have you? Try to change the head of the makefile to CC=gcc COPT=-Wall -D__USE_INLINE__ LIBS=-lamiga -lauto but without guarantee that it compiles without errors. And do make clean first to delete all the 68k object modules.
AmigaOneFan
AmigaOneFan's picture
Offline
Last seen: 7 years 6 months ago
Joined: 2011-11-14 16:18
Yes, I had installed VBCC in
Yes, I had installed VBCC in the past. I do not have any assigns to it in my user-startup however. Is there a way to uninstall VBCC? I made the changes you suggested and get the exact same errors. More ideas? Thanks!
thomas
thomas's picture
Offline
Last seen: 4 weeks 1 hour ago
Joined: 2011-05-16 14:23
You have to remove
You have to remove this
  1. CC=vc +aos68k
  2. COPT=-c99 -warn=-1 -dontwarn=163 -dontwarn=164 -dontwarn=166 -dontwarn=167 -dontwarn=168 -dontwarn=306 -dontwarn=307 -dontwarn=81
  3. LIBS=-lamiga -lauto
and add this instead:
  1. CC=gcc
  2. COPT=-Wall -D__USE_INLINE__
  3. LIBS=-lamiga -lauto
It is simply not possible to get exactly the same errors after this change. Unless you forgot to save the changes.
AmigaOneFan
AmigaOneFan's picture
Offline
Last seen: 7 years 6 months ago
Joined: 2011-11-14 16:18
Yes, I got it working. I
Yes, I got it working. I cannot even recall what was wrong, but it now works. Thank you for the excellent example!
trixie
trixie's picture
Offline
Last seen: 1 month 2 weeks ago
Joined: 2011-02-03 13:58
Yes, Thomas' examples are
Yes, Thomas' examples are always very helpful! It's great to have him here.
SAM440ep-flex @ 667MHz / 1GB RAM / Radeon 9250 / AmigaOS 4.1 Final Edition Author of WordNet for OS4
Log in or register to post comments