[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#53981: language-chooser



HI.

In article <20000113144301.A26270@transas.com>,
  at Thu, 13 Jan 2000 14:43:01 +0300,
    on Re: Bug#53981: language-chooser,
 Michael Sobolev <mss@transas.com> writes:

> On Thu, Jan 13, 2000 at 08:28:57PM +0900, Taketoshi Sano wrote:
> > Here is the patch for pointerize-0.3/lib/loadtrm.c, which enables
> > the fall back to C.trm file on error in opening the specified trm file.
> Please do not.  There is no need for such a fallback.  The calling program may
> check the result and if it equals to NULL, try to load a different file.

Then we should modify the code in dbootstrap/main.c, which currently
stops if the specified trm file is wrong.

    if (LOAD_TRMFILE(TRMFILE) == 0)
    {
        char message[255];
        snprintf(message, sizeof(message), 
                "An error occured while loading application messages from '%s'."
, TRMFILE);
        problemBox(message, "Problem");
        reboot(RB_AUTOBOOT);
    }

Maybe the following one will work as a work around ?

    if (LOAD_TRMFILE(TRMFILE) == 0)
    {
        if (LOAD_TRMFILE(C_TRMFILE) == 0)
        {        
            char message[255];
            snprintf(message, sizeof(message), 
                "An error occured while loading application messages from '%s'."
, TRMFILE);
            problemBox(message, "Problem");
            reboot(RB_AUTOBOOT);
        }
    }

with C_TRMFILE defined in dbootstrap.h as

#if defined(_TESTING_) || defined (_BOXTESTING_) || defined (_STESTING_) || defi
ned(_EXETESTING_)
        #define TRMFILE "test.trm"
        #define C_TRMFILE "C.trm"
#else
        #define TRMFILE "/etc/messages.trm"
        #define C_TRMFILE "/etc/C.trm"
#endif

and small modification in Makefile.

  # I have not commit any change to the code into CVS so far.

I think the fallback to english one is better than just quitting,
because it can be used to test the selected fonts and keymaps.

> And I do not quite understand the point of this patch.  The idea was to provide
> English variant when the translation is not available.  So you cannot just load
> either C.trm or other.trm file, you must load them both (if we do not change
> the procedure of generating .trm files).

 Enrique Zanardi <ezanardi@id-agora.com> writes:

 | > The translated string is searched by its position on the trm file (not by
 | > its non-translated counterpart as it is in gettext) so, if there's a
 | > different number of strings on the trm file than expected, there's no way
 | > to tell which one goes where (and usually some of them won't be there,
 | > NULL pointer, so the segfaults). 
 | > 
 | > Using the original string to search for the translated string means
 | > including the original strings on the executable and on all the trm
 | > files, as gettext does, defeating the whole purpose of using pointerize.

I think that loading both files may not work in the current .trm structure.
We have to change the procedure to generate .trm files to include English 
messages if the translated messages are not available. It may be possible 
to use C.po and LANG.po to generate .trm files. I think it is the better way, 
but it will take longer, and once the translation of messages are done, 
it will not needed anymore, so I think the work around may work in transition.

Anyway, I will think about the way to generate LANG.trm which includes 
the translated messages and English messages if the translated one is 
not available.

-- 
  Taketoshi Sano: <sano@debian.org>,<sano@debian.or.jp>,<kgh12351@nifty.ne.jp>


Reply to: