Skip to content

Commit dd5513e

Browse files
Fix some call sites
1 parent 60ec83a commit dd5513e

4 files changed

Lines changed: 5 additions & 5 deletions

File tree

app/backend/src/couchers/notifications/render_push.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ def _get_string(
195195
full_key = f"{string_group.topic}.{string_group.action}.push.{key}"
196196
else:
197197
full_key = f"{string_group}.{key}"
198-
return get_notifs_i18next().localize(full_key, loc_context.locale, substitutions)
198+
return get_notifs_i18next().localize(full_key, loc_context.locale_list, substitutions)
199199

200200

201201
def _avatar_url_or_default(user: api_pb2.User) -> str:

app/backend/src/couchers/notifications/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ def get_user_setting_groups(
337337
actions = []
338338
for topic_action in items:
339339
delivery_types = get_preference(session, user_id, topic_action)
340-
description = get_topic_action_description(topic_action, locale=loc_context.locale)
340+
description = get_topic_action_description(topic_action, locales=loc_context.locale_list)
341341
actions.append(
342342
notifications_pb2.NotificationItem(
343343
action=topic_action.action,

app/backend/src/couchers/notifications/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ def can_notify_deleted_user(topic_action: NotificationTopicAction) -> bool:
1717
return topic_action in _DELETED_USER_NOTIFICATIONS
1818

1919

20-
def get_topic_action_description(topic_action: NotificationTopicAction, locale: str) -> str:
20+
def get_topic_action_description(topic_action: NotificationTopicAction, locales: list[str]) -> str:
2121
description_key = f"{topic_action.topic}.{topic_action.action}.event_description"
22-
return get_notifs_i18next().localize(description_key, locale)
22+
return get_notifs_i18next().localize(description_key, locales)

app/backend/src/tests/test_notification_settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def test_all_notifications_appear_in_settings() -> None:
3333
def test_all_notifications_have_descriptions() -> None:
3434
for topic_action in NotificationTopicAction:
3535
# Will throw if there's no string
36-
assert get_topic_action_description(topic_action, locale=DEFAULT_LOCALE) != ""
36+
assert get_topic_action_description(topic_action, locales=[DEFAULT_LOCALE]) != ""
3737

3838

3939
def test_topic_action_unsubscribe_text_iff_unsubscribable() -> None:

0 commit comments

Comments
 (0)