Skip to content

Commit 0f16955

Browse files
authored
Merge pull request #14178 from ethereum/fix-i18n
Fix i18n in revalidated paths in Netlify
2 parents 1ce671b + b759fa7 commit 0f16955

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

next-i18next.config.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/* eslint-disable @typescript-eslint/no-var-requires */
2+
const path = require("path")
13
const i18nConfig = require("./i18n.config.json")
24

35
const BUILD_LOCALES = process.env.BUILD_LOCALES
@@ -17,7 +19,8 @@ module.exports = {
1719
localeDetection: false,
1820
},
1921
// define custom location for intl files, otherwise default to public/locales (https://github.com/i18next/next-i18next#2-translation-content)
20-
localePath: "./src/intl",
22+
// use path.resolve to work with Netlify (https://github.com/i18next/next-i18next/issues/1552#issuecomment-1538452722)
23+
localePath: path.resolve("./src/intl"),
2124
// see updates to your translation JSON files without having to restart your development server each time
2225
reloadOnPrerender: true,
2326
// Language codes to lookup, given set language is 'en-US': 'all' --> ['en-US', 'en', 'dev'], 'currentOnly' --> 'en-US', 'languageOnly' --> 'en'

0 commit comments

Comments
 (0)