Subject: Re: menuc vs libmenu
To: None <current-users@netbsd.org>
From: Patrick Welche <prlw1@newn.cam.ac.uk>
List: current-users
Date: 07/25/2000 13:03:38
On Tue, Jul 25, 2000 at 12:30:18PM +0200, Martin Husemann wrote:
> 
> Give it a massage-id and and create an easy-to-edit file for every language
> listing those id's and their value. Make it one file for the whole project.
> A translator then (for a new language) chooses the language he knows best,
> copies it over and translates it. He then saves the original template for his
> translation or marks the translated version with the cvs id of the original,
> so he can look at cvsdiff's for the original version when needing to update
> his translation.
> 
> The only viable alternative that proved working for me is: use a database,
> indexed by message-id and having one column per supported language. This
> requires good front-end tools to do the translation, which we don't have
> available. And this doesn't fit into the build structure very well. If you
> think of your representation as a text-based database, this would be ok.
> But you *realy* need appropriate editing tools for this setup. Changing every
> entry in the eleventh column in a text file where lines have about 2000 
> characters each is no fun. Cvs diffing this is no fun either.

Sounds rather like the messages module from RiscOS. An application is a
directory. Within that directory, messages (example below) are read from the
file called "Messages" within it. From RISC_OSLib:

/* msgs.h
 * Copyright (C) Acorn Computers Ltd., 1989
 * Copyright (C) Codemist Ltd., 1989
 */
#ifndef __msgs_h
#define __msgs_h
#define msgs_TAG_MAX 10
#define msgs_MSG_MAX 255
void msgs_init(void);
char *msgs_lookup(char *tag_and_default);
#endif

except it's still 1 file per language, (and msgs_MSG_MAX per message), eg:

# File of internal messages for RISC_OSlib. Default messages are in English
# so you only need this file if you wish to change such messages to another
# language (in which case use msgs_init()).

alarm1:Unable to read monotonic time
alarm2:Not enough memory to set alarm -- increase wimpslot



so eg., fprintf(stderr,"%s",msgs_lookup("alarm1"));

or

top_items[0]=new_item(msgs_lookup("topmenu_item1"),
                      msgs_lookup("topmenu_item1_desc");

? (with a bigger msgs_TAG_MAX)

Just a thought,

Patrick