Colin Watson wrote:
On Wed, Feb 20, 2008 at 03:12:34PM +0100, Olivier Berger wrote:
I'm wondering how would one write postinst script tests, in the case
of "select" debconf configuration values, which are translated in the
templates.

Let's say that a package's template contains something like :

 Template: sympa/db_authtype
 Type: select
 Choices: Ident-based, Password
 ...
 Choices-fr.UTF-8: Basée sur ident, Mot de passe

If issueing 'db_get sympa/db_authtype', and wanting to test the
results, I would expect some code like the following to be correct :

 db_get sympa/db_authtype
   if [ "$RET" = "Ident-based" ]; then
   ...

However, it seems that the db_get results depend on the locale, and
return "Basée sur ident" instead of "Ident-based" when with french
locale...

That's odd; it's definitely supposed to be translated back to the
English text before being stored in the database, so GET should always
return the untranslated text from Choices rather than the translated
text from Choices-fr.UTF-8. I can't reproduce this with the sympa
package in unstable with LANG=fr_FR.UTF-8:

  debconf (developer): <-- INPUT medium sympa/db_authtype
  debconf (developer): --> 0 question will be asked
  debconf (developer): <-- GO
  debconf (developer): --> 0 ok
  debconf (developer): <-- GET sympa/db_authtype
  debconf (developer): --> 0 Ident-based

I did need the following patch to fix some broken code in the config
script before I could get anywhere, though. Racke, perhaps you could
apply this while we figure out the rest of it?

Yes.

I was able to reproduce the problem with export LANG=de_DE.
debconf-show sympa displayed the German translation.

The template looks like that:

Template: sympa/db_authtype
Type: select
__Choices: Ident-based, Password
_Default: Ident-based
_Description: Which authentication method?
Please specify which authentication method PostgreSQL uses for the
database superuser. The default configuration for PostgreSQL is
ident-based authentication.

Grüße
     Racke


--
LinuXia Systems => http://www.linuxia.de/
Expert Interchange Consulting and System Administration
ICDEVGROUP => http://www.icdevgroup.org/
Interchange Development Team




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

Reply via email to