teable/packages/common-i18n
Pengap 79658b58d5
feat: move to pnpm (#202)
* 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>
2023-10-18 12:20:19 +08:00
..
src feat: field context ssr demo 2023-02-28 23:36:39 +08:00
.eslintrc.cjs feat: move to pnpm (#202) 2023-10-18 12:20:19 +08:00
.gitignore chore: initialize project 2022-11-01 17:36:07 +08:00
CHANGELOG.md chore: change project links details 2022-11-01 18:06:18 +08:00
lint-staged.config.js ci: enable continuous integration (#88) 2023-07-14 18:58:08 +08:00
package.json feat: move to pnpm (#202) 2023-10-18 12:20:19 +08:00
README.md chore: change project links details 2022-11-01 18:06:18 +08:00
tsconfig.json chore: initialize project 2022-11-01 17:36:07 +08:00

@teable-group/common-i18n

build

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;
  }
}