Commit Graph

57 Commits

Author SHA1 Message Date
Russell Keith-Magee 4c468800ee Updates to the test suite to allow for newly deprecated and removed features
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15990 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-04-02 08:44:47 +00:00
Adrian Holovaty 0fdabe885b Made a bunch of simplifications now that we don't support Python 2.4
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15933 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-03-28 02:27:43 +00:00
Ramiro Morales 775a6e694f Fixed #15632 -- Ignore unrelated content in template multi-line comment blocks when looking for tokens that identify comments for translators. Thanks andrew AT ie-grad DOT ru for the report and Claude Paroz for spotting the problem and helping to fix it.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15882 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-03-19 12:56:38 +00:00
Russell Keith-Magee afd040d4d3 Updated test assertions that have been deprecated by the move to unittest2. In summary, this means:
assert_ -> assertTrue
 assertEquals -> assertEqual
 failUnless -> assertTrue

For full details, see http://www.voidspace.org.uk/python/articles/unittest2.shtml#deprecations

git-svn-id: http://code.djangoproject.com/svn/django/trunk@15728 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-03-03 15:04:39 +00:00
Ramiro Morales 8c3416f468 Changed strategy used to force evaluation of django.utils.translation in tests added in r15508 and r15513 to not use reload(). Thanks Alex for reporting it caused problems.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15554 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-02-16 22:30:44 +00:00
Ramiro Morales eaf17475b2 Added a test for the PendingDeprecationWarning introduced in r15441. Refs #14924, #15286.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15513 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-02-12 20:42:39 +00:00
Jannis Leidel 179fefcf7c Fixed #15286 -- Don't show deprecation warning if project locale dir is included in LOCALE_PATHS. Thanks to Claude and Ramiro.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15508 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-02-12 19:12:36 +00:00
Ramiro Morales f6e38f3800 Fixed #5494, #10765, #14924 -- Modified the order in which translations are read when composing the final translation to offer at runtime.
This is slightly backward-incompatible (could result in changed final translations for literals appearing multiple times in different .po files but with different translations).

Translations are now read in the following order (from lower to higher priority):

For the 'django' gettext domain:

 * Django translations
 * INSTALLED_APPS apps translations (with the ones listed first having higher priority)
 * settings/project path translations (deprecated, see below)
 * LOCALE_PATHS translations (with the ones listed first having higher priority)

