From 457db112dd1dbe67df3462438fb389b45bfb7d32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Glatzl?= Date: Thu, 12 Nov 2020 14:56:28 +0100 Subject: [PATCH] Set keySeparator to false in order to cowork with html keys --- app/components/Avatar/AvatarWithPresence.js | 30 +++++++++++---------- app/scenes/Collection.js | 12 ++------- shared/translations/de_DE.json | 4 +-- shared/translations/default.json | 6 ++++- shared/translations/i18n.js | 1 + shared/translations/pt_PT.json | 4 +-- 6 files changed, 28 insertions(+), 29 deletions(-) diff --git a/app/components/Avatar/AvatarWithPresence.js b/app/components/Avatar/AvatarWithPresence.js index 8c2647110d..0bd9d10a12 100644 --- a/app/components/Avatar/AvatarWithPresence.js +++ b/app/components/Avatar/AvatarWithPresence.js @@ -4,7 +4,7 @@ import { observable } from "mobx"; import { observer } from "mobx-react"; import { EditIcon } from "outline-icons"; import * as React from "react"; -import { withTranslation } from "react-i18next"; +import { withTranslation, Trans } from "react-i18next"; import styled from "styled-components"; import User from "models/User"; import UserProfile from "scenes/UserProfile"; @@ -47,20 +47,22 @@ class AvatarWithPresence extends React.Component { - {t( - "{{ userName }} {{ you }}
{{ action }}
", - { - userName: user.name, - you: isCurrentUser && t("(You)"), - action: isPresent - ? isEditing - ? t("currently editing") - : t("currently viewing") - : t("viewed {{ timeAgo }} ago", { - timeAgo: distanceInWordsToNow(new Date(lastViewedAt)), - }), + } placement="bottom" diff --git a/app/scenes/Collection.js b/app/scenes/Collection.js index 390b603c68..ee39af89a0 100644 --- a/app/scenes/Collection.js +++ b/app/scenes/Collection.js @@ -4,7 +4,7 @@ import { observer, inject } from "mobx-react"; import { NewDocumentIcon, PlusIcon, PinIcon } from "outline-icons"; import * as React from "react"; -import { withTranslation } from "react-i18next"; +import { withTranslation, Trans } from "react-i18next"; import { Redirect, Link, Switch, Route, type Match } from "react-router-dom"; import styled, { withTheme } from "styled-components"; @@ -190,15 +190,7 @@ class CollectionScene extends React.Component { {collection.isEmpty ? ( - {t( - ` - {{ collectionName }} doesn’t contain any - documents yet. -
- Get started by creating a new one! - `, - { collectionName: collection.name } - )} +
diff --git a/shared/translations/de_DE.json b/shared/translations/de_DE.json index f0a25efc9b..1b24f279f6 100644 --- a/shared/translations/de_DE.json +++ b/shared/translations/de_DE.json @@ -92,7 +92,6 @@ "Activate account": "Konto aktivieren", "Suspend account…": "Konto suspendieren…", "Search in collection…": "Innerhalb der Kollektion suchen…", - "\n {{ collectionName }} doesn’t contain any\n documents yet.\n
\n Get started by creating a new one!\n ": "\n {{ collectionName }} enthält noch keine\n Dokumente.\n
\n Erstellen Sie zunächst ein neues!\n ", "Create a document": "Dokument erstellen", "Manage members…": "Mitglieder verwalten…", "Pinned": "Gepinned", @@ -138,5 +137,6 @@ "Save": "Speichern", "Delete Account": "Konto löschen", "You may delete your account at any time, note that this is unrecoverable": "Sie können Ihr Konto jederzeit löschen. Beachten Sie, dass dies nicht wiederherstellbar ist", - "Delete account": "Konto löschen" + "Delete account": "Konto löschen", + "{{ collectionName }} doesn’t contain any documents yet.
Get started by creating a new one!": "{{ collectionName }} enthält noch keine Dokumente.
Erstellen Sie jetzt ein neues!" } diff --git a/shared/translations/default.json b/shared/translations/default.json index 1e893fe067..4c4844cc97 100644 --- a/shared/translations/default.json +++ b/shared/translations/default.json @@ -1,5 +1,9 @@ { "{{ userName }} {{ you }}
{{ action }}
": "{{ userName }} {{ you }}
{{ action }}
", + "(You)": "(You)", + "currently editing": "currently editing", + "currently viewing": "currently viewing", + "viewed {{ timeAgo }} ago": "viewed {{ timeAgo }} ago", "Trash": "Trash", "Archive": "Archive", "Drafts": "Drafts", @@ -92,7 +96,7 @@ "Activate account": "Activate account", "Suspend account…": "Suspend account…", "Search in collection…": "Search in collection…", - "\n {{ collectionName }} doesn’t contain any\n documents yet.\n
\n Get started by creating a new one!\n ": "\n {{ collectionName }} doesn’t contain any\n documents yet.\n
\n Get started by creating a new one!\n ", + "{{ collectionName }} doesn’t contain any documents yet.
Get started by creating a new one!": "{{ collectionName }} doesn’t contain any documents yet.
Get started by creating a new one!", "Create a document": "Create a document", "Manage members…": "Manage members…", "Pinned": "Pinned", diff --git a/shared/translations/i18n.js b/shared/translations/i18n.js index ccd4c190c0..01c7d26178 100644 --- a/shared/translations/i18n.js +++ b/shared/translations/i18n.js @@ -19,6 +19,7 @@ const initI18n = (debug = true) => { ? process.env.DEFAULT_LANGUAGE : "en_US", debug: process.env.NODE_ENV !== "production" && debug, + keySeparator: false, resources: { en_US: { translation: en_US, diff --git a/shared/translations/pt_PT.json b/shared/translations/pt_PT.json index 65031d6a5d..4f6d125f96 100644 --- a/shared/translations/pt_PT.json +++ b/shared/translations/pt_PT.json @@ -92,7 +92,6 @@ "Activate account": "Ativar conta", "Suspend account…": "Suspender conta…", "Search in collection…": "Procurar na coleção…", - "\n {{ collectionName }} doesn’t contain any\n documents yet.\n
\n Get started by creating a new one!\n ": "\n {{ collectionName }} não contém nenhum documento\n ainda.\n
\n Para começar crie um documento novo!\n ", "Create a document": "Criar documento", "Manage members…": "Gerenciar membros…", "Pinned": "Marcado", @@ -138,5 +137,6 @@ "Save": "Guardar", "Delete Account": "Apagar conta", "You may delete your account at any time, note that this is unrecoverable": "Pode apagar a sua conta a qualquer momento, atenção que isso é irrecuperável", - "Delete account": "Apagar conta" + "Delete account": "Apagar conta", + "{{ collectionName }} doesn’t contain any documents yet.
Get started by creating a new one!": "{{ collectionName }} não contém nenhum documento ainda.
Para começar, crie um documento novo!" }