Bug #500595

"Martin v. Loewis" <[email protected]>
Newsgroups gmane.comp.python.internationalization
Message-ID <[email protected]>
In 

http://sourceforge.net/tracker/index.php?func=detail&aid=500595&group_id=5470&atid=105470

the submitter reports that gettext.install fails if no catalog is
found. This is undesirable. Instead, it should fallback to installing
a _ function that is the identity mapping.

I propose the following strategy to fix that, both in 2.2.1, and 2.3:

- add a parameter fallback= to gettext.translation which, if set to
  true, returns a NullTranslation if no translation can be located,
  instead of raising an exception.

- in gettext.install, call translation() with fallback=1.

What do you think? Would it be also be acceptable to reverse the
behaviour, making fallback=0 the default (so that you'll have to
explicitly request the exception, instead of requesting the null
translation)

I'll also like to implement a per-message fallback mechanism, but that
is certainly for 2.3 (and out of scope of this report).

Regards,
Martin
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.