i18n: Be deliberate about distinguishing ugettext and ugettext_lazy.

The early str conversions in zerver.models were defeating the point of
ugettext_lazy.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2020-10-16 18:00:33 -07:00
committed by Tim Abbott
parent e6f6f8d45f
commit bba43f35ca
4 changed files with 57 additions and 46 deletions

View File

@@ -1,6 +1,7 @@
from typing import Any, Callable, Dict, List, Optional, Tuple, TypeVar, Union
from django.http import HttpResponse
from django.utils.functional import Promise
from typing_extensions import TypedDict
ViewFuncT = TypeVar('ViewFuncT', bound=Callable[..., HttpResponse])
@@ -26,9 +27,9 @@ class ProfileDataElement(ProfileDataElementBase):
ProfileData = List[ProfileDataElement]
FieldElement = Tuple[int, str, Validator[Union[int, str, List[int]]], Callable[[Any], Any], str]
ExtendedFieldElement = Tuple[int, str, ExtendedValidator, Callable[[Any], Any], str]
UserFieldElement = Tuple[int, str, RealmUserValidator, Callable[[Any], Any], str]
FieldElement = Tuple[int, Promise, Validator[Union[int, str, List[int]]], Callable[[Any], Any], str]
ExtendedFieldElement = Tuple[int, Promise, ExtendedValidator, Callable[[Any], Any], str]
UserFieldElement = Tuple[int, Promise, RealmUserValidator, Callable[[Any], Any], str]
ProfileFieldData = Dict[str, Union[Dict[str, str], str]]