Commit Graph

307 Commits

Author SHA1 Message Date
Tom Carrick bcc2befd0e Fixed #31789 -- Added a new headers interface to HttpResponse. 2020-09-14 08:41:59 +02:00
Aymeric Augustin 3f2821af6b
Fixed #31180 -- Configured applications automatically. 2020-07-21 10:35:12 +02:00
Claude Paroz e62d55a4fe Fixed #31692 -- Prevented unneeded .po file compilation.
Thanks Nick Pope and Simon Charette for the reviews.
2020-06-22 08:44:16 +02:00
Claude Paroz ed0a040773 Refs #31692 -- Updated compilemessages and tests to use pathlib. 2020-06-22 08:33:00 +02:00
Claude Paroz 9e57b1efb5 Fixed #30134 -- Ensured unlocalized numbers are string representation in templates. 2020-06-04 10:34:54 +02:00
Claude Paroz 51250d2f12 Refs #30134 -- Added test for {% localize off %} tag with format settings. 2020-06-04 10:34:54 +02:00
Carlton Gibson dd1ca50b09 Fixed #31570 -- Corrected translation loading for apps providing territorial language variants with different plural equations.
Regression in e3e48b0012.

Thanks to Shai Berger for report, reproduce and suggested fix.
2020-06-01 08:38:54 +02:00
Tom Forbes c00bc27945 Refs #30372 -- Stopped watching built-in Django translation files by auto-reloader. 2020-05-04 09:13:47 +02:00
François Freitag c86201b6ed Disabled management commands output with verbosity 0 in various tests.
Instead of capturing the command output and discard it immediately,
tell the command not to log.
2020-04-20 09:09:26 +02:00
Claude Paroz e3e48b0012
Fixed #30439 -- Added support for different plural forms for a language.
Thanks to Michal Čihař for review.
2020-03-10 15:56:32 +01:00
Cristobal Mackenzie 984531f96e Fixed #31314 -- Raised CommandError when locale is not specified in makemessages.
Regression in 0707b824fe.
2020-02-28 10:11:19 +01:00
Claude Paroz 4d973f5939 Refs #26601 -- Deprecated passing None as get_response arg to middleware classes.
This is the new contract since middleware refactoring in Django 1.10.

Co-authored-by: Carlton Gibson <carlton.gibson@noumenal.es>
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2020-02-18 20:03:44 +01:00
Mike Hansen 35d36d9462 Refs #30585 -- Updated project templates and tests to use (block)translate tags. 2019-12-18 13:15:38 +01:00
Mike Hansen d291c72bf2 Fixed #30585 -- Added {% translate %} and {% blocktranslate %} template tags. 2019-12-18 13:15:38 +01:00
Jon Dufresne 77aa74cb70 Refs #29983 -- Added support for using pathlib.Path in all settings. 2019-11-07 10:26:22 +01:00
Claude Paroz 9386586f31 Replaced subprocess commands by run() wherever possible. 2019-08-23 10:53:36 +02:00
Min ho Kim fbb83fefd4 Fixed typos in comments and docs. 2019-07-02 09:36:17 +02:00
daniel a rios 76b993a117 Fixed #26431 -- Prevented django.urls.resolve() from returning missing optional parameters.
Previous behavior was inconsistent with django.urls.reverse() and
caused that translate_url() created an incorrect URL when an optional
parameter was missing.
2019-06-24 11:47:56 +02:00
daniel a rios d640c71fa3 Refs #26431 -- Added tests for resolving URL and translate_url() with provided optional parameter. 2019-06-24 11:30:26 +02:00
Andrew Godwin a415ce70be Fixed #30451 -- Added ASGI handler and coroutine-safety.
This adds an ASGI handler, asgi.py file for the default project layout,
a few async utilities and adds async-safety to many parts of Django.
2019-06-20 12:29:43 +02:00
Jon Dufresne 9e38ed0536 Fixed #27486 -- Fixed Python 3.7 DeprecationWarning in intword and filesizeformat filters.
intword and filesizeformat passed floats to ngettext() which is
deprecated in Python 3.7. The rationale for this warning is documented
in BPO-28692: https://bugs.python.org/issue28692.

For filesizeformat, the filesize value is expected to be an int -- it
fills %d string formatting placeholders. It was likely coerced to a
float to ensure floating point division on Python 2. Python 3 always
does floating point division, so coerce to an int instead of a float to
fix the warning.

