-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add internationalization and replace all hardcoded labels with i18n e…
…ntries (#215) * adding i18next * fixing name spaces * fixing pnpm lock file * fixing bun
- Loading branch information
Showing
47 changed files
with
981 additions
and
491 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import "i18next" | ||
import resources from "./resources" | ||
const { ns1, ns2 } = resources | ||
|
||
declare module "i18next" { | ||
interface CustomTypeOptions { | ||
defaultNS: "ns1" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import ns1 from "../i18n/locales/en/en.json" | ||
import ns2 from "../i18n/locales/tr/tr.json" | ||
|
||
const resources = { | ||
ns1, | ||
ns2, | ||
} as const | ||
|
||
export default resources |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import i18next from "i18next" | ||
import LanguageDetector from "i18next-browser-languagedetector" | ||
import { initReactI18next } from "react-i18next" | ||
import ns1 from "./locales/en/en.json" | ||
import ns2 from "./locales/tr/tr.json" | ||
|
||
const defaultNS = "ns1" | ||
|
||
const resources = { | ||
en: { | ||
ns1, | ||
}, | ||
tr: { | ||
ns2, | ||
}, | ||
} | ||
|
||
i18next | ||
.use(LanguageDetector) | ||
.use(initReactI18next) | ||
.init({ | ||
debug: false, | ||
fallbackLng: ["en", "tr"], | ||
resources: resources, | ||
defaultNS, | ||
}) |
Oops, something went wrong.