summaryrefslogtreecommitdiffstats
path: root/Lib/gettext.py
Commit message (Collapse)AuthorAgeFilesLines
* Replace IOError with OSError (#16715)Andrew Svetlov2012-12-251-7/+7
|
* Implemented PEP 405 (Python virtual environments).Vinay Sajip2012-05-261-1/+1
|
* #11515: Merge with 3.1.Ezio Melotti2011-03-151-1/+1
|\
| * #11515: fix several typos. Patch by Piotr Kasprzyk.Ezio Melotti2011-03-151-1/+1
| |
| * Merged revisions 85223 via svnmerge fromÉric Araujo2010-10-041-1/+1
| | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r85223 | eric.araujo | 2010-10-05 01:52:37 +0200 (mar., 05 oct. 2010) | 3 lines Fix interaction of custom translation classes and caching (#9042) ........
* | update commentBenjamin Peterson2010-12-231-1/+1
| |
* | kill some function importsBenjamin Peterson2010-12-231-16/+14
| |
* | use native tenary conditionBenjamin Peterson2010-12-231-16/+2
| |
* | Fix interaction of custom translation classes and caching (#9042)Éric Araujo2010-10-041-1/+1
|/
* Merged revisions ↵Benjamin Peterson2009-06-011-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 72506,72525-72526,72551,72558,72616,72654-72655,72689,72745,72750,72802,72812,72822,72824,72826-72827,72833,72876,72890,72923,72946,73026,73042,73045,73047,73065,73068-73069 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r72506 | vinay.sajip | 2009-05-09 07:07:17 -0500 (Sat, 09 May 2009) | 1 line Issue #5971: StreamHandler.handleError now swallows IOErrors which occur when trying to print a traceback. ........ r72525 | benjamin.peterson | 2009-05-09 20:38:02 -0500 (Sat, 09 May 2009) | 1 line close file explicitly ........ r72526 | benjamin.peterson | 2009-05-09 21:29:00 -0500 (Sat, 09 May 2009) | 1 line make sure files are closed using the with statement ........ r72551 | benjamin.peterson | 2009-05-10 09:16:47 -0500 (Sun, 10 May 2009) | 1 line use isinstance ........ r72558 | benjamin.peterson | 2009-05-10 18:52:09 -0500 (Sun, 10 May 2009) | 1 line sys.setdefaultencoding() strikes me as a bad example ........ r72616 | benjamin.peterson | 2009-05-13 19:33:10 -0500 (Wed, 13 May 2009) | 1 line importlib.import_module is better these days ........ r72654 | benjamin.peterson | 2009-05-14 17:37:49 -0500 (Thu, 14 May 2009) | 1 line prevent refleaks from threads ........ r72655 | benjamin.peterson | 2009-05-14 17:40:34 -0500 (Thu, 14 May 2009) | 1 line a useful decorator for cleaning up threads ........ r72689 | benjamin.peterson | 2009-05-16 13:44:34 -0500 (Sat, 16 May 2009) | 1 line use skipTest() ........ r72745 | benjamin.peterson | 2009-05-17 09:16:29 -0500 (Sun, 17 May 2009) | 1 line ignore .rst files in sphinx its self ........ r72750 | benjamin.peterson | 2009-05-17 11:59:27 -0500 (Sun, 17 May 2009) | 1 line chop off slash ........ r72802 | georg.brandl | 2009-05-20 13:35:27 -0500 (Wed, 20 May 2009) | 1 line #6051: refer to email examples for better way to construct email messages. ........ r72812 | michael.foord | 2009-05-21 17:57:02 -0500 (Thu, 21 May 2009) | 1 line Rename TestCase._result to _resultForDoCleanups to avoid potential clashes in TestCase subclasses. Issue 6072. ........ r72822 | georg.brandl | 2009-05-22 04:33:25 -0500 (Fri, 22 May 2009) | 1 line #6084: fix example. ........ r72824 | georg.brandl | 2009-05-22 04:43:17 -0500 (Fri, 22 May 2009) | 1 line Fix references to file-related functions and methods (os.* vs file.*). ........ r72826 | georg.brandl | 2009-05-22 04:49:42 -0500 (Fri, 22 May 2009) | 1 line Fix confusing wording. ........ r72827 | georg.brandl | 2009-05-22 04:50:30 -0500 (Fri, 22 May 2009) | 1 line s/use/call/ ........ r72833 | georg.brandl | 2009-05-22 12:00:17 -0500 (Fri, 22 May 2009) | 1 line #6078: _warnings is a builtin module and has no standard init_warnings function. ........ r72876 | benjamin.peterson | 2009-05-23 15:59:09 -0500 (Sat, 23 May 2009) | 1 line remove mention of old ctypes version ........ r72890 | gregory.p.smith | 2009-05-24 13:00:13 -0500 (Sun, 24 May 2009) | 2 lines add a versionadded tag for set_tunnel ........ r72923 | michael.foord | 2009-05-25 15:36:56 -0500 (Mon, 25 May 2009) | 1 line Make assertSequenceEqual error messages less cryptic, particularly for nested sequences. ........ r72946 | ronald.oussoren | 2009-05-26 13:44:48 -0500 (Tue, 26 May 2009) | 2 lines Fixes issue 6110 ........ r73026 | r.david.murray | 2009-05-29 14:30:27 -0500 (Fri, 29 May 2009) | 3 lines Issue 6141: document that the first item of args is still the command name even when executable is specified. ........ r73042 | benjamin.peterson | 2009-05-29 22:10:52 -0500 (Fri, 29 May 2009) | 1 line no fdatasync on macos ........ r73045 | georg.brandl | 2009-05-30 02:26:04 -0500 (Sat, 30 May 2009) | 1 line #6146: fix markup bug. ........ r73047 | georg.brandl | 2009-05-30 05:33:23 -0500 (Sat, 30 May 2009) | 1 line Fix some more small markup problems. ........ r73065 | antoine.pitrou | 2009-05-30 16:39:25 -0500 (Sat, 30 May 2009) | 3 lines The test for #5330 wasn't correct. ........ r73068 | antoine.pitrou | 2009-05-30 16:45:40 -0500 (Sat, 30 May 2009) | 3 lines Update ACKS ........ r73069 | benjamin.peterson | 2009-05-30 19:42:42 -0500 (Sat, 30 May 2009) | 1 line fix signature ........
* Use true booleans.Georg Brandl2009-05-171-2/+2
|
* Make gettext Unicode interface consistent and clean up the docs.Georg Brandl2008-07-171-18/+8
|
* #2512 implement the 3.0 gettext APIBenjamin Peterson2008-07-141-27/+9
| | | | | | | All the u* gettext variants were renamed to their none u* variants, since there's no point in translating to byte strings. I also killed off the unicode parameters for install
* #1535: rename __builtin__ module to builtins.Georg Brandl2007-12-021-6/+6
|
* Merging the py3k-pep3137 branch back into the py3k branch.Guido van Rossum2007-11-061-1/+1
| | | | | | | | | | | | | | No detailed change log; just check out the change log for the py3k-pep3137 branch. The most obvious changes: - str8 renamed to bytes (PyString at the C level); - bytes renamed to buffer (PyBytes at the C level); - PyString and PyUnicode are no longer compatible. I.e. we now have an immutable bytes type and a mutable bytes type. The behavior of PyString was modified quite a bit, to make it more bytes-like. Some changes are still on the to-do list.
* Fixed gettext module for Windows. The metadata lines always end in \n and ↵Christian Heimes2007-10-311-1/+1
| | | | not in os.linesep
* Raise statement normalization in Lib/.Collin Winter2007-08-301-4/+3
|
* Make gettext work with strict str/bytes.Guido van Rossum2007-08-291-3/+3
|
* Fixes for str/uni/bytes for gettext.py. test_gettext.py passes.Guido van Rossum2007-07-121-33/+13
| | | | | | | | Fix by Christian Heimes, SF# 1751958, who writes: I tested the fixes with the Zope3 zope.app.locales packages. The mo files are loaded and parsed w/o any problem. The translation with gettext.gettext is working as expected.
* Change some uses of cStringIO.StringIO to io.StringIO.Guido van Rossum2007-05-181-4/+1
| | | | This is undoubtedly insufficient and in some cases just as broken as before.
* Merged revisions 55007-55179 via svnmerge fromGuido van Rossum2007-05-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/p3yk ........ r55077 | guido.van.rossum | 2007-05-02 11:54:37 -0700 (Wed, 02 May 2007) | 2 lines Use the new print syntax, at least. ........ r55142 | fred.drake | 2007-05-04 21:27:30 -0700 (Fri, 04 May 2007) | 1 line remove old cruftiness ........ r55143 | fred.drake | 2007-05-04 21:52:16 -0700 (Fri, 04 May 2007) | 1 line make this work with the new Python ........ r55162 | neal.norwitz | 2007-05-06 22:29:18 -0700 (Sun, 06 May 2007) | 1 line Get asdl code gen working with Python 2.3. Should continue to work with 3.0 ........ r55164 | neal.norwitz | 2007-05-07 00:00:38 -0700 (Mon, 07 May 2007) | 1 line Verify checkins to p3yk (sic) branch go to 3000 list. ........ r55166 | neal.norwitz | 2007-05-07 00:12:35 -0700 (Mon, 07 May 2007) | 1 line Fix this test so it runs again by importing warnings_test properly. ........ r55167 | neal.norwitz | 2007-05-07 01:03:22 -0700 (Mon, 07 May 2007) | 8 lines So long xrange. range() now supports values that are outside -sys.maxint to sys.maxint. floats raise a TypeError. This has been sitting for a long time. It probably has some problems and needs cleanup. Objects/rangeobject.c now uses 4-space indents since it is almost completely new. ........ r55171 | guido.van.rossum | 2007-05-07 10:21:26 -0700 (Mon, 07 May 2007) | 4 lines Fix two tests that were previously depending on significant spaces at the end of a line (and before that on Python 2.x print behavior that has no exact equivalent in 3.0). ........
* Rip out all the u"..." literals and calls to unicode().Guido van Rossum2007-05-021-15/+15
|
* Rip out 'long' and 'L'-suffixed integer literals.Guido van Rossum2007-01-151-2/+2
| | | | (Rough first cut.)
* Patch #1349274: gettext.install() now optionally installs additionalGeorg Brandl2006-02-191-3/+13
| | | | translation functions other than _() in the builtin namespace.
* Use cStringIO where available.Raymond Hettinger2004-12-311-1/+4
|
* This change implements the following gettext features, asGustavo Niemeyer2004-07-221-10/+95
| | | | | | | | | | | | | | | | | | | | discussed recently in python-dev: In _locale module: - bind_textdomain_codeset() binding In gettext module: - bind_textdomain_codeset() function - lgettext(), lngettext(), ldgettext(), ldngettext(), which return translated strings encoded in preferred system encoding, if bind_textdomain_codeset() was not used. - Added equivalent functionality in translate() function and catalog classes. Every change was also documented.
* Replace str.find()!=1 with the more readable "in" operator.Raymond Hettinger2004-05-041-1/+1
|
* GNUTranslations._parse(): Initialize local variable k so that if theBarry Warsaw2003-10-041-1/+1
| | | | | | | first line of a header section isn't an RFC-ish header, it's just ignored instead of throwing an UnboundLocalError. Backport candidate.
* GNUTranslations._parse(): Fix SF bug #658233, where continuation linesBarry Warsaw2003-05-201-4/+9
| | | | | | in .po metadata caused a crash. Backport candidate.
* GNUTranslations:Barry Warsaw2003-04-241-33/+33
| | | | | | | | | | | | | | __init__(): Removed since we no longer need the coerce flag. Message ids and strings are now always coerced to Unicode, /if/ the catalog specified a charset parameter. gettext(), ngettext(): Since the message strings are Unicodes in the catalog, coerce back to encoded 8-bit strings on return. ugettext(), ungettext(): Coerce the message ids to Unicode when there's no entry for the id in the catalog. Minor code cleanups; use booleans where appropriate.
* NullTranslations.__init__(): Back out of setting the default charsetBarry Warsaw2003-04-111-16/+16
| | | | | | | | | | | | to iso-8859-1. GNUTranslations._parse(): Back out the addition of a test for Project-ID-Version in the metadata. This was deliberately removed in response to SF patch #700839. Also, re-organize the code in _parse() so we parse the metadata header containing the charset parameter before we try to decode any strings using charset.
* From http://mail.python.org/pipermail/i18n-sig/2003-April/001557.htmlBarry Warsaw2003-04-111-13/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - Expose NullTranslations and GNUTranslations to __all__ - Set the default charset to iso-8859-1. It used to be None, which would cause problems with .ugettext() if the file had no charset parameter. Arguably, the po/mo file would be broken, but I still think iso-8859-1 is a reasonable default. - Add a "coerce" default argument to GNUTranslations's constructor. The reason for this is that in Zope, we want all msgids and msgstrs to be Unicode. For the latter, we could use .ugettext() but there isn't currently a mechanism for Unicode-ifying msgids. The plan then is that the charset parameter specifies the encoding for both the msgids and msgstrs, and both are decoded to Unicode when read. For example, we might encode po files with utf-8. I think the GNU gettext tools don't care. Since this could potentially break code [*] that wants to use the encoded interface .gettext(), the constructor flag is added, defaulting to False. Most code I suspect will want to set this to True and use .ugettext(). - A few other minor changes from the Zope project, including asserting that a zero-length msgid must have a Project-ID-Version header for it to be counted as the metadata record.
* Patch #700839: Fix bugs in the plural handling.Martin v. Löwis2003-03-101-8/+17
|
* Patch #633547: Support plural forms. Do TODOs in test suite.Martin v. Löwis2002-11-211-5/+135
|
* Patch by Tim to shut up the compiler's DeprecationWarnings on theBarry Warsaw2002-08-141-18/+9
| | | | high-bit-set hex constants.
* Replace boolean test with is NoneRaymond Hettinger2002-06-011-1/+1
|
* Add a per-message fallback mechanism for translations.Martin v. Löwis2002-01-111-13/+50
|
* Add fallback argument to translation(). Request fallbacks on install.Martin v. Löwis2002-01-111-2/+5
| | | | Fixes #500595.
* added a few more __all__ listsSkip Montanaro2001-01-231-0/+3
| | | | fixed typo in ihooks docstring
* Whitespace normalization.Tim Peters2001-01-141-7/+7
|
* find(): Application of (slightly modified) SF patch #101928 by UlfBarry Warsaw2000-10-161-4/+4
| | | | | | Betlehem, verified by Peter Funk. Fixes preservation of language search order lost due to use of dictionary keys instead of a list. Closes SF bug #116964.
* translation(): Minor optimization patch which avoids instantiating theBarry Warsaw2000-10-051-1/+5
| | | | default value's instance unless it's absolutely necessary.
* Repaired comment.Tim Peters2000-09-011-1/+1
|
* GNUTranslations._parse(): Fix portability problems on 64-bit machinesBarry Warsaw2000-08-311-5/+14
| | | | by masking all unsigned integers with 0xffffffff.
* GNUTranslations.BE_MAGIC: don't be so clever in calculating this fromBarry Warsaw2000-08-311-1/+1
| | | | LE_MAGIC; it breaks on Tru64.
* Finalize this module for Python 2.0 based on feedback and input fromBarry Warsaw2000-08-301-173/+140
| | | | | Martin von Loewis, Peter Funk, James Henstridge, Francois Pinard, and Marc-Andre Lemburg.
* _expand_lang(), _find(): Added support for unaliasing and expanded theBarry Warsaw2000-08-251-4/+53
| | | | | language found in the environment variable, contributed by James Henstridge.
* Group consensus is that supporting alternative locale categories isBarry Warsaw2000-08-251-21/+2
| | | | | useless. So the category argument on _find() is removed, as is the dcgettext() function.
* Initial revision of gettext support for Python. This will undergoBarry Warsaw2000-08-251-0/+288
some changes.