mirror of
https://github.com/teableio/teable
synced 2024-11-22 07:13:32 +00:00
79658b58d5
* feat: yarn move pnpm * fix: docker build * fix: pnpm docker build * feat: upgrade eslint related * chore: upgrade depend * fix: pnpm-install action * feat: make integration test * feat: jest config * revert: tsconfig.jest.json * fix: eslintrc and typecheck --------- Co-authored-by: pengap <penganpingprivte@gmail.com> |
||
---|---|---|
.. | ||
src | ||
.eslintrc.cjs | ||
.gitignore | ||
CHANGELOG.md | ||
lint-staged.config.js | ||
package.json | ||
README.md | ||
tsconfig.json |
@teable-group/common-i18n
Intro
One possible way to share locales amongst apps in the monorepo.
Usage
Add the workspace dependency to the consuming app or package.
yarn add @teable-group/common-locales:"workspace:^"
Add an alias in tsconfig.js to enable fast-refresh.
{
"compilerOptions": {
"paths": {
"@teable-group/common-i18n": ["../../../packages/common-i18n/src/index"],
"@teable-group/common-i18n/locales/*": [
"../../../packages/common-i18n/src/locales/*",
],
},
},
}
Optionally create a file named ./types.d/react-i18next.d.ts
to enable typechecks and autocompletion of keys.
import "react-i18next";
import type { I18nNamespaces } from "@teable-group/common-i18n";
declare module "react-i18next" {
interface CustomTypeOptions {
defaultNS: "common";
resources: I18nNamespaces;
}
}