Skip to content

Commit

Permalink
Fix Multi-Language Support (reworkd#326)
Browse files Browse the repository at this point in the history
Co-authored-by: Cs4K1Sr4C <[email protected]>
Co-authored-by: Adam Watkins <[email protected]>
  • Loading branch information
3 people authored Apr 23, 2023
1 parent 85adbeb commit 9fb270e
Show file tree
Hide file tree
Showing 42 changed files with 2,100 additions and 116 deletions.
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,9 @@ yarn-error.log*
# typescript
*.tsbuildinfo
.idea
.swc
.swc

# extracted language files
/public/locales/$LOCALES

.eslintcache
31 changes: 31 additions & 0 deletions next-i18next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
module.exports = {
i18n: {
defaultLocale: "en",
locales: [
"en",
"hu",
"fr",
"de",
"it",
"ja",
"zh",
"ko",
"pl",
"pt",
"ro",
"ru",
"uk",
"es",
"nl",
"sk",
"hr",
],
},
localePath: typeof window === "undefined" ? "./public/locales" : "/locales",
debug: false,
reloadOnPrerender: process.env.NODE_ENV === "development",
defaultNS: "translation",
react: {
useSuspense: false,
},
};
7 changes: 3 additions & 4 deletions next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@
*/
!process.env.SKIP_ENV_VALIDATION && (await import("./src/env/server.mjs"));

import nextI18NextConfig from './next-i18next.config.js'

/** @type {import("next").NextConfig} */
const config = {
reactStrictMode: true,
/* If trying out the experimental appDir, comment the i18n config out
* @see https://github.com/vercel/next.js/issues/41980 */
i18n: {
locales: ["en"],
defaultLocale: "en",
},
i18n:nextI18NextConfig.i18n,
webpack: function (config, options) {
config.experiments = { asyncWebAssembly: true, layers: true };
return config;
Expand Down
Loading

0 comments on commit 9fb270e

Please sign in to comment.