For the 'djangojs' gettext domain:

 * Python modules whose names are passed to the javascript_catalog view
 * LOCALE_PATHS translations (with the ones listed first having higher priority, previously they weren't included)

Also, automatic loading of translations from the 'locale' subdir of the settings/project path is now deprecated.

Thanks to vanschelven, vbmendes and an anonymous user for reporting issues, to vanschelven, Claude Paroz and an anonymous contributor for their initial work on fixes and to Jannis  Leidel and Claude for review and discussion.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@15441 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-02-07 18:48:40 +00:00
Ramiro Morales 1a2f9ff9f9 Modified a few tests methods to make sure no leaks of activated locale or USE_I10N setting value happen between tests.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15411 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-02-04 15:45:52 +00:00
Ramiro Morales 987fd51176 Fixed stability of data input/output L10N format modules priority order. Thanks tonnzor for the report and fix.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15402 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-02-03 15:43:50 +00:00
Ramiro Morales 193f14d862 Fixed #15157 -- Modified evaluation of literals surrounded by _(' and ')' in templates to be evaluated at render time instead of at compile time by using ugettext_lazy. Thanks Jonathan S for the report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15327 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-01-26 15:12:18 +00:00
Jannis Leidel 5f4bc1ff23 Fixed a few translation related tests:
* Extended the admin i18n view to also take the admin translation catalogues into account.
  * Use a translation string from the core translations to test LOCALE_PATHS.
  * Fixed Russian translation of singular forms.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@15273 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-01-21 19:36:26 +00:00
Alex Gaynor fcbf881d82 Refactor all uses of thread locals to be more consistant and sane.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15232 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-01-17 09:52:47 +00:00
Ramiro Morales 8b4dffd8df Modified a try block construct in a test case to be compatible with Python 2.4.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15209 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-01-15 00:18:15 +00:00
Ramiro Morales fd12e3b218 Fixed #15024 -- Ensure that choice of L10N format module used is stable given a stable setup of format modules in ll/ and ll_CC/ dirs. Thanks David Reynolds for the report and suggestions leading to the solution.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15183 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-01-13 03:02:32 +00:00
Jannis Leidel f0cd656ee0 Fixed #14933 -- Added ability to SelectDateWidget to cope with new alternative month names added in [14900]. Thanks, alek and Claude Peroz.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15017 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-12-22 00:44:54 +00:00
Jannis Leidel 9ab85e05e2 Fixed #4030 -- Added ability to translate language names. Thanks to Antti Kaihola and Ramiro Morales for the initial patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14894 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-12-12 23:02:45 +00:00
Ramiro Morales 23f69af454 Fixed #12201 -- Added a lineno attibute to template Token so e.g. we can report line numbers in errors during i18n literals extraction. Thanks madewulf for the report and Claude Paroz for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14813 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-12-04 17:42:54 +00:00
Russell Keith-Magee ac91d5ef08 Fixed #14807 -- Ensure that boolean values aren't localized as T.rue and Fa.lse because of the thousand separator. Thanks to vanschelven for the report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14804 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-12-04 07:44:00 +00:00
Alex Gaynor 5bc0ec4ec4 Removed all usages of deprecated TestCase methods (self.fail*). This removed most of the Warnings emitted (with -Wall) during the test suite.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14803 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-12-04 07:28:12 +00:00
Jannis Leidel 17b329ae08 Fixed #10004 and #12320 -- Enabled the makemessages management command to collect comments for translators that start with the "Translators" keyword. Thanks for the report and patches, martinb and Claude Paroz.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14595 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-11-17 15:37:33 +00:00
Jannis Leidel 127506aeac Fixed #11966 -- Made it possible to use a percent sign in a translation message id. Thanks for the patch, Claude Paroz.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14459 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-11-04 14:06:24 +00:00
Jannis Leidel efc5384a32 Fixed #6476 -- Added option to makemessages management command to disable wrapping of long lines. Thanks to pytechd for the initial patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14454 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-11-04 12:08:37 +00:00
Jannis Leidel 83aeb3c768 Fixed #9988 -- Added support for translation contexts. Thanks, Claude Paroz.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14450 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-11-04 10:48:27 +00:00
Russell Keith-Magee ccc49029b8 Fixed #14181 -- Added a template tag and filters to allow localization to be disabled in a template. Thanks to Benjamin Wohlwend for the work on the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14395 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-10-29 16:48:58 +00:00
Ramiro Morales b79daef867 Consolidated i18n commands test with the rest of the i18n tests.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14133 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-10-10 22:19:01 +00:00
Jannis Leidel d80d2e8103 Fixed #14053 -- Also localize long integers. Thanks, David Danier.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13920 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-09-27 16:21:16 +00:00
Jannis Leidel 534792d055 Fixed #14290 -- Made format localization faster by caching the format modules. Thanks, Teemu Kurppa and Anssi Kääriäinen for the report and initial patches.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13898 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-09-27 15:25:08 +00:00
Russell Keith-Magee 521be8cd9c Migrated i18n and field_defaults doctests. Thanks to Alex Gaynor.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13779 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-09-12 20:03:39 +00:00
Jannis Leidel 7bb6abed12 Fixed #13702 -- Made sure to actually fall back to the l10n format strings provided in the settings, when disabled.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13770 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-09-12 19:40:44 +00:00
Jannis Leidel b057a8b247 Fixed #13560 -- Fixed localization of widgets.
Particularly this fixes the SplitDateTimeField and the AdminDateWidget by localizating the widget's value in its render method instead of the form field. Thanks to David Danier for the report and Russell for help with the patch.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@13296 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-05-21 14:07:54 +00:00
Russell Keith-Magee ebfe9383bf Fixed #13370 -- Corrected the handling of pickling for lazy() proxy objects. Thanks to Alex Gaynor for the report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13000 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-04-19 12:40:46 +00:00
Jannis Leidel ca4c6f65ea Fixed #13032 - Added localize parameter to form fields to be able to selectively enable localization.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12867 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-03-27 16:43:27 +00:00
Russell Keith-Magee ad5afd6ed2 Fixed #12769, #12924 -- Corrected the pickling of curried and lazy objects, which was preventing queries with translated or related fields from being pickled. And lo, Alex Gaynor didst slayeth the dragon.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12866 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-03-27 15:54:31 +00:00
Jannis Leidel 10d4094b86 Fixed #13054 - Only apply grouping to integer part of numbers if explicitly wanted. Thanks, Ramiro Morales.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12816 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-03-20 15:26:41 +00:00
Jannis Leidel 0d2a24fd42 Fixed #12779 - Sanitize numeric form field input according to decimal and thousand separator settings.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12625 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-03-01 10:19:24 +00:00
Jannis Leidel 12d40a9fd6 Fixed #11384 - Make sure translations in the project directory really override translations in apps as specified in the docs.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12447 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-02-16 12:17:17 +00:00
Jannis Leidel 71da5f62da Fixed #7720 - Fallback to the base language if the sub language given in the language cookie doesn't exist. Thanks, djoume and Ramiro Morales.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12442 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-02-16 12:13:48 +00:00
Jannis Leidel a28bd76bb6 Fixed #12777 - Localize decimal fields correctly. Thanks, Florian Apolloner
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12382 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-02-05 00:44:35 +00:00
Karen Tracey e0c3cd4d29 Changed an i18n test to use a number that converts consistely from string to float on Pythons up to 2.7.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12144 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-09 20:57:32 +00:00
Jannis Leidel ac371ccac8 Fixed #12435 - Handle Unicode characters in format strings correctly.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12057 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-01 21:38:58 +00:00
Jannis Leidel 855e805b4c Fixed #12230 - Updated utils.translation.to_locale to support the special sr_Latn locale. Thanks to Janos Guljas.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12056 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-01 21:38:34 +00:00
Jannis Leidel 6642060a0e Fixed #12478 - Allows the i18n related test of the SelectDateWidget to run without using a timemachine.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12051 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-01 21:36:55 +00:00
Jannis Leidel 20fbba7f90 Fixed #12472 - Correctly show TimeFields values when using locale-aware formatting. Thanks to Ramiro Morales for providing the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12050 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-01 21:36:36 +00:00
Jannis Leidel bf33d3eb1d Fixed #12444 - Date based widgets now correctly handle input values when using locale-aware formatting. Also fixes #7656.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12029 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-12-30 22:11:48 +00:00
Jannis Leidel b5a4aef43d Updated i18n tests a little to handle test failures better and updated Argentinian Spanish format strings. Thanks to Ramiro Morales. Refs #11637.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@11976 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-12-24 14:23:52 +00:00
Jannis Leidel 9233d04265 Fixed #7980 - Improved i18n framework to support locale aware formatting (dates and numbers) and form processing.
Thanks to Marc Garcia for working on this during his Google Summer of Code 2009!

Additionally fixes #1061, #2203, #3940, #5526, #6449, #6231, #6693, #6783, #9366 and #10891.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@11964 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-12-22 17:58:49 +00:00
Malcolm Tredinnick fac84c0bf4 Tweaked an i18n test that is a bit sensitive to Python versions. It returns
unexpected results on Python 2.4, so we ignore it there, too.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7264 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-03-17 16:03:46 +00:00
Malcolm Tredinnick b893eb4d7a Removed a portion of the test suite that was a pain on Python 2.3.
No actual useful functionality is lost by this; it's just a 'keep the Buildbot
happy" thing.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7120 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-02-15 15:17:48 +00:00
Malcolm Tredinnick 0a3c8f03e0 Fixed #6409 -- Unbreak compound locale name parsing (e.g. zh-cn).
This was inadvertently broken back in [6608]. Slightly backwards-incompatible:
people specifying "es_AR" in their LANGUAGES list will need to change that to
"es-ar". Thanks, simonb and Ramiro Morales for making the effort to fix this.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7091 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-02-06 01:04:30 +00:00