CLIM mail archive


Re: Multilingual (French, English...) applications - any hints?

  From: Schneider Daniel <>
  I wonder whether somebody has been confronted with writing
  multi-lingual applications using CL and CLIM. There are three
  different kinds of strategies as far as I can see:
  (1) Compile time conditionalization with #+ macros
  (2) Load time switching using load-time-value (see example below)
  (3) Run time switching by calling a function
  Solution 2 is good enough for us. 3 may be less efficient an take more
  space too. 
  There are other issues involved, such as the question whether to put
  strings in lookup tables (makes code smaller, but maybe not as readable)
  or leave them in the code.
  ==> Could somebody do me the favor and tell:
     - whether the code below is the corrrect thing to do? 
     - whether there are smarter solutions for our kind of problem
     - give any other useful comment
    THANX A LOT  - Daniel
This is definitely an important issue that hasn't yet received
the attention it deserves.

I think you should learn from the Motif/Unix/X11 solution as
much as possible.  Their solution is to resolve everything at
run time.  That way, you only compile your application once.
You deliver the same run time image to every customer, plus an ASCII
file that contains the customizations peculiar to their language
(in the form of keyword-value pairs).

Run time switching can be done efficiently by
reading the customization file all at once at the time the
program is started.  In the X11 world, this is done by managing
a "Resource Database".  Unfortunately, CLIM does not directly
support the X11 resource database.  Additionally, you may not
be running your application in the Unix/X11 domain.  This argues
for a solution where you invent your own database.

Just read the entire customization file in, once, and put it
all in a hash table.  Then each time you need a button label
(or whatever), you just call GETHASH.

jeff morrill


Main Index | Thread Index