Skip to content

Commit 9ebcb53

Browse files
Invite users improvements (#31)
* Translated version of the project settings page * Added messages in different languages * Added dutch support to the app * Smaller condition fix * PR comments * Translations added * PR comments * PR comments * PR comments * PR comments * PR comments * Test * Test * Test * Test * Test * PR comments
1 parent 9ad15c2 commit 9ebcb53

File tree

14 files changed

+312
-63
lines changed

14 files changed

+312
-63
lines changed

i18n/i18n.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import i18n from 'i18next'
2+
import settingsEN from './locales/en/settings.json'
3+
4+
import settingsDE from './locales/de/settings.json'
5+
6+
import settingsNL from './locales/nl/settings.json'
7+
8+
i18n.init({
9+
resources: {
10+
en: {
11+
settings: settingsEN
12+
},
13+
de: {
14+
settings: settingsDE,
15+
},
16+
nl: {
17+
settings: settingsNL,
18+
},
19+
},
20+
ns: ["settings"],
21+
fallbackLng: 'en',
22+
interpolation: {
23+
escapeValue: false // not needed for react as it escapes by default
24+
},
25+
});
26+
27+
export default i18n

i18n/locales/de/settings.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"title": "Kontoeinstellungen",
3+
"heading": "Profilverwaltung und Sicherheitseinstellungen",
4+
"subtitle": "Profileinstellungen",
5+
"changePassword": "Passwort ändern",
6+
"setPassword": "Passwort festlegen",
7+
"backUpCodes": "Verwalten von 2FA-Backup-Wiederherstellungscodes",
8+
"backUpCodesDescription": "Wiederherstellungscodes können in Paniksituationen verwendet werden, wenn Sie den Zugriff auf Ihr 2FA-Gerät verloren haben.",
9+
"totpAuthenticator": "2FA TOTP Authenticator App verwalten",
10+
"addTotpAuthenticator": "Fügen Sie Ihrem Konto eine TOTP-Authentifikator-App hinzu, um die Sicherheit Ihres Kontos zu verbessern.",
11+
"popularAuthenticatorApps": "Beliebte Authenticator-Apps sind",
12+
"and": "und",
13+
"back": "Zurück",
14+
"email": "E-Mail",
15+
"firstName": "Vorname",
16+
"lastName": "Nachname",
17+
"password": "Passwort",
18+
"save": "Speichern"
19+
}

i18n/locales/en/settings.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"title": "Account settings",
3+
"heading": "Profile management and security settings",
4+
"subtitle": "Profile Settings",
5+
"changePassword": "Change Password",
6+
"setPassword": "Set Password",
7+
"backUpCodes": "Manage 2FA backup recovery codes",
8+
"backUpCodesDescription": "Recovery codes can be used in panic situations where you have lost access to your 2FA device.",
9+
"totpAuthenticator": "Manage 2FA TOTP Authenticator App",
10+
"addTotpAuthenticator": "Add a TOTP Authenticator App to your account to improve your account security.",
11+
"popularAuthenticatorApps": "Popular Authenticator Apps are",
12+
"and": "and",
13+
"back": "Back",
14+
"email": "E-Mail",
15+
"firstName": "First Name",
16+
"lastName": "Last Name",
17+
"password": "Password",
18+
"save": "Save"
19+
}

i18n/locales/nl/settings.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"title": "Accountinstellingen",
3+
"heading": "Profielbeheer en beveiligingsinstellingen",
4+
"subtitle": "Profielinstellingen",
5+
"changePassword": "Wachtwoord wijzigen",
6+
"setPassword": "Wachtwoord instellen",
7+
"backUpCodes": "Beheer 2FA-back-upherstelcodes",
8+
"backUpCodesDescription": "Herstelcodes kunnen worden gebruikt in panieksituaties waarin u geen toegang meer hebt tot uw 2FA-apparaat.",
9+
"totpAuthenticator": "Beheer 2FA TOTP Authenticator-app",
10+
"addTotpAuthenticator": "Voeg een TOTP Authenticator-app toe aan uw account om de beveiliging ervan te verbeteren.",
11+
"popularAuthenticatorApps": "Populaire authenticatie-apps zijn",
12+
"and": "En",
13+
"back": "Rug",
14+
"email": "E-mail",
15+
"firstName": "Voornaam",
16+
"lastName": "Achternaam",
17+
"password": "Wachtwoord",
18+
"save": "Redden"
19+
}

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"eslint": "8.38.0",
2626
"eslint-config-next": "13.3.0",
2727
"express": "^4.18.2",
28+
"i18next": "^25.3.2",
2829
"next": "^12.2.0",
2930
"react": "^17.0.2",
3031
"react-dom": "^17.0.2",
@@ -42,4 +43,4 @@
4243
"postcss": "^8.4.23",
4344
"tailwindcss": "^3.4.4"
4445
}
45-
}
46+
}

pages/_app.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
import i18n from "@/i18n/i18n";
12
import "../styles/tailwind.css"
23
import '@/submodules/tailwind-config/global.css';
34
import { theme, globalStyles, ThemeProps } from "@ory/themes"
45
import type { AppProps } from "next/app"
56
import Head from "next/head"
7+
import { I18nextProvider } from "react-i18next";
68
import { ToastContainer } from "react-toastify"
79
import "react-toastify/dist/ReactToastify.css"
810
import { ThemeProvider } from "styled-components"
@@ -14,7 +16,7 @@ const GlobalStyle = createGlobalStyle((props: ThemeProps) =>
1416

1517
function MyApp({ Component, pageProps }: AppProps) {
1618
return (
17-
<>
19+
<I18nextProvider i18n={i18n}>
1820
<Head>
1921
<title>kern</title>
2022
<link rel="icon" type="image/x-icon"
@@ -27,7 +29,7 @@ function MyApp({ Component, pageProps }: AppProps) {
2729
<ToastContainer />
2830
</ThemeProvider>
2931
</div>
30-
</>
32+
</I18nextProvider>
3133

3234
)
3335
}

0 commit comments

Comments
 (0)