Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DEV-61: Add internationalization support #6

Merged
merged 4 commits into from
Mar 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
# misc
.DS_Store
*.pem
/.vscode/

# debug
npm-debug.log*
Expand Down
5 changes: 5 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ const eslintConfig = [
quotes: "double",
semi: true,
}),
{
rules: {
"react/jsx-no-literals": "error",
},
},
{
ignores: ["build/"],
},
Expand Down
15 changes: 15 additions & 0 deletions locales/en.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"constructionPage": {
"title": "Pera by LexisLabs",
"subtitle": "We're building something special. Coming soon.",
"contactButton": "Contact us"
},
"sentryExamplePage": {
"getStarted": "Get started by sending us a sample error:",
"throwError": "Throw error!",
"nextLook": "Next, look for the error on the",
"issuesPage": "Issues Page",
"forMoreInfo": "For more information, see",
"theDocumentation": "the documentation"
}
}
15 changes: 15 additions & 0 deletions locales/es.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"constructionPage": {
"contactButton": "Contáctenos",
"subtitle": "Estamos construyendo algo especial. Muy pronto.",
"title": "Pera por LexisLabs"
},
"sentryExamplePage": {
"forMoreInfo": "Para más información, ver",
"getStarted": "Comience enviándonos un error de muestra:",
"issuesPage": "Página de emisión",
"nextLook": "A continuación, busque el error en el",
"theDocumentation": "la documentación",
"throwError": "¡Error!"
}
}
15 changes: 15 additions & 0 deletions locales/fr.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"constructionPage": {
"contactButton": "Contactez-nous",
"subtitle": "Nous construisons quelque chose de spécial. À venir.",
"title": "Pera par LexisLabs"
},
"sentryExamplePage": {
"forMoreInfo": "Pour en savoir plus, voir",
"getStarted": "Commencez par nous envoyer un exemple d'erreur:",
"issuesPage": "la Page des Problèmes",
"nextLook": "Ensuite, recherchez l'erreur sur",
"theDocumentation": "la documentation",
"throwError": "Lancer une erreur!"
}
}
15 changes: 15 additions & 0 deletions locales/ru.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"constructionPage": {
"contactButton": "Связаться с нами",
"subtitle": "Мы строим что -то особенное. Вскоре.",
"title": "Pera от LexisLabs"
},
"sentryExamplePage": {
"forMoreInfo": "Для получения дополнительной информации см.",
"getStarted": "Начните, отправив нам образец ошибки:",
"issuesPage": "Проблемы страницы",
"nextLook": "Далее ищите ошибку на",
"theDocumentation": "документация",
"throwError": "Бросить ошибку!"
}
}
15 changes: 15 additions & 0 deletions locales/zh.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"constructionPage": {
"contactButton": "联系我们",
"subtitle": "我们正在建造一些特别的东西。即将推出。",
"title": "LexisLabs 的 Pera"
},
"sentryExamplePage": {
"forMoreInfo": "有关更多信息,请参阅",
"getStarted": "通过向我们发送示例错误开始开始:",
"issuesPage": "问题页",
"nextLook": "接下来,在",
"theDocumentation": "文档",
"throwError": "投掷错误!"
}
}
5 changes: 4 additions & 1 deletion next.config.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
import { withSentryConfig } from "@sentry/nextjs";
import type { NextConfig } from "next";
import createNextIntlPlugin from "next-intl/plugin";

const withNextIntl = createNextIntlPlugin();

const nextConfig: NextConfig = {
output: "standalone",
distDir: "build",
};

export default withSentryConfig(nextConfig, {
export default withSentryConfig(withNextIntl(nextConfig), {
// For all available options, see:
// https://www.npmjs.com/package/@sentry/webpack-plugin#options

Expand Down
111 changes: 111 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"@mui/material": "^6.4.6",
"@sentry/nextjs": "^9.3.0",
"next": "15.1.6",
"next-intl": "^3.26.5",
"react": "^19.0.0",
"react-dom": "^19.0.0"
},
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
17 changes: 12 additions & 5 deletions app/layout.tsx → src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import type { Metadata } from "next";
import { Geist, Geist_Mono } from "next/font/google";
import "./globals.css";
import { NextIntlClientProvider } from "next-intl";
import { getLocale, getMessages } from "next-intl/server";

const geistSans = Geist({
variable: "--font-geist-sans",
Expand All @@ -13,19 +15,24 @@ const geistMono = Geist_Mono({
});

export const metadata: Metadata = {
title: "Create Next App",
description: "Generated by create next app",
title: "Pera by Lexis Labs",
description: "AI-powered pronunciation training platform",
};

export default function RootLayout({
export default async function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
const locale = await getLocale();
const messages = await getMessages();

return (
<html lang="en">
<html lang={locale}>
<body className={`${geistSans.variable} ${geistMono.variable}`}>
{children}
<NextIntlClientProvider messages={messages}>
{children}
</NextIntlClientProvider>
</body>
</html>
);
Expand Down
File renamed without changes.
8 changes: 5 additions & 3 deletions app/page.tsx → src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
} from "@mui/material";
import { styled } from "@mui/material/styles";
import { Construction } from "@mui/icons-material";
import { useTranslations } from "next-intl";

const StyledHero = styled(Box)(() => ({
minHeight: "100vh",
Expand All @@ -18,6 +19,7 @@ const StyledHero = styled(Box)(() => ({
}));

export default function Home() {
const t = useTranslations("constructionPage");
return (
<StyledHero>
<Container>
Expand All @@ -31,10 +33,10 @@ export default function Home() {
>
<Construction sx={{ fontSize: 60 }} />
<Typography variant="h2" fontWeight="bold">
Pera by LexisLabs
{t("title")}
</Typography>
<Typography variant="h5">
We&apos;re building something special. Coming soon.
{t("subtitle")}
</Typography>
<Button
variant="contained"
Expand All @@ -48,7 +50,7 @@ export default function Home() {
},
}}
>
Contact Us
{t("contactButton")}
</Button>
</Box>
</Container>
Expand Down
Loading
Loading