Skip to content

Commit e273918

Browse files
committed
Change translations file location
1 parent bed27f6 commit e273918

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

packages/react-scripts/config/locales.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ const paths = require('./paths');
77
const DEFAULT_LOCALE = 'en-gb';
88
const LOCALE_DIR = paths.appIntl;
99

10+
const ignoreFiles = ['base', 'README'];
11+
1012
// By looking at our `i18n` we can get an idea of which languages and locales we need to be
1113
// concerned with. As we add translations for different languages we'll automatically have
1214
// the right data to help with whitelisting those languages/locales in npm modules.
@@ -22,7 +24,10 @@ if (!LOCALE_DIR) {
2224

2325
const locales = [
2426
DEFAULT_LOCALE,
25-
...fs.readdirSync(LOCALE_DIR).map(f => path.basename(f, path.extname(f))), // fr-ca.json -> fr-ca
27+
...fs
28+
.readdirSync(LOCALE_DIR)
29+
.map(f => path.basename(f, path.extname(f))) // fr-ca.json -> fr-ca
30+
.filter(locale => !ignoreFiles.includes(locale)),
2631
];
2732

2833
module.exports = {

packages/react-scripts/config/paths.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ module.exports = {
5858
appPackageJson: resolveApp('package.json'),
5959
appSrc: resolveApp('src'),
6060
appEnv: resolveApp('env'),
61-
appIntl: resolveApp('src/core/i18n'),
61+
appIntl: resolveApp('src/core/i18n/translations'),
6262
yarnLockFile: resolveApp('yarn.lock'),
6363
testsSetup: resolveApp('src/setupTests.js'),
6464
appNodeModules: resolveApp('node_modules'),
@@ -82,7 +82,7 @@ module.exports = {
8282
appPackageJson: resolveApp('package.json'),
8383
appSrc: resolveApp('src'),
8484
appEnv: resolveApp('env'),
85-
appIntl: resolveApp('src/core/i18n'),
85+
appIntl: resolveApp('src/core/i18n/translations'),
8686
yarnLockFile: resolveApp('yarn.lock'),
8787
testsSetup: resolveApp('src/setupTests.js'),
8888
appNodeModules: resolveApp('node_modules'),
@@ -116,7 +116,7 @@ if (
116116
),
117117
appPackageJson: resolveOwn('package.json'),
118118
appSrc: resolveOwn('template/src'),
119-
appIntl: resolveOwn('template/src/core/i18n'),
119+
appIntl: resolveOwn('template/src/core/i18n/translations'),
120120
yarnLockFile: resolveOwn('template/yarn.lock'),
121121
testsSetup: resolveOwn('template/src/setupTests.js'),
122122
appNodeModules: resolveOwn('node_modules'),

0 commit comments

Comments
 (0)