debconf and substitution of non-translated text

2006-08-24 Thread sean finney
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`


thanks,
sean



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



Re: debconf and substitution of non-translated text

2006-08-24 Thread Steve Langasek
On Thu, Aug 24, 2006 at 09:05:38AM +0200, sean finney wrote:
 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.

A package name should be treated as a literal, of course, regardless of
language.  While in some languages the particulars of a package name may
trigger inflection of surrounding words, we've been using this form for PHP
debconf templates for years now and I haven't had any complaints from
translators (or users) so far.

Substitutions other than package names and filenames are probably a bad idea
though.

Cheers,
-- 
Steve Langasek   Give me a lever long enough and a Free OS
Debian Developer   to set it on, and I can move the world.
[EMAIL PROTECTED]   http://www.debian.org/


signature.asc
Description: Digital signature


Re: debconf and substitution of non-translated text

2006-08-24 Thread Christian Perrier
 A package name should be treated as a literal, of course, regardless of
 language.  While in some languages the particulars of a package name may
 trigger inflection of surrounding words, we've been using this form for PHP
 debconf templates for years now and I haven't had any complaints from
 translators (or users) so far.


Yeah, I see sean's actions in dbconfig-common mostly
correct. Otherwise, I would have warned him already (I helped
rewording the debconf templates to fit my personal fascist way of
wording debconf templates).


Theoretically, even there we could have problems. But minor, indeed.

For instance, in French, translating this:

The configuration of ${pkg} will be changed

Becomes:

La configuration de ${pkg} sera modifiée.

If pkg=mysql, this becomes:

La configuration de mysql sera modifiée.

But, if pkg=apache, this becomes:

La configuration de apache sera modifiée.

While it should be:

La configuration d'apache sera modifiée.


So, indeed, there may be situations where substituting package names can
lead to slightly incorrect translations. However, I think that we can
live with it when we consider the benefits of DB_SUBST.






signature.asc
Description: Digital signature


Re: debconf and substitution of non-translated text

2006-08-24 Thread Steve Langasek
On Thu, Aug 24, 2006 at 11:41:11AM +0200, Christian Perrier wrote:
 For instance, in French, translating this:

 The configuration of ${pkg} will be changed

 Becomes:

 La configuration de ${pkg} sera modifiée.

 If pkg=mysql, this becomes:

 La configuration de mysql sera modifiée.

 But, if pkg=apache, this becomes:

 La configuration de apache sera modifiée.

 While it should be:

 La configuration d'apache sera modifiée.

Which can probably be worked around as

  La configuration du paquet «${pkg}» sera modifiée.

or a similar construction, no?

-- 
Steve Langasek   Give me a lever long enough and a Free OS
Debian Developer   to set it on, and I can move the world.
[EMAIL PROTECTED]   http://www.debian.org/


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



Re: debconf and substitution of non-translated text

2006-08-24 Thread Christian Perrier
 Which can probably be worked around as
 
   La configuration du paquet «${pkg}» sera modifiée.
 
 or a similar construction, no?


Absolutely.

I actually changed the fr.po file in dbconfig-common SVN so that
database fo ${pkg} which was translated to base de données de
${pkg} is now base de données pour ${pkg}...indeed a more literal
translation which avoids the mentioned problem.

Welcome to the French l10n team, Steve..:-)



signature.asc
Description: Digital signature


Re: debconf and substitution of non-translated text

2006-08-24 Thread Wouter Verhelst
On Thu, Aug 24, 2006 at 11:41:11AM +0200, Christian Perrier wrote:
 But, if pkg=apache, this becomes:
 
 La configuration de apache sera modifiée.
 
 While it should be:
 
 La configuration d'apache sera modifiée.

True. But then, in most languages this can be worked around by using
different phrase constructions. For example, the above could be
formulated as

La configuration du paquet ${pkg} sera modifiée.

Which would get you rid of the inflection (if I'm not mistaken; my
French has never been very good ;-)

Of course, this is a workaround, not a fix. It'd be nice if debconf were
to get ngettext, or something that works similar.

Oh well.

-- 
Lo-lan-do Home is where you have to wash the dishes.
  -- #debian-devel, Freenode, 2004-09-22


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



Re: debconf and substitution of non-translated text

2006-08-24 Thread Christian Perrier
 La configuration du paquet ${pkg} sera modifiée.


Hoorray for the new member of the French l10n team:-)




signature.asc
Description: Digital signature