lilypond-devel
[Top][All Lists]
Advanced

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

Re: How do I change LOCALEDIR?


From: Werner LEMBERG
Subject: Re: How do I change LOCALEDIR?
Date: Wed, 04 Mar 2020 00:25:02 +0100 (CET)

> [A suggestion: you may want to keep attributions when trimming
> quotes.]

What exactly do you mean?

>> Let's assume that a user sets the LILYPOND_LOCALEDIR environment
>> variable manually for experimental purposes but not in the
>> relocation files.  To get translated messages early it makes sense
>> to set up the locale before parsing the relocation files.
> 
> I could run that same logic in the other direction too: to get the
> canonical translated messages, it makes sense to parse the
> relocation files before taking custom env into account. :)

I don't like that.  IMHO, environment variables should be handled as
being 'stronger' than stuff in relocation files.

Let's assume the opposite and do as you suggest, i.e., that we first
read relocation files.  If the user explicitly sets LILYPOND_RELOCDIR
it is necessary to call the relocation code a second time to parse the
files in the new relocation directory.  I think that this parsing is
slower than what I do in my patch.

In other words, I think we should first read the LILYPOND_RELOCDIR
environment variable.  For consistency I also suggest to read *all*
environment variables intended for the `lilypond` binary before the
relocation stuff gets parsed – even at the cost that `bindtextdomain`
must be called again.

>> Additionally, the code right now is simple.  Calling
>> `bindtextdomain` multiple times is not expensive, AFAIK.
> 
> I wouldn’t call searching for strings three times “simple” by my
> definition of the word.  Maybe it’s necessary, but I would hope that
> we could do fallback on the arguments as provided to the program,
> and then just call bindtextdomain once.

Improvements are very welcomed!  BTW, it is not clear to me why you
insist so strongly on calling `bindtextdomain` only once.  Please
elaborate.


    Werner

reply via email to

[Prev in Thread] Current Thread [Next in Thread]