Skip to content

Commit 82d0048

Browse files
authored
Merge pull request #54 from anr2601/main
i18n Support(react-i18next library)
2 parents 807ea0d + d0070e2 commit 82d0048

File tree

16 files changed

+465
-19
lines changed

16 files changed

+465
-19
lines changed

package-lock.json

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

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,15 @@
2323
"@typescript-eslint/eslint-plugin": "^5.60.1",
2424
"@vitejs/plugin-react": "^4.2.1",
2525
"file-saver": "^2.0.5",
26+
"i18next-browser-languagedetector": "^8.0.0",
27+
"i18next-http-backend": "^2.6.1",
2628
"jszip": "^3.10.1",
2729
"lucide-react": "^0.376.0",
2830
"prop-types": "^15.8.1",
2931
"react": "^18.2.0",
3032
"react-chatbotify": "^2.0.0-beta.3",
3133
"react-dom": "^18.2.0",
34+
"react-i18next": "^15.0.1",
3235
"react-loading-skeleton": "^3.4.0",
3336
"react-router-dom": "^6.2.2",
3437
"uuid": "^9.0.1",

src/components/NavigationBar/AppThemeToggle.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
11
import { useAppTheme } from "../../context/AppThemeContext";
2+
import { useTranslation } from "react-i18next";
3+
24

35
const AppThemeToggle = () => {
46
// context for handling app theme
57
const { appTheme, toggleAppTheme } = useAppTheme()
68

9+
const {t} = useTranslation();
10+
711
const handleClick = () => {
812
toggleAppTheme()
913
}
1014

1115
console.log(appTheme)
1216

1317
return <div>
14-
<button onClick={handleClick}>{appTheme}</button>
18+
<button onClick={handleClick}>${appTheme}</button>
1519
</div>
1620
}
1721

0 commit comments

Comments
 (0)