Skip to content

Commit

Permalink
fix(locale): locale not found (#46)
Browse files Browse the repository at this point in the history
* fix(locale): locale not found and favicon 500 error

* add missing translations
  • Loading branch information
Clement-Muth authored Oct 25, 2024
1 parent 8be6e80 commit 29df358
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 4 deletions.
Binary file added src/app/favicon.ico
Binary file not shown.
2 changes: 1 addition & 1 deletion src/applications/Profile/Ui/Settings/DeleteAccount.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export const SettingsDeleteAccount = () => {
title: <Trans>I understand, delete my account</Trans>,
fullWidth: true,
color: "danger",
isDisabled: !form.watch("confirm")?.match("delete my account")
isDisabled: !form.watch("confirm")?.match(t(i18n)`delete my account`)
},
wrapper: ModalFooter,
wrapperProps: { className: "justify-end border-t border-t-default -px-4" }
Expand Down
2 changes: 1 addition & 1 deletion src/applications/Profile/Ui/Settings/DisplayName.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ interface SettingsDisplayNameProps {
}

export const SettingsDisplayName = ({ defaultValue }: SettingsDisplayNameProps) => {
const form = useForm<{ fullname: string }>();
const form = useForm<{ fullname: string }>(undefined, { defaultValues: { fullname: defaultValue } });
const { i18n } = useLingui();
const notify = () =>
toast(<Trans>Fullname updated</Trans>, {
Expand Down
2 changes: 1 addition & 1 deletion src/applications/Profile/Ui/Settings/PhoneNumber.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ interface SettingsPhoneNumberProps {
}

export const SettingsPhoneNumber = ({ defaultValue }: SettingsPhoneNumberProps) => {
const form = useForm<{ phone: string }>();
const form = useForm<{ phone: string }>(undefined, { defaultValues: { phone: defaultValue } });
const { i18n } = useLingui();
const notify = () =>
toast(<Trans>Phone number updated</Trans>, {
Expand Down
7 changes: 6 additions & 1 deletion src/components/Toast/Toast.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
"use client";

import dynamic from "next/dynamic";
import { Bounce, ToastContainer } from "react-toastify";
import { useTheme } from "~/hooks/useTheme";

export const Toast = () => {
const ToastComponent = () => {
const { activeTheme } = useTheme();

return (
Expand All @@ -25,3 +26,7 @@ export const Toast = () => {
/>
);
};

export const Toast = dynamic(() => Promise.resolve(ToastComponent), {
ssr: false
});
3 changes: 3 additions & 0 deletions src/translations/messages/en.po
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ msgstr "Dark"
msgid "Delete Account"
msgstr "Delete Account"

#: src/applications/Profile/Ui/Settings/DeleteAccount.tsx
#: src/applications/Profile/Ui/Settings/DeleteAccount.tsx
msgid "delete my account"
msgstr "delete my account"
Expand Down Expand Up @@ -131,10 +132,12 @@ msgid "Please enter your full name, or a display name you are comfortable with."
msgstr "Please enter your full name, or a display name you are comfortable with."

#: src/applications/Profile/Ui/Settings/DisplayName.tsx
#: src/applications/Profile/Ui/Settings/PhoneNumber.tsx
msgid "Please use 32 characters at maximum."
msgstr "Please use 32 characters at maximum."

#: src/applications/Profile/Ui/Settings/DisplayName.tsx
#: src/applications/Profile/Ui/Settings/PhoneNumber.tsx
msgid "Save"
msgstr "Save"

Expand Down
3 changes: 3 additions & 0 deletions src/translations/messages/fr.po
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ msgstr "Sombre"
msgid "Delete Account"
msgstr "Supprimer mon compte"

#: src/applications/Profile/Ui/Settings/DeleteAccount.tsx
#: src/applications/Profile/Ui/Settings/DeleteAccount.tsx
msgid "delete my account"
msgstr "supprimer mon compte"
Expand Down Expand Up @@ -131,10 +132,12 @@ msgid "Please enter your full name, or a display name you are comfortable with."
msgstr "Veuillez entrer votre nom complet, ou un nom d'affichage avec lequel vous êtes à l'aise"

#: src/applications/Profile/Ui/Settings/DisplayName.tsx
#: src/applications/Profile/Ui/Settings/PhoneNumber.tsx
msgid "Please use 32 characters at maximum."
msgstr "Veuillez utiliser 32 caractères maximum."

#: src/applications/Profile/Ui/Settings/DisplayName.tsx
#: src/applications/Profile/Ui/Settings/PhoneNumber.tsx
msgid "Save"
msgstr "Sauvegarder"

Expand Down

0 comments on commit 29df358

Please sign in to comment.