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

debconf and substitution of non-translated text

hey d-d,

on the heels (or perhaps in the recent footsteps) of the discussion
regarding update-manager and the faults of arbitrarily substituting
strings in pre-translated text...

i have a package (dbconfig-common), which via debconf's register
system shares a set of pre-defined templates between any number of
packages that use it.  to customize these questions and make them
as generic as possible for translators, i make fairly widespread
use of db_subst.  for example, you might have:

Template: dbconfig-common/dbconfig-install
_Description: Configure database for ${pkg} with dbconfig-common?

now the question i have, being one whose charset-fu is not all it
ought to be:  what happens when i use db_subst with arbitrary
text defined outside of a template?  for example, ${pkg} is
the package name, which is passed as an argument by the packager
to the hook function in the maintainer scripts.

my fear is that this will break things for users of non-"western"
locales, am i correct?  if i'm not correct and this isn't a problem,
then please disregard the rest of this email :)

from what i can tell, the way d-i works around this kind of problem
is that it defines the substituting text as translatable descriptions
of titles in debconf, and it uses db_metaget to fetch the values.  this
will work for some of the text in my case, where the strings can
be predefined (like names of supported database types, etc).  however,
there are some strings that will be variable based on the package in
question.  for example, ${pkg}.

if this is indeed a problem, it would be ideal to have a way to work
around it without requiring more work from packagers.  given that these
extra strings are just package names and file names (thus they don't
need to be translated per se) would doing some kind of locale check +
iconv be an acceptable way around the problem?  for example:

to_lang=`locale | grep LANG`
translated_string=`echo string_to_translate | iconv -f C -t $to_lang`


Reply to: