From 859efa4dad4f12bf35d3cc34cc8b2984e01e5c3c Mon Sep 17 00:00:00 2001 From: Divlo Date: Wed, 16 Mar 2022 14:04:19 +0100 Subject: [PATCH] fix: add missing translation --- .../ChannelSettings/ChannelSettings.tsx | 4 ++-- .../Application/GuildSettings/GuildSettings.tsx | 6 +++--- components/Application/Messages/Messages.tsx | 6 ++++-- .../Application/UserSettings/UserSettings.tsx | 17 ++++++++++++++++- locales/en/application.json | 8 ++++++-- locales/fr/application.json | 8 ++++++-- 6 files changed, 37 insertions(+), 12 deletions(-) diff --git a/components/Application/ChannelSettings/ChannelSettings.tsx b/components/Application/ChannelSettings/ChannelSettings.tsx index 8a51125..95ebfb1 100644 --- a/components/Application/ChannelSettings/ChannelSettings.tsx +++ b/components/Application/ChannelSettings/ChannelSettings.tsx @@ -110,7 +110,7 @@ export const ChannelSettings: React.FC = (props) => {
diff --git a/components/Application/GuildSettings/GuildSettings.tsx b/components/Application/GuildSettings/GuildSettings.tsx index fe7cadd..d6d2ca3 100644 --- a/components/Application/GuildSettings/GuildSettings.tsx +++ b/components/Application/GuildSettings/GuildSettings.tsx @@ -172,7 +172,7 @@ export const GuildSettings: React.FC = () => { {member.isOwner ? ( <> ) : ( @@ -189,7 +189,7 @@ export const GuildSettings: React.FC = () => { onClick={handleLeave} data-cy='button-leave-guild-settings' > - Quitter {guild.name} + {t('application:leave')} {guild.name} )}
diff --git a/components/Application/Messages/Messages.tsx b/components/Application/Messages/Messages.tsx index 9c385d9..4f64c27 100644 --- a/components/Application/Messages/Messages.tsx +++ b/components/Application/Messages/Messages.tsx @@ -1,3 +1,4 @@ +import useTranslation from 'next-translate/useTranslation' import InfiniteScroll from 'react-infinite-scroll-component' import { Loader } from '../../design/Loader' @@ -6,6 +7,7 @@ import { useMessages } from '../../../contexts/Messages' import { Emoji } from '../../Emoji' export const Messages: React.FC = () => { + const { t } = useTranslation() const { messages, hasMore, nextPage } = useMessages() if (messages.length === 0) { @@ -15,9 +17,9 @@ export const Messages: React.FC = () => { className='scrollbar-firefox-support mt-8 flex w-full flex-1 flex-col overflow-y-auto text-center text-lg transition-all' >

- Nothing to show here! + {t('application:nothing-here')}

-

Start chatting to kill this Ghost!

+

{t('application:start-chatting-kill-ghost')}

) } diff --git a/components/Application/UserSettings/UserSettings.tsx b/components/Application/UserSettings/UserSettings.tsx index cde3c03..539cfc0 100644 --- a/components/Application/UserSettings/UserSettings.tsx +++ b/components/Application/UserSettings/UserSettings.tsx @@ -155,6 +155,16 @@ export const UserSettings: React.FC = () => { } } + const handleSignout = async (): Promise => { + try { + setFetchState('loading') + await authentication.signoutServerSide() + } catch (error) { + setFetchState('error') + setMessageTranslationKey('errors:server-error') + } + } + return (
{
- +
+ + +
diff --git a/locales/en/application.json b/locales/en/application.json index 620b585..bcac566 100644 --- a/locales/en/application.json +++ b/locales/en/application.json @@ -13,6 +13,10 @@ "biography": "Biography", "label-checkbox-email": "Show your email to everyone.", "label-checkbox-guilds": "Show the list of guilds to everyone.", - "private-user-guilds-list": "List of private guilds", - "nothing-here": "Nothing's here..." + "nothing-here": "Nothing's here...", + "save": "Save", + "delete": "Delete", + "signout": "Sign out", + "leave": "Leave", + "start-chatting-kill-ghost": "Start chatting to kill this ghost!" } diff --git a/locales/fr/application.json b/locales/fr/application.json index 45190fc..978adb1 100644 --- a/locales/fr/application.json +++ b/locales/fr/application.json @@ -13,6 +13,10 @@ "biography": "Biographie", "label-checkbox-email": "Afficher votre email au public.", "label-checkbox-guilds": "Afficher la liste des guildes au public.", - "private-user-guilds-list": "Liste des guildes privées", - "nothing-here": "Il n'y a rien ici..." + "nothing-here": "Il n'y a rien ici...", + "save": "Sauvegarder", + "delete": "Supprimer", + "signout": "Se déconnecter", + "leave": "Quitter", + "start-chatting-kill-ghost": "Commencez à discuter pour tuer ce fantôme !" }