فهرست منبع

Merge pull request #4626 from weseek:imprv/#80104-apply-i18n

Imprv/#80104 apply i18n
Yuki Takei 4 سال پیش
والد
کامیت
3ef2a49609

+ 4 - 0
packages/app/resource/locales/en_US/translation.json

@@ -256,6 +256,10 @@
       "This tree": "Only children of this tree"
       "This tree": "Only children of this tree"
     }
     }
   },
   },
+  "in_app_notification": {
+    "notification_list": "In-App Notification List",
+    "see_all": "See All"
+  },
   "in_app_notification_settings": {
   "in_app_notification_settings": {
     "in_app_notification_settings": "In-App Notification Settings",
     "in_app_notification_settings": "In-App Notification Settings",
     "subscribe_settings": "Settings to automatically subscribe (Receive notifications) to pages",
     "subscribe_settings": "Settings to automatically subscribe (Receive notifications) to pages",

+ 4 - 0
packages/app/resource/locales/ja_JP/translation.json

@@ -258,6 +258,10 @@
       "This tree": "この階層下の子ページのみ"
       "This tree": "この階層下の子ページのみ"
     }
     }
   },
   },
+  "in_app_notification": {
+    "notification_list": "アプリ内通知一覧",
+    "see_all": "通知一覧を見る"
+  },
   "in_app_notification_settings": {
   "in_app_notification_settings": {
     "in_app_notification_settings": "アプリ内通知設定",
     "in_app_notification_settings": "アプリ内通知設定",
     "subscribe_settings": "自動でページをサブスクライブする(通知を受け取る)設定",
     "subscribe_settings": "自動でページをサブスクライブする(通知を受け取る)設定",

+ 5 - 1
packages/app/resource/locales/zh_CN/translation.json

@@ -236,7 +236,11 @@
 			"All pages": "所有页面",
 			"All pages": "所有页面",
 			"This tree": "当前分支以下内容"
 			"This tree": "当前分支以下内容"
 		}
 		}
-	},
+  },
+  "in_app_notification": {
+    "notification_list": "应用内通知列表",
+    "see_all": "查看通知列表"
+  },
   "in_app_notification_settings": {
   "in_app_notification_settings": {
     "in_app_notification_settings": "在应用程序通知设置",
     "in_app_notification_settings": "在应用程序通知设置",
     "subscribe_settings": "自动订阅(接收通知)页面的设置",
     "subscribe_settings": "自动订阅(接收通知)页面的设置",

+ 4 - 2
packages/app/src/components/InAppNotification/InAppNotificationDropdown.tsx

@@ -2,8 +2,10 @@ import React, { useState, useEffect, FC } from 'react';
 import {
 import {
   Dropdown, DropdownToggle, DropdownMenu, DropdownItem,
   Dropdown, DropdownToggle, DropdownMenu, DropdownItem,
 } from 'reactstrap';
 } from 'reactstrap';
+import { useTranslation } from 'react-i18next';
 import loggerFactory from '~/utils/logger';
 import loggerFactory from '~/utils/logger';
 
 
+
 import AppContainer from '../../client/services/AppContainer';
 import AppContainer from '../../client/services/AppContainer';
 import { withUnstatedContainers } from '../UnstatedUtils';
 import { withUnstatedContainers } from '../UnstatedUtils';
 import InAppNotificationList from './InAppNotificationList';
 import InAppNotificationList from './InAppNotificationList';
@@ -18,6 +20,7 @@ type Props = {
 };
 };
 
 
 const InAppNotificationDropdown: FC<Props> = (props: Props) => {
 const InAppNotificationDropdown: FC<Props> = (props: Props) => {
+  const { t } = useTranslation();
   const { appContainer } = props;
   const { appContainer } = props;
 
 
   const [count, setCount] = useState(0);
   const [count, setCount] = useState(0);
@@ -89,8 +92,7 @@ const InAppNotificationDropdown: FC<Props> = (props: Props) => {
       <DropdownMenu className="px-2" right>
       <DropdownMenu className="px-2" right>
         <InAppNotificationList inAppNotificationData={inAppNotificationData} />
         <InAppNotificationList inAppNotificationData={inAppNotificationData} />
         <DropdownItem divider />
         <DropdownItem divider />
-        {/* TODO: Able to show all notifications by #79317 */}
-        <a className="dropdown-item d-flex justify-content-center" href="/me/all-in-app-notifications">See All</a>
+        <a className="dropdown-item d-flex justify-content-center" href="/me/all-in-app-notifications">{ t('in_app_notification.see_all') }</a>
       </DropdownMenu>
       </DropdownMenu>
     </Dropdown>
     </Dropdown>
   );
   );

+ 2 - 4
packages/app/src/server/views/me/all-in-app-notifications.html

@@ -1,15 +1,13 @@
 {% extends '../layout/layout.html' %}
 {% extends '../layout/layout.html' %}
 
 
-<!-- TODO: apply i18n by #80104 -->
-{% block html_title %}{{ customizeService.generateCustomTitleForFixedPageName(t('All In-App Notifications')) }}{% endblock %}
+{% block html_title %}{{ customizeService.generateCustomTitleForFixedPageName(t('in_app_notification.notification_list')) }}{% endblock %}
 
 
 {% block layout_main %}
 {% block layout_main %}
 
 
 {% block content_header_wrapper %}
 {% block content_header_wrapper %}
 <header class="py-3">
 <header class="py-3">
   <div class="container-fluid">
   <div class="container-fluid">
-    <!-- TODO: apply i18n by #80104 -->
-    <h1 class="title">All In-App Notifications</h1>
+    <h1 class="title">{{ t('in_app_notification.notification_list') }}</h1>
   </div>
   </div>
 </header>
 </header>
 <div id="grw-fav-sticky-trigger" class="sticky-top"></div>
 <div id="grw-fav-sticky-trigger" class="sticky-top"></div>