create-forgeon 0.1.12 → 0.1.13
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
|
@@ -145,7 +145,7 @@ describe('addModule', () => {
|
|
|
145
145
|
|
|
146
146
|
const i18nTs = fs.readFileSync(path.join(projectRoot, 'apps', 'web', 'src', 'i18n.ts'), 'utf8');
|
|
147
147
|
assert.match(i18nTs, /initReactI18next/);
|
|
148
|
-
assert.match(i18nTs,
|
|
148
|
+
assert.match(i18nTs, /\.\.\/\.\.\/\.\.\/\.\.\/resources\/i18n\/en\/common\.json/);
|
|
149
149
|
|
|
150
150
|
const rootPackage = fs.readFileSync(path.join(projectRoot, 'package.json'), 'utf8');
|
|
151
151
|
assert.match(rootPackage, /"i18n:check"/);
|
|
@@ -163,6 +163,7 @@ describe('addModule', () => {
|
|
|
163
163
|
caddyDockerfile,
|
|
164
164
|
/COPY packages\/i18n-web\/package\.json packages\/i18n-web\/package\.json/,
|
|
165
165
|
);
|
|
166
|
+
assert.match(caddyDockerfile, /COPY resources resources/);
|
|
166
167
|
} finally {
|
|
167
168
|
fs.rmSync(targetRoot, { recursive: true, force: true });
|
|
168
169
|
}
|
package/src/modules/i18n.mjs
CHANGED
|
@@ -166,6 +166,11 @@ function patchProxyDockerfile(filePath) {
|
|
|
166
166
|
'COPY packages/i18n-contracts packages/i18n-contracts',
|
|
167
167
|
'COPY packages/i18n-web packages/i18n-web',
|
|
168
168
|
);
|
|
169
|
+
content = ensureLineAfter(
|
|
170
|
+
content,
|
|
171
|
+
'COPY packages/i18n-web packages/i18n-web',
|
|
172
|
+
'COPY resources resources',
|
|
173
|
+
);
|
|
169
174
|
|
|
170
175
|
fs.writeFileSync(filePath, `${content.trimEnd()}\n`, 'utf8');
|
|
171
176
|
}
|
package/src/presets/i18n.mjs
CHANGED
|
@@ -58,7 +58,8 @@ export function applyI18nDisabled(targetRoot) {
|
|
|
58
58
|
)
|
|
59
59
|
.replace(/^COPY packages\/i18n-web\/package\.json packages\/i18n-web\/package\.json\r?\n/gm, '')
|
|
60
60
|
.replace(/^COPY packages\/i18n-contracts packages\/i18n-contracts\r?\n/gm, '')
|
|
61
|
-
.replace(/^COPY packages\/i18n-web packages\/i18n-web\r?\n/gm, '')
|
|
61
|
+
.replace(/^COPY packages\/i18n-web packages\/i18n-web\r?\n/gm, '')
|
|
62
|
+
.replace(/^COPY resources resources\r?\n/gm, '');
|
|
62
63
|
|
|
63
64
|
fs.writeFileSync(dockerfilePath, content, 'utf8');
|
|
64
65
|
}
|
|
@@ -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: {
|