Skip to content

Commit 03698dd

Browse files
Merge pull request #127 from zeilenschubser/main.feat.add_i18n
add i18n, but fix the buid
2 parents 27d9e33 + d19e946 commit 03698dd

9 files changed

Lines changed: 796 additions & 6 deletions

File tree

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,12 @@ This app is powered by a robust tech stack:
6363
- Docker
6464
- MongoDB
6565
- Next.js
66+
- bun:test
67+
68+
### test with bun
69+
just run `bun test`, but currently testing only
70+
- i18n integration
71+
6672

6773
## Authors
6874

bun.lock

Lines changed: 777 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bun.lockb

-138 KB
Binary file not shown.
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22

33
import { Construction } from "lucide-react";
44
import {useEffect, useState} from "react";
5+
import { useTranslation } from "react-i18next";
56

6-
const WithSystemCheck = (WrappedComponent) => {
7-
return function WithSystemCheckComponent(props) {
7+
const WithSystemCheck = (WrappedComponent: any) => {
8+
return function WithSystemCheckComponent(props: any) {
89
const [systemStatus, setSystemStatus] = useState('checking');
910
const [loading, setLoading] = useState(true);
11+
const [t, i18n] = useTranslation();
1012

1113
const checkSystemStatus = () => {
1214
setLoading(true);

src/app/components/layout/Footer.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Footer.jsx
1+
"use client";
22

33
import { useTranslation } from "react-i18next";
44

src/app/order/[orderNumber]/page.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
"use client";
2+
13
import { Suspense } from 'react';
24
import ClientOrderPage from './clientOrderPage';
35
import { useTranslation } from 'react-i18next';

src/app/order/thank-you/[orderNumber]/page.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
"use client";
2+
13
import { Suspense } from 'react';
24
import QRCodePage from './qrCodePage';
35
import { useTranslation } from 'react-i18next';

src/config/locales/uwu.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
translation:
2-
lang_emoji: 🥺✨💖👉👈🌟
2+
lang_emoji: 🥺
33
app_title: 💖🍕✨🎀🎉 Get youw smowwest wittle byte of nyummy wummy pizza~!! 👉👈🥺 🍰🍕 So dewicious and adowabwe nyaaa~!! 💖🌸🍭✨🦄
44
loading_menu: ✨🔄💫 Woading Menu... pwease wait cutie~!! 🥺💖🌸
55

src/lib/i18n.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ import i18n, { InitOptions } from 'i18next';
22
import { initReactI18next } from 'react-i18next';
33
import { loadResources } from './i18n.resources';
44

5-
export const resources: Record<string, any> = loadResources((id:string) => {
6-
return require("@/config/locales/${id}.yaml")["default"] || {};
5+
export const resources: Record<string, any> = loadResources((lang:string, ns:string="") => {
6+
debugger;
7+
return require(`@/config/locales/${lang}.yaml`).default || {};
78
});
89

910
export const i18nConfig: InitOptions = {

0 commit comments

Comments
 (0)