mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 13:03:29 +00:00
i18n: Deal with lazy strings more carefully.
This uses a more specific type `_StrPromise` to replace `Promise` providing typing information for lazy translation strings. In places where the callee evaluates the `_StrPromise` object in all cases we simply force the evaluation with `str()`. This includes `JsonableError` that ends up handled by the error handler middleware, and `internal_send_stream_message` that depends on `check_stream_topic`, requiring the `topic` to be evaluated anyway. In other siuations, the callee is expected to be able to handle `StrPromise` explicitly. Signed-off-by: Zixuan James Li <p359101898@gmail.com>
This commit is contained in:
committed by
Tim Abbott
parent
ab9279aabe
commit
bb9e80d7a2
@@ -740,7 +740,7 @@ def send_messages_for_new_subscribers(
|
||||
internal_prep_stream_message(
|
||||
sender=sender,
|
||||
stream=stream,
|
||||
topic=Realm.STREAM_EVENTS_NOTIFICATION_TOPIC,
|
||||
topic=str(Realm.STREAM_EVENTS_NOTIFICATION_TOPIC),
|
||||
content=_(
|
||||
"**{policy}** stream created by {user_name}. **Description:**"
|
||||
).format(
|
||||
|
||||
Reference in New Issue
Block a user