From 75e014ef5a693ccfb4b6d3eacb1f5d52c9c7f010 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Thu, 8 Aug 2019 18:58:04 -0700 Subject: i18n translations first pass. --- ui/src/components/navbar.tsx | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'ui/src/components/navbar.tsx') diff --git a/ui/src/components/navbar.tsx b/ui/src/components/navbar.tsx index 68e486c1..ac23e361 100644 --- a/ui/src/components/navbar.tsx +++ b/ui/src/components/navbar.tsx @@ -6,6 +6,8 @@ import { WebSocketService, UserService } from '../services'; import { UserOperation, GetRepliesForm, GetRepliesResponse, SortType, GetSiteResponse, Comment} from '../interfaces'; import { msgOp } from '../utils'; import { version } from '../version'; +import { i18n } from '../i18next'; +import { T } from 'inferno-i18next'; interface NavbarState { isLoggedIn: boolean; @@ -85,16 +87,16 @@ export class Navbar extends Component {
@@ -209,7 +211,7 @@ export class Navbar extends Component { if (UserService.Instance.user) { document.addEventListener('DOMContentLoaded', function () { if (!Notification) { - alert('Desktop notifications not available in your browser. Try Chromium.'); + alert(i18n.t('notifications_error')); return; } @@ -224,7 +226,7 @@ export class Navbar extends Component { if (Notification.permission !== 'granted') Notification.requestPermission(); else { - var notification = new Notification(`${replies.length} Unread Messages`, { + var notification = new Notification(`${replies.length} ${i18n.t('unread_messages')}`, { icon: `${window.location.protocol}//${window.location.host}/static/assets/apple-touch-icon.png`, body: `${recentReply.creator_name}: ${recentReply.content}` }); -- cgit v1.2.3