[Python-checkins] CVS: python/dist/src/Lib gettext.py,1.1,1.2
Barry Warsaw
python-dev@python.org
Fri, 25 Aug 2000 12:53:19 -0700
Update of /cvsroot/python/python/dist/src/Lib
In directory slayer.i.sourceforge.net:/tmp/cvs-serv13575
Modified Files:
gettext.py
Log Message:
Group consensus is that supporting alternative locale categories is
useless. So the category argument on _find() is removed, as is the
dcgettext() function.
Index: gettext.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/gettext.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** gettext.py 2000/08/25 19:13:37 1.1
--- gettext.py 2000/08/25 19:53:17 1.2
***************
*** 169,173 ****
# Locate a .mo file using the gettext strategy
! def _find(localedir=None, languages=None, category=None, domain=None):
global _current_domain
global _localedirs
--- 169,173 ----
# Locate a .mo file using the gettext strategy
! def _find(localedir=None, languages=None, domain=None):
global _current_domain
global _localedirs
***************
*** 176,181 ****
if domain is None:
domain = _current_domain
- if category is None:
- category = 'LC_MESSAGES'
if localedir is None:
localedir = _localedirs.get(
--- 176,179 ----
***************
*** 200,204 ****
if lang == 'C':
break
! mofile = os.path.join(localedir, lang, category, '%s.mo' % domain)
# see if it's in the cache
mo = _translations.get(mofile)
--- 198,202 ----
if lang == 'C':
break
! mofile = os.path.join(localedir, lang, 'LC_MESSAGES', '%s.mo' % domain)
# see if it's in the cache
mo = _translations.get(mofile)
***************
*** 250,270 ****
"""Like gettext(), but look up message in specified domain."""
return _find(domain=domain).get(message, message)
-
-
- def dcgettext(domain, message, category):
- try:
- from locale import LC_CTYPE, LC_TIME, LC_COLLATE
- from locale import LC_MONETARY, LC_MESSAGES, LC_NUMERIC
- except ImportError:
- return message
- categories = {
- LC_CTYPE : 'LC_CTYPE',
- LC_TIME : 'LC_TIME',
- LC_COLLATE : 'LC_COLLATE',
- LC_MONETARY : 'LC_MONETARY',
- LC_MESSAGES : 'LC_MESSAGES',
- LC_NUMERIC : 'LC_NUMERIC'
- }
- return _find(domain=domain, category=category).get(message, message)
--- 248,251 ----