Commit Graph

98 Commits

Author SHA1 Message Date
Mariusz Felisiak d134b0b93e Refs #15902 -- Stopped set_language() storing user's language in the session.
Per deprecation timeline.
2021-01-14 17:50:04 +01:00
Claude Paroz b23216d9d0
Refs #31493 -- Replaced var with const and let in JavaScriptCatalog template. 2020-08-05 08:08:46 +02:00
Jon Dufresne dbae6de01e Simplified JavaScript with Array.prototype.includes().
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/includes
2020-07-01 10:16:20 +02:00
Jon Dufresne d6aff369ad Refs #30116 -- Simplified regex match group access with Match.__getitem__().
The method has been available since Python 3.6. The shorter syntax is
also marginally faster.
2020-05-11 12:01:28 +02:00
David Smith 2522559d1a Fixed #31534 -- Deprecated django.conf.urls.url(). 2020-05-05 07:34:34 +02:00
Claude Paroz 7fa0fa45c5 Refs #30997 -- Removed HttpRequest.is_ajax() usage. 2020-01-27 08:52:40 +01:00
Mike Yusko 0707ff6d36 Renamed set_language()'s next variable to avoid clash with builtin. 2020-01-09 07:54:18 +01:00
Carlton Gibson 4f61810751 Fixed #30747 -- Renamed is_safe_url() to url_has_allowed_host_and_scheme(). 2019-09-02 15:32:23 +02:00
Ran Benita 19fc6376ce
Fixed #30304 -- Added support for the HttpOnly, SameSite, and Secure flags on language cookies. 2019-04-08 11:26:06 +02:00
Claude Paroz a8e2a9bac6 Refs #15902 -- Deprecated storing user's language in the session. 2019-02-14 10:23:02 -05:00
Claude Paroz 16454ac35f Fixed #29825 -- Fixed JS ngettext if the string is a non-plural msgid in the catalog. 2019-01-28 21:04:36 +01:00
Tim Graham 7cdeb23ae7 Fixed #29511 -- Added charset to JavaScriptCatalog's Content-Type header. 2018-06-22 09:15:29 +02:00
Tim Graham 238ed313c5 Removed views.i18n.null_javascript_catalog().
Unused since de40cfbe74.
2018-06-21 11:06:14 -04:00
Дилян Палаузов d7b2aa24f7 Fixed #28982 -- Simplified code with and/or. 2018-01-03 20:12:23 -05:00
Claude Paroz b3cd9fb18b Refs #15902 -- Made set_language() view always set the current language in a cookie.
The plan is to later deprecate/remove storing the language in the session.
2018-01-03 11:25:40 -05:00
Sergey Fedoseev f2b93b509c Removed unneeded iter() calls.
A few of these were unnecessarily added in 2b281cc35e.
2017-08-23 16:48:29 -04:00
Claude Paroz 23142eea85 Fixed #18394 -- Added error for invalid JavaScriptCatalog packages
Thanks Tim Graham for the review.
2017-06-06 18:02:22 +02:00
Jon Dufresne 2c69824e5a Refs #23968 -- Removed unnecessary lists, generators, and tuple calls. 2017-06-01 19:08:59 -04:00
Claude Paroz 2cbb095bec Fixed #28221 -- Fixed plural fallback translations in JavaScriptCatalog view
Thanks Waldemar Kornewald for the report and initial patch.
2017-05-25 22:47:21 +02:00
Claude Paroz eb66057c1e Refs #28221 -- Honor plural number in JavaScriptCatalog 2017-05-20 13:23:54 +02:00
Claude Paroz d842ada305 Refs #27795 -- Stopped converting integer format settings to str in JS/JSON i18n views
Thanks Tim Graham for the review.
2017-05-08 19:32:03 +02:00
Anton Samarchyan 711123e1cd Refs #27656 -- Updated django.views docstring verbs according to PEP 257. 2017-03-03 17:05:42 -05:00
Asif Saifuddin Auvi 5f3a689f71 Imported django.http classes instead of django.http. 2017-02-27 14:47:11 -05:00
Claude Paroz fee42fd99e Refs #23919 -- Replaced usage of django.utils.http utilities with Python equivalents
Thanks Tim Graham for the review.
2017-01-26 19:49:03 +01:00
Claude Paroz 2b281cc35e Refs #23919 -- Removed most of remaining six usage
Thanks Tim Graham for the review.
2017-01-18 21:33:28 +01:00
Claude Paroz 7b2f2e74ad Refs #23919 -- Removed six.<various>_types usage
Thanks Tim Graham and Simon Charette for the reviews.
2017-01-18 20:18:46 +01:00
Tim Graham 2b20e4148f Refs #19567 -- Removed deprecated javascript_catalog() and json_catalog() views. 2017-01-17 20:52:03 -05:00
Waldemar Kornewald b24af2f405 Fixed #27418 -- Fixed occasional missing plural forms in JavaScriptCatalog. 2016-12-14 18:20:30 -05:00
Alvin Lindstam 6b5106b1ce Fixed #27374 -- Made JavaScriptCatalog respect the packages argument. 2016-10-22 19:26:08 -04:00
Jon Dufresne f227b8d15d Refs #26956 -- Allowed is_safe_url() to validate against multiple hosts 2016-09-07 19:56:25 -07:00
Claude Paroz 2ced2f785d Replaced smart_* by force_* calls whenever possible
The smart_* version should only be used when a lazy string should keep
its lazy status.
2016-09-03 13:46:41 +02:00
Przemysław Suliga 1f68bb5683 Refs #26902 -- Protected against insecure redirects in set_language(). 2016-08-19 19:16:00 -04:00
Tim Graham 0d8b523422 Fixed #26553 -- Removed unneeded loop in views/i18n.py 2016-04-28 09:15:34 -04:00
Claude Paroz de40cfbe74 Fixed #19567 -- Added JavaScriptCatalog and JSONCatalog class-based views
Thanks Cristiano Coelho and Tim Graham for the reviews.
2016-04-15 17:28:54 +02:00
Miikka Salminen 9e3f141701 Fixed #26466 -- Added HTTP_REFERER decoding to i18n set_language() view. 2016-04-09 10:57:43 -04:00
Tim Graham df8d8d4292 Fixed E128 flake8 warnings in django/. 2016-04-08 09:51:06 -04:00
Krzysztof Jurewicz 940b7fd5cb Fixed #21446 -- Allowed not performing redirect in set_language view
Thanks Claude Paroz and Tim Graham for polishing the patch.
2016-03-29 22:15:14 +02:00
Claude Paroz 11c60b5298 Reused the DjangoTranslation class for the javascript_catalog view
Thanks Tim Graham and Cristiano Coelho for the reviews.
Refs #26328, #26319.
2016-03-08 21:39:59 +01:00
userimack 60586dd737 Fixed #26125 -- Fixed E731 flake warnings. 2016-01-25 14:23:43 -05:00
Marten Kenbeek 16411b8400 Fixed #26013 -- Moved django.core.urlresolvers to django.urls.
Thanks to Tim Graham for the review.
2015-12-31 14:21:29 -05:00
Sergey Kolosov 244404227e Fixed #22404 -- Added a view that exposes i18n catalog as a JSON
Added django.views.i18n.json_catalog() view, which returns a JSON
response containing translations, formats, and a plural expression
for the specified language.
2015-08-05 09:05:21 -04:00
Piotr Jakimiak 4157c502a5 Removed unnecessary arguments in .get method calls 2015-05-13 20:51:18 +02:00
Moritz Sichert d94449f37a Removed spaces after 'function' in jsi18n 2015-03-20 17:28:29 -04:00
Moritz Sichert 6bb2175ed6 Fixed #22106 -- Allowed using more than one instance of javascript_catalog per project. 2015-03-20 17:27:41 -04:00
Claude Paroz aa5ab114e3 Fixed #24122 -- Redirected to translated url after setting language
Thanks gbdlin for the initial patch and Tim Graham for the review.
2015-03-13 16:46:40 +01:00
Aymeric Augustin 556a74879f Fixed a few uses of Template that relied on a default engine.
Refs #24389.
2015-02-22 23:13:55 +01:00
Tim Graham 0ed7d15563 Sorted imports with isort; refs #23860. 2015-02-06 08:16:28 -05:00
darkryder 9ec8aa5e5d Fixed #24149 -- Normalized tuple settings to lists. 2015-02-03 14:59:45 -05:00
Tim Graham 1101467ce0 Limited lines to 119 characters in django/
refs #23395.
2014-09-05 09:22:16 -04:00
Sergey Kolosov 8c98f39624 Fixed #15318 -- Added settings for language cookie max-age, path, domain
Introduced a number of settings to configure max-age, path, and domain
for the language cookie: LANGUAGE_COOKIE_AGE, LANGUAGE_COOKIE_PATH and
LANGUAGE_COOKIE_DOMAIN.

Thanks sahid for the suggestion.
2014-03-01 07:52:45 -05:00