From d57b6a4bcc595aee990b8e1c63e786e7796b737b Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Sun, 27 Nov 2016 22:13:24 +0100 Subject: modularize i18n --- src/popup/popup.tsx | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'src/popup/popup.tsx') diff --git a/src/popup/popup.tsx b/src/popup/popup.tsx index bd93f54f2..47dbd0b8f 100644 --- a/src/popup/popup.tsx +++ b/src/popup/popup.tsx @@ -33,8 +33,7 @@ import { WalletBalanceEntry } from "src/types"; import {abbrev, prettyAmount} from "src/renderHtml"; - -declare var i18n: any; +import * as i18n from "src/i18n"; function onUpdateNotification(f: () => void): () => void { let port = chrome.runtime.connect({name: "notifications"}); @@ -170,13 +169,13 @@ class WalletNavBar extends React.Component { return ( ); } @@ -236,7 +235,7 @@ class WalletBalanceView extends React.Component { renderEmpty(): JSX.Element { let helpLink = ( - {i18n`help`} + {i18n.str`help`} ); return ( @@ -297,7 +296,7 @@ class WalletBalanceView extends React.Component { render(): JSX.Element { let wallet = this.balance; if (this.gotError) { - return i18n`Error: could not retrieve balance information.`; + return i18n.str`Error: could not retrieve balance information.`; } if (!wallet) { return ; @@ -384,7 +383,7 @@ function formatHistoryItem(historyItem: HistoryRecord) { ); } default: - return (

{i18n`Unknown event (${historyItem.type})`}

); + return (

{i18n.str`Unknown event (${historyItem.type})`}

); } } @@ -427,7 +426,7 @@ class WalletHistory extends React.Component { console.log("rendering history"); let history: HistoryRecord[] = this.myHistory; if (this.gotError) { - return i18n`Error: could not retrieve event history`; + return i18n.str`Error: could not retrieve event history`; } if (!history) { @@ -461,7 +460,7 @@ class WalletHistory extends React.Component { if (listing.length > 0) { return
{listing}
; } - return

{i18n`Your wallet has no events recorded.`}

+ return

{i18n.str`Your wallet has no events recorded.`}

} } -- cgit v1.2.3