4fcaabe563
closes https://github.com/TryGhost/Team/issues/3307 This commit includes several important updates to add internationalisation (i18n) support within the signup form package: - Modified the translate script in `package.json` to include translations for the signup form. - Added a new test for the signup form resources in `i18n.test.js`. - Updated `tsconfig.json` to allow synthetic default imports. - Made updates to `package.json`, including adding a prebuild command for `@tryghost/i18n` to ensure typescript declaration files get built. - added `vite-plugin-commonjs` so we can bundle commonjs packages to be useable by the browser. - In `App.tsx`, imported the `i18n` library and created an `i18n` instance for the `signup-form` namespace. This `i18n` instance's `t` function was added to the application context. - Updated the `AppContextType` in `AppContext.ts` to include the `t` function from i18n Co-authored-by: Daniel Lockyer <hi@daniellockyer.com>
38 lines
1.3 KiB
JSON
38 lines
1.3 KiB
JSON
{
|
|
"name": "@tryghost/i18n",
|
|
"version": "0.0.0",
|
|
"repository": "https://github.com/TryGhost/Ghost/tree/main/ghost/i18n",
|
|
"author": "Ghost Foundation",
|
|
"private": true,
|
|
"main": "index.js",
|
|
"types": "./build/i18n.d.ts",
|
|
"scripts": {
|
|
"dev": "echo \"Implement me!\"",
|
|
"build": "tsc",
|
|
"test:unit:base": "NODE_ENV=testing c8 --include index.js --include lib --check-coverage --100 --reporter text --reporter cobertura mocha './test/**/*.test.js'",
|
|
"test:unit": "yarn test:unit:base && yarn translate",
|
|
"test": "yarn test:unit",
|
|
"lint:code": "eslint *.js lib/ --ext .js --cache",
|
|
"lint": "yarn lint:code && yarn lint:test",
|
|
"lint:test": "eslint -c test/.eslintrc.js test/ --ext .js --cache",
|
|
"translate": "yarn translate:ghost && yarn translate:portal && yarn translate:signup-form && node generate-context.js",
|
|
"translate:ghost": "NAMESPACE=ghost i18next '../core/core/{frontend,server,shared}/**/*.{js,jsx}'",
|
|
"translate:portal": "NAMESPACE=portal i18next '../portal/src/**/*.{js,jsx}'",
|
|
"translate:signup-form": "NAMESPACE=signup-form i18next '../signup-form/src/**/*.{ts,tsx}'"
|
|
},
|
|
"files": [
|
|
"index.js",
|
|
"lib",
|
|
"locales"
|
|
],
|
|
"devDependencies": {
|
|
"c8": "7.13.0",
|
|
"i18next-parser": "8.0.0",
|
|
"mocha": "10.2.0",
|
|
"typescript": "5.1.3"
|
|
},
|
|
"dependencies": {
|
|
"i18next": "22.5.0"
|
|
}
|
|
}
|