From d57b6a4bcc595aee990b8e1c63e786e7796b737b Mon Sep 17 00:00:00 2001
From: Florian Dold <florian.dold@gmail.com>
Date: Sun, 27 Nov 2016 22:13:24 +0100
Subject: modularize i18n

---
 src/renderHtml.tsx | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

(limited to 'src/renderHtml.tsx')

diff --git a/src/renderHtml.tsx b/src/renderHtml.tsx
index c858a8842..40b48094e 100644
--- a/src/renderHtml.tsx
+++ b/src/renderHtml.tsx
@@ -22,6 +22,7 @@
 
 
 import {AmountJson, Contract, Amounts} from "./types";
+import * as i18n from "src/i18n";
 
 export function prettyAmount(amount: AmountJson) {
   let v = amount.value + amount.fraction / Amounts.fractionalBase;
@@ -34,12 +35,12 @@ export function renderContract(contract: Contract): JSX.Element {
 
   return (
     <div>
-      <p>
-        The merchant {merchantName}
-        wants to enter a contract over {amount}{" "}
+      <i18n.Translate wrap="p">
+        The merchant <span>{merchantName}</span>
+        wants to enter a contract over <span>{amount}</span>{" "}
         with you.
-      </p>
-      <p>{i18n`You are about to purchase:`}</p>
+      </i18n.Translate>
+      <p>{i18n.str`You are about to purchase:`}</p>
       <ul>
         {contract.products.map(
           (p: any, i: number) => (<li key={i}>{`${p.description}: ${prettyAmount(p.price)}`}</li>))
-- 
cgit v1.2.3

