Pasting some exchanges on IRC:

bubulle fjp: SHORTLIST_TRANSLATED is whatr is in the translations, SHORTLIST is in the 
original template
        bubulle in other words, the original values are: Belgium, Netherlands, other 
and SHORTLIST has "Belgium, Netherland" when language is nl
        bubulle and translated values are "België, Nederland, andere" and 
SHORTLIST_TRANSLATED has "België, Nerderland"
        bubulle The default, inherited from languagechooser is "Netherlands" or more 
precisely the 2nd value of the list....
        joeyh   I was thinking last night that it would probably be faster and use 
less space to make countrychooser ship with N predefined country shortlist templates, 
one for each language in languagechooser, each would be translated into only the 
language you must select to get it
        fjp     bubulle: but if I do countrychooser/debian/po$ grep SHORT *, I only 
get "${SHORTLIST}", so that is what will be shown to the user...
        bubulle fjp: sure....but one the tempaltes I have in the package I hacked you 
would have ${SHORTLIST_TRANSLATED] in all Choices-xx fields
        fjp     I think you need to also replace "${SHORTLIST}" by 
"${SHORTLIST_TRANSLATED}" in the .po files
        bubulle fjp: done....at least in fr and nl which is enough for my tests
        fjp     OK, that's what I was just checking as my first idea of what might be 
wrong...
        bubulle joeyh: that may be an idea but indeed, the templates are already 
virtually fixed at build time anyway
        fjp     continues thinking
        joeyh   there's some very slow (on older HW) stuff done at runtime
        fjp     joeyh: see me idea for the UTC problem in tzconfig?
        bubulle yep, this is the cat_shortlist function
        fjp     s/me/my/
        joeyh   fjp: yes, but I think I'll just leave it as is for sarge and fix it 
right (format strings for hwclock) after
        bubulle joeyh: fixing translations in templates would just save us the 
/etc/shortlists file which is currently 1939 bytes
        joeyh   it would also solve your issue with it using localised values in the 
choices list
        bubulle but this would make the templates file bigger
        bubulle joeyh: yes
        bubulle tries to imagine how we could generate the Choices-xx fields at build 
time.
        bubulle probable *after* dh_installdebconf by hacking the generated 
DEBIAN/templates file
        fjp     joeyh: Wouldn't that mean that you would have to know what format 
string is preferred for each locale (if you still want to present the time in local 
format)?
        bubulle joeyh: I think this can be done, yes
        bubulle as a side effect, this would save us the long blue screen on old HW
        bubulle I think we have the idea
        bubulle let's paste this in the BTS...:-)

As a conclusion, the plan could be something like:

in debian/rules, after dh_installdebconf, put something like this

for po in debian/po/*po ; do
  lang=`basename $po .po`
  .../... 
    (some stuff for building a list of countries for which lang has
     at least one valid locale --> $SHORTLIST_TRANSLATED$
  cat debian/countrychooser/DEBIAN/templates | sed \
     '/^Choices-${lang}.UTF-8/s/SHORTLIST/${SHORTLIST_TRANSLATED}/' \
     >debian/countrychooser/DEBIAN/templates.new
  use new templates
done

I'll hack some dirty stuff and then after, some better shell script
writer will be able to clean my mess../-)

As a side effect, this would save the very slow call to
cat_shortlist() in postinst and speed up contrychooser a lot.


-- 




-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to