diff --git a/web/components/notifications.tsx b/web/components/notifications.tsx index b141c03c..c5b33f7f 100644 --- a/web/components/notifications.tsx +++ b/web/components/notifications.tsx @@ -10,6 +10,7 @@ import {api} from "web/lib/api"; import {MultiSelectAnswers} from "web/components/answers/answer-compatibility-question-content"; import {PrivateUser} from "common/user"; import {WithPrivateUser} from "web/components/user/with-user"; +import {useT} from 'web/lib/locale' export const NotificationSettings = () => ( @@ -27,6 +28,8 @@ function LoadedNotificationSettings(props: { 'notification-preferences' ) + const t = useT() + const notificationTypes: { type: notification_preference question: string @@ -34,11 +37,11 @@ function LoadedNotificationSettings(props: { { type: 'new_match', question: - '... matches with you?', + t('notifications.question.new_match', '... matches with you?'), }, { type: 'new_message', - question: '... sends you a new message?', + question: t('notifications.question.new_message', '... sends you a new message?'), }, // { // type: 'new_profile_like', @@ -46,7 +49,7 @@ function LoadedNotificationSettings(props: { // }, { type: 'new_endorsement', - question: '... endorses you?', + question: t('notifications.question.new_endorsement', '... endorses you?'), }, // { // type: 'new_profile_ship', @@ -54,7 +57,7 @@ function LoadedNotificationSettings(props: { // }, { type: 'tagged_user', - question: '... mentions you?', + question: t('notifications.question.tagged_user', '... mentions you?'), }, // { // type: 'on_new_follow', @@ -62,19 +65,19 @@ function LoadedNotificationSettings(props: { // }, { type: 'new_search_alerts', - question: 'Alerts from bookmarked searches?', + question: t('notifications.question.new_search_alerts', 'Alerts from bookmarked searches?'), }, { type: 'opt_out_all', question: - 'Opt out of all notifications? (You can always change this later)', + t('notifications.question.opt_out_all', 'Opt out of all notifications? (You can always change this later)'), }, ] return (
-

Where do you want to be notified when someone

+

{t('notifications.heading', 'Where do you want to be notified when someone')}

{notificationTypes.map(({type, question}) => ( void }) => { const {type, question, selected, onUpdate} = props + const t = useT() const getSelectedValues = (destinations: string[]) => { const values: number[] = [] @@ -144,7 +148,10 @@ const NotificationOption = (props: {
{question}
diff --git a/web/components/theme-icon.tsx b/web/components/theme-icon.tsx index db2eac36..db4b1455 100644 --- a/web/components/theme-icon.tsx +++ b/web/components/theme-icon.tsx @@ -2,24 +2,26 @@ import {MoonIcon, SunIcon} from "@heroicons/react/outline" import clsx from "clsx" import {useTheme} from "web/hooks/use-theme" import {Row} from "web/components/layout/row"; +import {useT} from 'web/lib/locale' export default function ThemeIcon(props: { className?: string }) { const {className} = props const {theme, setTheme} = useTheme() + const t = useT() const toggleTheme = () => { setTheme(theme === 'auto' ? 'dark' : theme === 'dark' ? 'light' : 'auto') } const children = theme === 'light' ? ( - 'Light' + t('theme.light', 'Light') ) : theme === 'dark' ? ( - 'Dark' + t('theme.dark', 'Dark') ) : ( <> - Dark - Light (auto) + {t('theme.dark', 'Dark')} + {t('theme.light', 'Light')} ({t('theme.auto', 'auto')}) ) const icon = <> @@ -27,12 +29,9 @@ export default function ThemeIcon(props: { return } - - - diff --git a/web/messages/fr.json b/web/messages/fr.json index 34c937d7..64044133 100644 --- a/web/messages/fr.json +++ b/web/messages/fr.json @@ -2,6 +2,9 @@ "settings.title": "Paramètres", "settings.tabs.general": "Général", "settings.tabs.notifications": "Notifications", + "theme.light": "Clair", + "theme.dark": "Sombre", + "theme.auto": "Automatique", "settings.tabs.about": "À propos", "settings.general.theme": "Thème", "settings.general.language": "Langue", @@ -94,6 +97,15 @@ "about.suggestions.title": "Faire des suggestions ou contribuer", "about.suggestions.text": "Faites des suggestions ou dites-nous que vous voulez aider via ce formulaire !", "about.suggestions.button": "Suggérer ici", + "notifications.heading": "Où voulez-vous être notifié lorsqu'une personne", + "notifications.question.new_match": "... correspond avec vous ?", + "notifications.question.new_message": "... vous envoie un nouveau message ?", + "notifications.question.new_endorsement": "... vous recommande ?", + "notifications.question.tagged_user": "... vous mentionne ?", + "notifications.question.new_search_alerts": "Recevoir les alertes des recherches enregistrées ?", + "notifications.question.opt_out_all": "Se désabonner de toutes les notifications ? (Vous pouvez toujours modifier cela plus tard)", + "notifications.options.email": "Par e‑mail", + "notifications.options.page": "Sur la page des notifications", "about.dev.title": "Développer l'application", "about.dev.text": "Le code source complet et les instructions sont disponibles sur GitHub.", "about.dev.button": "Voir le code", @@ -393,5 +405,10 @@ "help.security.paragraph_suffix": " pour les détails et les moyens de nous contacter.", "help.need_help.title": "Besoin d'aide ?", "help.actions.contact_button": "Nous contacter", - "help.actions.faq_button": "Consulter la FAQ" + "help.actions.faq_button": "Consulter la FAQ", + "messages.title": "Messages", + "messages.seo.description": "Vos messages", + "messages.empty": "Vous n'avez pas encore de messages.", + "messages.more": " de plus", + "messages.you_prefix": "Vous : " } \ No newline at end of file diff --git a/web/pages/messages/index.tsx b/web/pages/messages/index.tsx index a400cefc..9f567ddb 100644 --- a/web/pages/messages/index.tsx +++ b/web/pages/messages/index.tsx @@ -20,26 +20,29 @@ import {MultipleOrSingleAvatars} from 'web/components/multiple-or-single-avatars import {BannedBadge} from 'web/components/widgets/user-link' import {PrivateMessageChannel} from 'common/supabase/private-messages' import {SEO} from "web/components/SEO"; +import {useT} from 'web/lib/locale' export default function MessagesPage() { useRedirectIfSignedOut() const currentUser = useUser() + const t = useT() return ( - {currentUser && } + {currentUser && } ) } export function MessagesContent(props: { currentUser: User }) { const {currentUser} = props + const t = useT() const {channels, memberIdsByChannelId} = useSortedPrivateMessageMemberships( currentUser.id ) @@ -51,13 +54,13 @@ export function MessagesContent(props: { currentUser: User }) { return ( <> - Messages + {t('messages.title', 'Messages')} {channels && channels.length === 0 && (
- You have no messages, yet. + {t('messages.empty', 'You have no messages, yet.')}
)} {channels?.map((channel) => { @@ -93,6 +96,7 @@ export const MessageChannelRow = (props: { const unseen = (messages?.[0]?.createdTimeTs ?? '0') > lastSeenTime const chat = messages?.[0] const numOthers = otherUsers?.length ?? 0 + const t = useT() const isBanned = otherUsers?.length == 1 && otherUsers[0].isBannedFromPosting return ( @@ -118,7 +122,12 @@ export const MessageChannelRow = (props: { .map((user) => user.name.split(' ')[0].trim()) .slice(0, 2) .join(', ')} - {otherUsers.length > 2 && ` & ${otherUsers.length - 2} more`} + {otherUsers.length > 2 && ( + <> + {` & ${otherUsers.length - 2}`} + {t('messages.more', ' more')} + + )} )} {isBanned && } @@ -136,7 +145,7 @@ export const MessageChannelRow = (props: { > {chat && ( <> - {chat.userId == currentUser.id && 'You: '} + {chat.userId == currentUser.id && t('messages.you_prefix', 'You: ')} {parseJsonContentToText(chat.content)} )} diff --git a/web/pages/settings.tsx b/web/pages/settings.tsx index e77e85aa..790d1ef2 100644 --- a/web/pages/settings.tsx +++ b/web/pages/settings.tsx @@ -21,8 +21,6 @@ import {sendPasswordReset} from "web/lib/firebase/password"; import {AboutSettings} from "web/components/about-settings"; import {LanguagePicker} from "web/components/language/language-picker"; import {useT} from "web/lib/locale"; -import {NewBadge} from "web/components/new-badge"; -import {Row} from "web/components/layout/row" export default function NotificationsPage() { const t = useT() @@ -134,15 +132,10 @@ const LoadedGeneralSettings = (props: {

{t('settings.general.theme', 'Theme')}

+

{t('settings.general.language', 'Language')}

- -
- -
-
- -
-
+ +

{t('settings.general.account', 'Account')}

{t('settings.general.email', 'Email')}