For intword, the number may contain a decimal component. In English, a
decimal component makes the noun plural. A helper function,
round_away_from_one(), was added to convert the float to an integer that
is appropriate for ngettext().
2019-06-11 20:34:59 +02:00
Daniel Hahler 08a4ee0651 Fixed typos in test names. 2019-04-27 07:47:42 +02:00
Jon Dufresne 6eb4996672 Fixed #30165 -- Deprecated ugettext(), ugettext_lazy(), ugettext_noop(), ungettext(), and ungettext_lazy(). 2019-02-08 10:05:53 -05:00
Gregory N. Schmit 48c17807a9 Fixed #16027 -- Added app_label to ContentType.__str__(). 2019-02-07 19:56:47 -05:00
Tim Graham 77d25dbd0f Refs #27753 -- Favored SafeString over SafeText. 2019-02-06 14:12:06 -05:00
Jon Dufresne 4d425abc84 Removed redundant os.chdir() in RunInTmpDirMixin child classes.
setUp() already calls os.chdir(self.test_dir).
2019-02-05 11:00:04 -05:00
Jon Dufresne 1e280f031e Removed unused branch from SymlinkExtractorTests.test_symlink().
Unused since bb7bb379e8.
SymlinkExtractorTests.test_dir, which contains
SymlinkExtractorTests.symlinked_dir, is deleted after every test.
2019-02-05 08:14:23 -05:00
Jon Dufresne 680cc417d3 Removed unused RunInTmpDirMixin.rmfile().
Unused since bb7bb379e8.
2019-02-05 13:44:32 +01:00
rsiemens a168e5616c Fixed #29973 -- Added compilemessages --ignore option. 2019-01-28 18:23:41 -05:00
Jon Dufresne 7785e03ba8 Fixed #30137 -- Replaced OSError aliases with the canonical OSError.
Used more specific errors (e.g. FileExistsError) as appropriate.
2019-01-28 11:15:06 -05:00
Jon Dufresne 7e3bf2662b Removed default mode='r' argument from calls to open(). 2019-01-27 17:41:43 -05:00
Tom Forbes c8720e7696 Fixed #27685 -- Added watchman support to the autoreloader.
Removed support for pyinotify (refs #9722).
2019-01-13 20:33:47 -05:00
Tim Graham 043bd70942 Updated test URL patterns to use path() and re_path(). 2018-12-31 10:47:32 -05:00
Patrick Arminio ae180fa4b7 Fixed #29986 -- Added .format() support to ngettext_lazy strings. 2018-12-06 15:12:34 -05:00
Simon Charette 0f212db29d Made reused RequestFactory instances class attributes. 2018-11-27 09:49:02 -05:00
Jon Dufresne e90af8bad4 Capitalized "Python" in docs and comments. 2018-10-09 09:26:07 -04:00
David 5db8d617c0 Fixed #29713 -- Added check that LANGUAGE_CODE uses standard language id format. 2018-09-03 10:43:55 +02:00
Tim Graham 013d439ff0 Refs #29600 -- Added test for datetime_safe usage in localize_input(). 2018-07-26 16:51:50 -04:00
Claude Paroz 0adfba968e Fixed #29578 -- Made numberformat.format() honor forced l10n usage.
Thanks Sassan Haradji for the report.
2018-07-19 16:44:40 -04:00
Claude Paroz a77f21880d Fixed #24384 -- Allowed compilemessages to continue running after nonfatal errors.
Thanks Aymeric Augustin for the report and Carlton Gibson and Tim Graham for
the reviews.
2018-06-13 21:09:02 +02:00
Bartosz Grabski 2bc014750a Fixed #29452 -- Fixed makemessages setting charset of .pot files. 2018-06-11 21:34:13 -04:00
Claude Paroz d65b0f72de Fixed #17379 -- Removed management commands deactivation of the locale. 2018-05-13 10:21:53 +02:00
Tim Graham 1e0cbc72e5
Moved to_language() to django.utils.translation.
Follow up to 1b7d524cfa.
2018-05-12 15:03:38 -04:00
Tim Graham 1b7d524cfa Consolidated duplicate to_locale() implementations.
Follow up to ac59ec8f1a.
2018-05-12 12:58:21 -04:00
Hasan Ramezani 305dee7bf9 Increased django.utils.translation.trans_null test coverage. 2018-05-12 11:23:44 -04:00
Hasan Ramezani ac59ec8f1a Aliased trans_null.to_locale() to trans_real.to_locale().
The implementations have unintentionally diverged.
2018-05-12 10:54:22 -04:00
Hasan Ramezani 7ba040de77 Added tests for trans_null.ngettext(). 2018-05-09 09:54:41 -04:00
Mariusz Felisiak 362813d628
Fixed hanging indentation in various code. 2018-03-16 10:54:34 +01:00
Patryk Zawadzki a20aae414e Fixed #29144 -- Made untranslated strings for territorial language variants use translations from the generic language variant. 2018-03-03 12:08:24 -05:00
Sebastian Sangervasi 7905815510 Fixed #27449 -- Added django.utils.translation.get_supported_language_variant(). 2018-02-23 14:49:00 -05:00