create-forgeon 0.1.13 → 0.1.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -113,12 +113,24 @@ describe('addModule', () => {
|
|
|
113
113
|
);
|
|
114
114
|
assert.match(i18nWebPackage, /"type": "module"/);
|
|
115
115
|
|
|
116
|
+
const i18nContractsPackage = fs.readFileSync(
|
|
117
|
+
path.join(projectRoot, 'packages', 'i18n-contracts', 'package.json'),
|
|
118
|
+
'utf8',
|
|
119
|
+
);
|
|
120
|
+
assert.match(i18nContractsPackage, /"type": "module"/);
|
|
121
|
+
|
|
116
122
|
const i18nWebTsconfig = fs.readFileSync(
|
|
117
123
|
path.join(projectRoot, 'packages', 'i18n-web', 'tsconfig.json'),
|
|
118
124
|
'utf8',
|
|
119
125
|
);
|
|
120
126
|
assert.match(i18nWebTsconfig, /"module": "ESNext"/);
|
|
121
127
|
|
|
128
|
+
const i18nContractsTsconfig = fs.readFileSync(
|
|
129
|
+
path.join(projectRoot, 'packages', 'i18n-contracts', 'tsconfig.json'),
|
|
130
|
+
'utf8',
|
|
131
|
+
);
|
|
132
|
+
assert.match(i18nContractsTsconfig, /"module": "ESNext"/);
|
|
133
|
+
|
|
122
134
|
const i18nWebSource = fs.readFileSync(
|
|
123
135
|
path.join(projectRoot, 'packages', 'i18n-web', 'src', 'index.ts'),
|
|
124
136
|
'utf8',
|
|
@@ -145,7 +157,7 @@ describe('addModule', () => {
|
|
|
145
157
|
|
|
146
158
|
const i18nTs = fs.readFileSync(path.join(projectRoot, 'apps', 'web', 'src', 'i18n.ts'), 'utf8');
|
|
147
159
|
assert.match(i18nTs, /initReactI18next/);
|
|
148
|
-
assert.match(i18nTs,
|
|
160
|
+
assert.match(i18nTs, /\.\.\/\.\.\/\.\.\/resources\/i18n\/en\/common\.json/);
|
|
149
161
|
|
|
150
162
|
const rootPackage = fs.readFileSync(path.join(projectRoot, 'package.json'), 'utf8');
|
|
151
163
|
assert.match(rootPackage, /"i18n:check"/);
|
|
@@ -2,12 +2,12 @@ import i18n from 'i18next';
|
|
|
2
2
|
import { initReactI18next } from 'react-i18next';
|
|
3
3
|
import { I18N_DEFAULT_LANG } from '@forgeon/i18n-contracts';
|
|
4
4
|
import { getInitialLocale } from '@forgeon/i18n-web';
|
|
5
|
-
import enCommon from '
|
|
6
|
-
import enErrors from '
|
|
7
|
-
import enValidation from '
|
|
8
|
-
import ukCommon from '
|
|
9
|
-
import ukErrors from '
|
|
10
|
-
import ukValidation from '
|
|
5
|
+
import enCommon from '../../../resources/i18n/en/common.json';
|
|
6
|
+
import enErrors from '../../../resources/i18n/en/errors.json';
|
|
7
|
+
import enValidation from '../../../resources/i18n/en/validation.json';
|
|
8
|
+
import ukCommon from '../../../resources/i18n/uk/common.json';
|
|
9
|
+
import ukErrors from '../../../resources/i18n/uk/errors.json';
|
|
10
|
+
import ukValidation from '../../../resources/i18n/uk/validation.json';
|
|
11
11
|
|
|
12
12
|
const resources = {
|
|
13
13
|
en: {
|