From 858e62f732ec8a69957521abd1b9b7ac943472db Mon Sep 17 00:00:00 2001 From: or-else Date: Tue, 4 Feb 2020 18:05:58 +0300 Subject: [PATCH] google translate missing chinese strings --- service-worker.js | 8 ++++++-- src/i18n/zh.json | 20 ++++++++++---------- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/service-worker.js b/service-worker.js index e173dd9b..8a395dc9 100644 --- a/service-worker.js +++ b/service-worker.js @@ -7,8 +7,12 @@ firebase.initializeApp(FIREBASE_INIT); // This method shows the notifications. firebase.messaging().setBackgroundMessageHandler(function(payload) { - let title = payload.data.title || "New message"; - let options = { + if (payload.data.silent === 'true') { + return; + } + const pushType = payload.data.what || 'msg'; + const title = payload.data.title || (pushType == 'msg' ? "New message" : "New chat"); + const options = { body: payload.data.content || "", icon: '/img/logo96.png', badge: '/img/badge96.png', diff --git a/src/i18n/zh.json b/src/i18n/zh.json index baa381f3..4d67db7d 100644 --- a/src/i18n/zh.json +++ b/src/i18n/zh.json @@ -140,17 +140,17 @@ "link_privacy_policy": "隐私政策", "action_delete_messages": "删除所有帖子", "action_block_contact": "屏蔽联系人", - "delete_messages_warning": ":!![MISSING]!!:Are you sure you want to delete all messages? It cannot be undone.", - "leave_chat_warning": ":!![MISSING]!!:Are you sure you want to leave this conversation.", - "block_contact_warning": ":!![MISSING]!!:Are you sure you want to block this contact?", + "delete_messages_warning": "您确定要删除所有消息吗?无法撤消。", + "leave_chat_warning": "您确定要退出此对话吗?", + "block_contact_warning": "您确定要阻止此联系人吗?", "action_report_chat": "检举垃圾邮件", - "report_chat_warning": ":!![MISSING]!!:Are you sure you want to block and report this conversation?", - "action_clear_messages": ":!![MISSING]!!:Clear Messages", - "clear_messages_warning": ":!![MISSING]!!:Are you sure you want to clear all messages? It cannot be undone.", - "topic_delete_warning": ":!![MISSING]!!:Are you sure you want to delete this conversation?", - "topic_block_warning": ":!![MISSING]!!:Are you sure you want to block this conversation?", - "search_no_results": ":!![MISSING]!!:Search returned no results", + "report_chat_warning": "您确定要停止并报告此对话吗?", + "action_clear_messages": "删除讯息", + "clear_messages_warning": "您确定要清除所有消息吗?无法撤消。", + "topic_delete_warning": "您确定要删除此对话吗?", + "topic_block_warning": "您确定要阻止此对话吗?", + "search_no_results": "搜索返回任何结果", "deleted_content": "内容已删除", "image_caption_prompt": "图片标题", - "menu_item_send_retry": ":!![MISSING]!!:Retry" + "menu_item_send_retry": "重试" }