diff options
| author | Sebastian Sangervasi <s.ebastian.sangervasi@gmail.com> | 2018-02-21 09:30:56 -0500 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2018-02-21 09:31:05 -0500 |
| commit | 5c4c87e55c096f093a2323bf05b57cc06d93a257 (patch) | |
| tree | 9a0c1303650fb44a7e527a056b97ea9332ee2d53 /django/utils | |
| parent | 33ac036a6bcab64ef93d0185f7b55eb57e559d6e (diff) | |
Changed "language-code" to the more commonly used "language code".
Diffstat (limited to 'django/utils')
| -rw-r--r-- | django/utils/translation/trans_real.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/django/utils/translation/trans_real.py b/django/utils/translation/trans_real.py index 5ced5a73c1..7d6ef125b5 100644 --- a/django/utils/translation/trans_real.py +++ b/django/utils/translation/trans_real.py @@ -416,11 +416,11 @@ def get_languages(): @functools.lru_cache(maxsize=1000) def get_supported_language_variant(lang_code, strict=False): """ - Return the language-code that's listed in supported languages, possibly + Return the language code that's listed in supported languages, possibly selecting a more generic variant. Raise LookupError if nothing is found. - If `strict` is False (the default), look for an alternative - country-specific variant when the currently checked is not found. + If `strict` is False (the default), look for a country-specific variant + when neither the language code nor its generic variant is found. lru_cache should have a maxsize to prevent from memory exhaustion attacks, as the provided language codes are taken from the HTTP request. See also @@ -450,11 +450,10 @@ def get_supported_language_variant(lang_code, strict=False): def get_language_from_path(path, strict=False): """ - Return the language-code if there is a valid language-code - found in the `path`. + Return the language code if there's a valid language code found in `path`. - If `strict` is False (the default), the function will look for an alternative - country-specific variant when the currently checked is not found. + If `strict` is False (the default), look for a country-specific variant + when neither the language code nor its generic variant is found. """ regex_match = language_code_prefix_re.match(path) if not regex_match: |
