Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
django
Commits
80482e92
Kaydet (Commit)
80482e92
authored
Nis 17, 2019
tarafından
Matthias Kestenholz
Kaydeden (comit)
Mariusz Felisiak
Nis 24, 2019
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixes #30342 -- Removed a system check for LANGUAGES_BIDI setting.
This partly reverts commit
4400d829
.
üst
0c916255
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
26 deletions
+8
-26
translation.py
django/core/checks/translation.py
+2
-11
checks.txt
docs/ref/checks.txt
+0
-3
settings.txt
docs/ref/settings.txt
+5
-3
test_translation.py
tests/check_framework/test_translation.py
+1
-9
No files found.
django/core/checks/translation.py
Dosyayı görüntüle @
80482e92
...
@@ -24,12 +24,6 @@ E004 = Error(
...
@@ -24,12 +24,6 @@ E004 = Error(
id
=
'translation.E004'
,
id
=
'translation.E004'
,
)
)
E005
=
Error
(
'You have provided values in the LANGUAGES_BIDI setting that are not in '
'the LANGUAGES setting.'
,
id
=
'translation.E005'
,
)
@register
(
Tags
.
translation
)
@register
(
Tags
.
translation
)
def
check_setting_language_code
(
app_configs
,
**
kwargs
):
def
check_setting_language_code
(
app_configs
,
**
kwargs
):
...
@@ -62,9 +56,6 @@ def check_setting_languages_bidi(app_configs, **kwargs):
...
@@ -62,9 +56,6 @@ def check_setting_languages_bidi(app_configs, **kwargs):
def
check_language_settings_consistent
(
app_configs
,
**
kwargs
):
def
check_language_settings_consistent
(
app_configs
,
**
kwargs
):
"""Error if language settings are not consistent with each other."""
"""Error if language settings are not consistent with each other."""
available_tags
=
{
i
for
i
,
_
in
settings
.
LANGUAGES
}
|
{
'en-us'
}
available_tags
=
{
i
for
i
,
_
in
settings
.
LANGUAGES
}
|
{
'en-us'
}
messages
=
[]
if
settings
.
LANGUAGE_CODE
not
in
available_tags
:
if
settings
.
LANGUAGE_CODE
not
in
available_tags
:
messages
.
append
(
E004
)
return
[
E004
]
if
not
available_tags
.
issuperset
(
settings
.
LANGUAGES_BIDI
):
return
[]
messages
.
append
(
E005
)
return
messages
docs/ref/checks.txt
Dosyayı görüntüle @
80482e92
...
@@ -448,9 +448,6 @@ The following checks are performed on your translation configuration:
...
@@ -448,9 +448,6 @@ The following checks are performed on your translation configuration:
* **translation.E004**: You have provided a value for the
* **translation.E004**: You have provided a value for the
:setting:`LANGUAGE_CODE` setting that is not in the :setting:`LANGUAGES`
:setting:`LANGUAGE_CODE` setting that is not in the :setting:`LANGUAGES`
setting.
setting.
* **translation.E005**: You have provided values in the
:setting:`LANGUAGES_BIDI` setting that are not in the :setting:`LANGUAGES`
setting.
URLs
URLs
----
----
...
...
docs/ref/settings.txt
Dosyayı görüntüle @
80482e92
...
@@ -1879,15 +1879,17 @@ Here's a sample settings file::
...
@@ -1879,15 +1879,17 @@ Here's a sample settings file::
``LANGUAGES_BIDI``
``LANGUAGES_BIDI``
------------------
------------------
Default: A list of all language codes
from the :setting:`LANGUAGES` setting
Default: A list of all language codes
that are written right-to-left. You can
that are written right-to-left. You can see the current list of these languages
see the current list of these languages by looking in
by looking in
:source:`django/conf/global_settings.py`.
:source:`django/conf/global_settings.py`.
The list contains :term:`language codes<language code>` for languages that are
The list contains :term:`language codes<language code>` for languages that are
written right-to-left.
written right-to-left.
Generally, the default value should suffice. Only set this setting if you want
Generally, the default value should suffice. Only set this setting if you want
to restrict language selection to a subset of the Django-provided languages.
to restrict language selection to a subset of the Django-provided languages.
If you define a custom :setting:`LANGUAGES` setting, the list of bidirectional
languages may contain language codes which are not enabled on a given site.
.. setting:: LOCALE_PATHS
.. setting:: LOCALE_PATHS
...
...
tests/check_framework/test_translation.py
Dosyayı görüntüle @
80482e92
...
@@ -80,15 +80,7 @@ class TranslationCheckTests(SimpleTestCase):
...
@@ -80,15 +80,7 @@ class TranslationCheckTests(SimpleTestCase):
'You have provided a value for the LANGUAGE_CODE setting that is '
'You have provided a value for the LANGUAGE_CODE setting that is '
'not in the LANGUAGES setting.'
'not in the LANGUAGES setting.'
)
)
with
self
.
settings
(
LANGUAGE_CODE
=
'fr'
,
LANGUAGES
=
[(
'en'
,
'English'
)]
,
LANGUAGES_BIDI
=
[]
):
with
self
.
settings
(
LANGUAGE_CODE
=
'fr'
,
LANGUAGES
=
[(
'en'
,
'English'
)]):
self
.
assertEqual
(
check_language_settings_consistent
(
None
),
[
self
.
assertEqual
(
check_language_settings_consistent
(
None
),
[
Error
(
msg
,
id
=
'translation.E004'
),
Error
(
msg
,
id
=
'translation.E004'
),
])
])
msg
=
(
'You have provided values in the LANGUAGES_BIDI setting that are '
'not in the LANGUAGES setting.'
)
with
self
.
settings
(
LANGUAGE_CODE
=
'en'
,
LANGUAGES
=
[(
'en'
,
'English'
)],
LANGUAGES_BIDI
=
[
'he'
]):
self
.
assertEqual
(
check_language_settings_consistent
(
None
),
[
Error
(
msg
,
id
=
'translation.E005'
),
])
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment