This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Misleading documentation for gettext
Type: Stage:
Components: Documentation Versions:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: barry Nosy List: barry, fdrake
Priority: normal Keywords:

Created on 2001-09-21 14:43 by anonymous, last changed 2022-04-10 16:04 by admin. This issue is now closed.

Messages (3)
msg6631 - (view) Author: Nobody/Anonymous (nobody) Date: 2001-09-21 14:43
in location: 
http://www.python.org/doc/2.1.1/lib/node187.html 

there are docs for translation(), but there is no 
indication or link to mappings between the supplied 
language and the subdirectory actually searched. 
A link to the relevant information would help people 
considerably, or rather an NB mentioning that 
the 'languages' in the translation() docs is not the 
plural of the 'language' in the find() docs. 

Once I'd renamed my French resource directores fr -> 
fr_FR it all worked, of course, but I only discovered 
this from debugging gettext :(

kind regards, 

-Simon Harrison. 

On a side note, I have an alternative pygettext.py 
that inserts the English as the translated text when 
the "-t" option is supplied (test).  This has been 
fairly useful since it allows me to run the code, and 
test for correct operation prior to real translation.  
I can supply the new version if useful.
msg6632 - (view) Author: Fred Drake (fdrake) (Python committer) Date: 2001-09-21 15:06
Logged In: YES 
user_id=3066

Assigned to Barry.
msg6633 - (view) Author: Barry A. Warsaw (barry) * (Python committer) Date: 2001-10-18 19:41
Logged In: YES 
user_id=12800

Hmm, I think there is are some misunderstandings.  First,
both find() and translation() take a list of strings as
their languages argument.  In fact, the first three
arguments to translation() are passed straight through to
find()!

Second, the documentation for find() clearly describes how
the arguments map to the search directories.  I'm not sure
how that could be any clearer.

There is one mistake in find() though: it claims that all
arguments are strings, but that's not the case for the
languages argument, which in fact should be a list of
strings.  I will clarify that in the docs.

Your pygettext.py addition sounds interesting.  If you'd
like me to look at it and perhaps add it to the tool, please
send it directly to me: barry@zope.com
History
Date User Action Args
2022-04-10 16:04:27adminsetgithub: 35218
2001-09-21 14:43:21anonymouscreate