From afd4ef5ab747d097ff68037172ac4e2dca3d0b3e Mon Sep 17 00:00:00 2001 From: Qs-F Date: Fri, 20 Dec 2024 18:35:59 +0900 Subject: [PATCH 01/11] chore: install react-intl --- packages/smarthr-ui/package.json | 2 + pnpm-lock.yaml | 95 ++++++++++++++++++++++++++++++++ 2 files changed, 97 insertions(+) diff --git a/packages/smarthr-ui/package.json b/packages/smarthr-ui/package.json index 4f2da50e34..8902cf060a 100644 --- a/packages/smarthr-ui/package.json +++ b/packages/smarthr-ui/package.json @@ -74,6 +74,7 @@ "react-docgen-typescript": "^2.2.2", "react-dom": "^19.0.0", "react-ga4": "^2.1.0", + "react-intl": "^7.0.4", "react-test-renderer": "^19.0.0", "rimraf": "^6.0.1", "standard-version": "^9.3.2", @@ -91,6 +92,7 @@ "peerDependencies": { "react": "^18.0.0 || ^19.0.0", "react-dom": "^18.0.0 || ^19.0.0", + "react-intl": "^7.0.4", "styled-components": "^5.0.1" }, "bugs": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6ae78adede..8568c63264 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -278,6 +278,9 @@ importers: react-ga4: specifier: ^2.1.0 version: 2.1.0 + react-intl: + specifier: ^7.0.4 + version: 7.0.4(react@19.0.0)(typescript@5.7.2) react-test-renderer: specifier: ^19.0.0 version: 19.0.0(react@19.0.0) @@ -1274,6 +1277,29 @@ packages: resolution: {integrity: sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + '@formatjs/ecma402-abstract@2.3.1': + resolution: {integrity: sha512-Ip9uV+/MpLXWRk03U/GzeJMuPeOXpJBSB5V1tjA6kJhvqssye5J5LoYLc7Z5IAHb7nR62sRoguzrFiVCP/hnzw==} + + '@formatjs/fast-memoize@2.2.5': + resolution: {integrity: sha512-6PoewUMrrcqxSoBXAOJDiW1m+AmkrAj0RiXnOMD59GRaswjXhm3MDhgepXPBgonc09oSirAJTsAggzAGQf6A6g==} + + '@formatjs/icu-messageformat-parser@2.9.7': + resolution: {integrity: sha512-cuEHyRM5VqLQobANOjtjlgU7+qmk9Q3fDQuBiRRJ3+Wp3ZoZhpUPtUfuimZXsir6SaI2TaAJ+SLo9vLnV5QcbA==} + + '@formatjs/icu-skeleton-parser@1.8.11': + resolution: {integrity: sha512-8LlHHE/yL/zVJZHAX3pbKaCjZKmBIO6aJY1mkVh4RMSEu/2WRZ4Ysvv3kKXJ9M8RJLBHdnk1/dUQFdod1Dt7Dw==} + + '@formatjs/intl-localematcher@0.5.9': + resolution: {integrity: sha512-8zkGu/sv5euxbjfZ/xmklqLyDGQSxsLqg8XOq88JW3cmJtzhCP8EtSJXlaKZnVO4beEaoiT9wj4eIoCQ9smwxA==} + + '@formatjs/intl@3.0.4': + resolution: {integrity: sha512-pnetak6R7Xp/ET96O5kx9zRYoQQqr6sbRXWkJHKw0Hr/jr3ls4CddZKq+suwCDuW6p/ior2BhpOSh/WLLcJM6w==} + peerDependencies: + typescript: '5' + peerDependenciesMeta: + typescript: + optional: true + '@hapi/hoek@9.3.0': resolution: {integrity: sha512-/c6rf4UJlmHlC9b5BaNvzAcFv7HZ2QHaV0D4/HNlBdvFnvQq8RI4kYdhyPCl7Xj+oWvTWQ8ujhqS53LIgAe6KQ==} @@ -4177,6 +4203,9 @@ packages: resolution: {integrity: sha512-6xwYfHbajpoF0xLW+iwLkhwgvLoZDfjYfoFNu8ftMoXINzwuymNLd9u/KmwtdT2GbR+/Cz66otEGEVVUHX9QLQ==} engines: {node: '>=10.13.0'} + intl-messageformat@10.7.10: + resolution: {integrity: sha512-hp7iejCBiJdW3zmOe18FdlJu8U/JsADSDiBPQhfdSeI8B9POtvPRvPh3nMlvhYayGMKLv6maldhR7y3Pf1vkpw==} + is-absolute@1.0.0: resolution: {integrity: sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA==} engines: {node: '>=0.10.0'} @@ -5792,6 +5821,15 @@ packages: '@types/react': ^18.3.17 react: ^19.0.0 + react-intl@7.0.4: + resolution: {integrity: sha512-WGNfCPNcRQhNAZBN+amz2hfR8Kd7jngScJ4WaRZcsaOWsvva1ciStnUIGj9MvOAxPqTf1D78J5OdRdc3l0wgKQ==} + peerDependencies: + react: ^19.0.0 + typescript: '5' + peerDependenciesMeta: + typescript: + optional: true + react-is@16.13.1: resolution: {integrity: sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==} @@ -8144,6 +8182,42 @@ snapshots: '@eslint/js@8.57.0': {} + '@formatjs/ecma402-abstract@2.3.1': + dependencies: + '@formatjs/fast-memoize': 2.2.5 + '@formatjs/intl-localematcher': 0.5.9 + decimal.js: 10.4.3 + tslib: 2.6.2 + + '@formatjs/fast-memoize@2.2.5': + dependencies: + tslib: 2.6.2 + + '@formatjs/icu-messageformat-parser@2.9.7': + dependencies: + '@formatjs/ecma402-abstract': 2.3.1 + '@formatjs/icu-skeleton-parser': 1.8.11 + tslib: 2.6.2 + + '@formatjs/icu-skeleton-parser@1.8.11': + dependencies: + '@formatjs/ecma402-abstract': 2.3.1 + tslib: 2.6.2 + + '@formatjs/intl-localematcher@0.5.9': + dependencies: + tslib: 2.6.2 + + '@formatjs/intl@3.0.4(typescript@5.7.2)': + dependencies: + '@formatjs/ecma402-abstract': 2.3.1 + '@formatjs/fast-memoize': 2.2.5 + '@formatjs/icu-messageformat-parser': 2.9.7 + intl-messageformat: 10.7.10 + tslib: 2.6.2 + optionalDependencies: + typescript: 5.7.2 + '@hapi/hoek@9.3.0': {} '@hapi/topo@5.1.0': @@ -11672,6 +11746,13 @@ snapshots: interpret@3.1.1: {} + intl-messageformat@10.7.10: + dependencies: + '@formatjs/ecma402-abstract': 2.3.1 + '@formatjs/fast-memoize': 2.2.5 + '@formatjs/icu-messageformat-parser': 2.9.7 + tslib: 2.6.2 + is-absolute@1.0.0: dependencies: is-relative: 1.0.0 @@ -13463,6 +13544,20 @@ snapshots: '@types/react': 18.3.17 react: 19.0.0 + react-intl@7.0.4(react@19.0.0)(typescript@5.7.2): + dependencies: + '@formatjs/ecma402-abstract': 2.3.1 + '@formatjs/icu-messageformat-parser': 2.9.7 + '@formatjs/intl': 3.0.4(typescript@5.7.2) + '@types/hoist-non-react-statics': 3.3.1 + '@types/react': 18.3.17 + hoist-non-react-statics: 3.3.2 + intl-messageformat: 10.7.10 + react: 19.0.0 + tslib: 2.6.2 + optionalDependencies: + typescript: 5.7.2 + react-is@16.13.1: {} react-is@17.0.2: {} From 9779749a2cfb99eea8ebd4f5cb1058b0f69a9e73 Mon Sep 17 00:00:00 2001 From: Qs-F Date: Fri, 20 Dec 2024 19:53:32 +0900 Subject: [PATCH 02/11] chore: add intl-messageformat --- packages/smarthr-ui/package.json | 1 + pnpm-lock.yaml | 3 +++ 2 files changed, 4 insertions(+) diff --git a/packages/smarthr-ui/package.json b/packages/smarthr-ui/package.json index 8902cf060a..828a599510 100644 --- a/packages/smarthr-ui/package.json +++ b/packages/smarthr-ui/package.json @@ -6,6 +6,7 @@ "dependencies": { "@smarthr/wareki": "^1.3.0", "dayjs": "^1.11.13", + "intl-messageformat": "^10.7.10", "lodash.merge": "^4.6.2", "lodash.range": "^3.2.0", "polished": "^4.3.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8568c63264..14fd6e403e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -79,6 +79,9 @@ importers: dayjs: specifier: ^1.11.13 version: 1.11.13 + intl-messageformat: + specifier: ^10.7.10 + version: 10.7.10 lodash.merge: specifier: ^4.6.2 version: 4.6.2 From d5fa6490046ab6eccab9b12668c404d25da4eec9 Mon Sep 17 00:00:00 2001 From: Qs-F Date: Fri, 20 Dec 2024 19:54:04 +0900 Subject: [PATCH 03/11] feat: add IntlProvider --- .../components/IntlProvider/IntlProvider.tsx | 22 +++++++++++++++++++ .../src/components/IntlProvider/localeMap.ts | 10 +++++++++ 2 files changed, 32 insertions(+) create mode 100644 packages/smarthr-ui/src/components/IntlProvider/IntlProvider.tsx create mode 100644 packages/smarthr-ui/src/components/IntlProvider/localeMap.ts diff --git a/packages/smarthr-ui/src/components/IntlProvider/IntlProvider.tsx b/packages/smarthr-ui/src/components/IntlProvider/IntlProvider.tsx new file mode 100644 index 0000000000..a925064bdb --- /dev/null +++ b/packages/smarthr-ui/src/components/IntlProvider/IntlProvider.tsx @@ -0,0 +1,22 @@ +'use client' + +import React, { FC, PropsWithChildren } from 'react' +import { IntlProvider as ReactIntlProvider } from 'react-intl' + +import { locale as ja } from '../../locales/ja' +import { Messages } from '../../locales/types' + +const localeMap = { + ja, +} as const + +type Props = PropsWithChildren<{ + locale: keyof typeof localeMap + messages: Messages +}> + +export const IntlProvider: FC = ({ locale, children }) => ( + + {children} + +) diff --git a/packages/smarthr-ui/src/components/IntlProvider/localeMap.ts b/packages/smarthr-ui/src/components/IntlProvider/localeMap.ts new file mode 100644 index 0000000000..f03e3f707e --- /dev/null +++ b/packages/smarthr-ui/src/components/IntlProvider/localeMap.ts @@ -0,0 +1,10 @@ +export const localeMap = { + ja: '日本語', + 'id-id': 'Bahasa Indonesia', + 'en-us': 'English', + pt: 'Português', + vi: 'Tiếng Việt', + ko: '한국어', + 'zh-cn': '简体中文', + 'zh-tw': '繁體中文', +} as const From 8b0614fbeee3d55f99b8b8e77fd2fe2fd3f42172 Mon Sep 17 00:00:00 2001 From: Qs-F Date: Fri, 20 Dec 2024 19:54:34 +0900 Subject: [PATCH 04/11] feat: add useIntl hooks --- packages/smarthr-ui/src/hooks/useIntl.ts | 54 ++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 packages/smarthr-ui/src/hooks/useIntl.ts diff --git a/packages/smarthr-ui/src/hooks/useIntl.ts b/packages/smarthr-ui/src/hooks/useIntl.ts new file mode 100644 index 0000000000..4d0dcb5094 --- /dev/null +++ b/packages/smarthr-ui/src/hooks/useIntl.ts @@ -0,0 +1,54 @@ +import { FormatXMLElementFn, Options as IntlMessageFormatOptions } from 'intl-messageformat' +import { useCallback } from 'react' +import { + PrimitiveType, + MessageDescriptor as ReactIntlMessageDescriptor, + useIntl as useReactIntl, +} from 'react-intl' + +import { locale as ja } from '../locales/ja' +import { Messages } from '../locales/types' + +/** + * MEMO: + * src/components/parts/FormattedMessage/FormattedMessage.tsx + * と同じやり方で型を拡張している + */ +type MessageDescriptor = Omit & { + id: T + defaultMessage: (typeof ja)[T] +} + +export const useIntl = () => { + const intl = useReactIntl() + // const lang = useLanguage() + const lang = intl.locale + + const formatMessage = useCallback( + ( + descriptor: MessageDescriptor, + values?: Record>, + opts?: IntlMessageFormatOptions, + ): string => intl.formatMessage(descriptor, values, opts), + [intl], + ) + + const formatDate = useCallback( + (date: Date, opts?: Intl.DateTimeFormatOptions & { jaFormat?: boolean }): string => { + // 日本語の場合デザインシステム上のフォーマットは「YYYY/MM/DD」形式なので、それに合わせるための対応 + const slashFormat = !opts?.jaFormat && lang === 'ja' + + const overrideOpts: Intl.DateTimeFormatOptions = { + year: 'numeric', + month: slashFormat ? '2-digit' : 'short', + day: '2-digit', + ...opts, + } as const + + return intl.formatDate(date, overrideOpts) + }, + [intl, lang], + ) + + return { formatMessage, formatDate } +} From fcbd101fc82fcc7bc1684c1d9e2317b0a0ab4413 Mon Sep 17 00:00:00 2001 From: Qs-F Date: Fri, 20 Dec 2024 19:55:00 +0900 Subject: [PATCH 05/11] feat: add locales configutation --- packages/smarthr-ui/src/locales/en_us.ts | 5 +++++ packages/smarthr-ui/src/locales/ja.ts | 5 +++++ packages/smarthr-ui/src/locales/types.ts | 3 +++ 3 files changed, 13 insertions(+) create mode 100644 packages/smarthr-ui/src/locales/en_us.ts create mode 100644 packages/smarthr-ui/src/locales/ja.ts create mode 100644 packages/smarthr-ui/src/locales/types.ts diff --git a/packages/smarthr-ui/src/locales/en_us.ts b/packages/smarthr-ui/src/locales/en_us.ts new file mode 100644 index 0000000000..ebe4c988cf --- /dev/null +++ b/packages/smarthr-ui/src/locales/en_us.ts @@ -0,0 +1,5 @@ +import { Messages } from './types' + +export const locale = { + 'smarthr-ui/TextLink/OpenInNewTab': '', +} as const satisfies Messages diff --git a/packages/smarthr-ui/src/locales/ja.ts b/packages/smarthr-ui/src/locales/ja.ts new file mode 100644 index 0000000000..64f270a4f2 --- /dev/null +++ b/packages/smarthr-ui/src/locales/ja.ts @@ -0,0 +1,5 @@ +import { Messages } from './types' + +export const locale = { + 'smarthr-ui/TextLink/OpenInNewTab': '別タブで開く', +} as const satisfies Messages diff --git a/packages/smarthr-ui/src/locales/types.ts b/packages/smarthr-ui/src/locales/types.ts new file mode 100644 index 0000000000..5a1376d675 --- /dev/null +++ b/packages/smarthr-ui/src/locales/types.ts @@ -0,0 +1,3 @@ +export type Messages = { + 'smarthr-ui/TextLink/OpenInNewTab': string +} From 7a23e0b1abcd318b610e8213bc5b64e5dfff6365 Mon Sep 17 00:00:00 2001 From: Qs-F Date: Fri, 20 Dec 2024 19:55:37 +0900 Subject: [PATCH 06/11] feat: add Formatter components --- .../src/components/Formatter/FormattedDate.tsx | 0 .../components/Formatter/FormattedMessage.tsx | 17 +++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 packages/smarthr-ui/src/components/Formatter/FormattedDate.tsx create mode 100644 packages/smarthr-ui/src/components/Formatter/FormattedMessage.tsx diff --git a/packages/smarthr-ui/src/components/Formatter/FormattedDate.tsx b/packages/smarthr-ui/src/components/Formatter/FormattedDate.tsx new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/smarthr-ui/src/components/Formatter/FormattedMessage.tsx b/packages/smarthr-ui/src/components/Formatter/FormattedMessage.tsx new file mode 100644 index 0000000000..d85e326412 --- /dev/null +++ b/packages/smarthr-ui/src/components/Formatter/FormattedMessage.tsx @@ -0,0 +1,17 @@ +import React, { ComponentProps } from 'react' +import { FormattedMessage as RawFormattedMessage } from 'react-intl' + +import { locale as ja } from '../../locales/ja' +import { Messages } from '../../locales/types' + +type Props = Omit< + ComponentProps, + 'id' | 'defaultMessage' +> & { + id: Id + defaultMessage: (typeof ja)[Id] +} + +export const FormattedMessage = ({ values, ...props }: Props) => ( + , ...values }} /> +) From 5b9c7a468237405b05cc9f5b523c8d1a335cf0f6 Mon Sep 17 00:00:00 2001 From: Qs-F Date: Fri, 20 Dec 2024 19:56:44 +0900 Subject: [PATCH 07/11] fix: localize TextLink component --- .../smarthr-ui/src/components/TextLink/TextLink.tsx | 13 +++++++++++-- .../TextLink/stories/TextLink.stories.tsx | 7 ++++++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/packages/smarthr-ui/src/components/TextLink/TextLink.tsx b/packages/smarthr-ui/src/components/TextLink/TextLink.tsx index 5604c71954..310eed6e90 100644 --- a/packages/smarthr-ui/src/components/TextLink/TextLink.tsx +++ b/packages/smarthr-ui/src/components/TextLink/TextLink.tsx @@ -10,6 +10,7 @@ import React, { } from 'react' import { tv } from 'tailwind-variants' +import { useIntl } from '../../hooks/useIntl' import { ElementRef, ElementRefProps } from '../../types' import { FaUpRightFromSquareIcon } from '../Icon' @@ -61,13 +62,21 @@ export const TextLink: TextLinkComponent = forwardRef( }: PropsWithoutRef> & ElementProps, ref: Ref>, ) => { + const { formatMessage } = useIntl() const Component = elementAs || 'a' const actualSuffix = useMemo(() => { if (target === '_blank' && suffix === undefined) { - return + return ( + + ) } return suffix - }, [suffix, target]) + }, [suffix, target, formatMessage]) const actualHref = useMemo(() => { if (href) { return href diff --git a/packages/smarthr-ui/src/components/TextLink/stories/TextLink.stories.tsx b/packages/smarthr-ui/src/components/TextLink/stories/TextLink.stories.tsx index 35b2c35938..8cb2e46ece 100644 --- a/packages/smarthr-ui/src/components/TextLink/stories/TextLink.stories.tsx +++ b/packages/smarthr-ui/src/components/TextLink/stories/TextLink.stories.tsx @@ -2,6 +2,7 @@ import { action } from '@storybook/addon-actions' import React, { ComponentPropsWithoutRef } from 'react' import { FaCircleQuestionIcon, FaUpRightFromSquareIcon } from '../../Icon' +import { IntlProvider } from '../../IntlProvider/IntlProvider' import { UpwardLink } from '../../UpwardLink' import { TextLink } from '../TextLink' @@ -30,7 +31,11 @@ export default { title: 'Navigation(ナビゲーション)/TextLink', component: TextLink, subcomponents: { UpwardLink }, - render: (args) => , + render: (args) => ( + + + + ), argTypes: { href: { control: 'text', From 6613c877d093ffe1057ee92c8294d485eafc88c4 Mon Sep 17 00:00:00 2001 From: Qs-F Date: Mon, 23 Dec 2024 11:07:11 +0900 Subject: [PATCH 08/11] fix: tsconfig --- packages/smarthr-ui/tsconfig.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/smarthr-ui/tsconfig.json b/packages/smarthr-ui/tsconfig.json index c79477cc1d..fe1b765713 100644 --- a/packages/smarthr-ui/tsconfig.json +++ b/packages/smarthr-ui/tsconfig.json @@ -3,10 +3,10 @@ "compilerOptions": { "outDir": "./lib", "lib": [ - "es2020", + "es2022", "dom" ], - "target": "es2020", + "target": "esnext", "module": "commonjs", "moduleResolution": "node", "sourceMap": true, @@ -35,4 +35,4 @@ "src/**/*", ".storybook/**/*" ] -} \ No newline at end of file +} From e35b0c8c49395f7b5587e05b3dd10cdfb99ee177 Mon Sep 17 00:00:00 2001 From: Qs-F Date: Mon, 23 Dec 2024 15:47:28 +0900 Subject: [PATCH 09/11] fix: change target build ES version --- packages/smarthr-ui/tsconfig.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/smarthr-ui/tsconfig.json b/packages/smarthr-ui/tsconfig.json index fe1b765713..ca6c362a84 100644 --- a/packages/smarthr-ui/tsconfig.json +++ b/packages/smarthr-ui/tsconfig.json @@ -6,7 +6,7 @@ "es2022", "dom" ], - "target": "esnext", + "target": "es2022", "module": "commonjs", "moduleResolution": "node", "sourceMap": true, @@ -26,7 +26,7 @@ "allowSyntheticDefaultImports": true, "noEmitOnError": true, "esModuleInterop": true, - "paths": {}, + "paths": {} }, "exclude": [ "node_modules" From f7e327f2397fe07bc2e89591e441174a92ea16c5 Mon Sep 17 00:00:00 2001 From: Qs-F Date: Wed, 25 Dec 2024 15:13:15 +0900 Subject: [PATCH 10/11] feat: add supported languages --- packages/smarthr-ui/src/locales/en_us.ts | 6 +++--- packages/smarthr-ui/src/locales/id_id.ts | 5 +++++ packages/smarthr-ui/src/locales/index.ts | 8 ++++++++ packages/smarthr-ui/src/locales/ja.ts | 6 +++--- packages/smarthr-ui/src/locales/ko_kr.ts | 5 +++++ packages/smarthr-ui/src/locales/pt_br.ts | 5 +++++ packages/smarthr-ui/src/locales/vi_vn.ts | 5 +++++ packages/smarthr-ui/src/locales/zh_hans_cn.ts | 5 +++++ packages/smarthr-ui/src/locales/zh_hant_tw.ts | 5 +++++ 9 files changed, 44 insertions(+), 6 deletions(-) create mode 100644 packages/smarthr-ui/src/locales/id_id.ts create mode 100644 packages/smarthr-ui/src/locales/index.ts create mode 100644 packages/smarthr-ui/src/locales/ko_kr.ts create mode 100644 packages/smarthr-ui/src/locales/pt_br.ts create mode 100644 packages/smarthr-ui/src/locales/vi_vn.ts create mode 100644 packages/smarthr-ui/src/locales/zh_hans_cn.ts create mode 100644 packages/smarthr-ui/src/locales/zh_hant_tw.ts diff --git a/packages/smarthr-ui/src/locales/en_us.ts b/packages/smarthr-ui/src/locales/en_us.ts index ebe4c988cf..dad7bc51b2 100644 --- a/packages/smarthr-ui/src/locales/en_us.ts +++ b/packages/smarthr-ui/src/locales/en_us.ts @@ -1,5 +1,5 @@ -import { Messages } from './types' - +// キーと値の間に改行が入ると翻訳システムと連携できなくなるため、prettier-ignoreしている +// prettier-ignore export const locale = { 'smarthr-ui/TextLink/OpenInNewTab': '', -} as const satisfies Messages +} as const diff --git a/packages/smarthr-ui/src/locales/id_id.ts b/packages/smarthr-ui/src/locales/id_id.ts new file mode 100644 index 0000000000..dad7bc51b2 --- /dev/null +++ b/packages/smarthr-ui/src/locales/id_id.ts @@ -0,0 +1,5 @@ +// キーと値の間に改行が入ると翻訳システムと連携できなくなるため、prettier-ignoreしている +// prettier-ignore +export const locale = { + 'smarthr-ui/TextLink/OpenInNewTab': '', +} as const diff --git a/packages/smarthr-ui/src/locales/index.ts b/packages/smarthr-ui/src/locales/index.ts new file mode 100644 index 0000000000..685e269750 --- /dev/null +++ b/packages/smarthr-ui/src/locales/index.ts @@ -0,0 +1,8 @@ +export { locale as ja } from './ja' +export { locale as enUs } from './en_us' +export { locale as ko } from './ko_kr' +export { locale as pt } from './pt_br' +export { locale as vi } from './vi_vn' +export { locale as zhCn } from './zh_hans_cn' +export { locale as zhTw } from './zh_hant_tw' +export { locale as idId } from './id_id' diff --git a/packages/smarthr-ui/src/locales/ja.ts b/packages/smarthr-ui/src/locales/ja.ts index 64f270a4f2..62466bcca0 100644 --- a/packages/smarthr-ui/src/locales/ja.ts +++ b/packages/smarthr-ui/src/locales/ja.ts @@ -1,5 +1,5 @@ -import { Messages } from './types' - +// キーと値の間に改行が入ると翻訳システムと連携できなくなるため、prettier-ignoreしている +// prettier-ignore export const locale = { 'smarthr-ui/TextLink/OpenInNewTab': '別タブで開く', -} as const satisfies Messages +} as const diff --git a/packages/smarthr-ui/src/locales/ko_kr.ts b/packages/smarthr-ui/src/locales/ko_kr.ts new file mode 100644 index 0000000000..dad7bc51b2 --- /dev/null +++ b/packages/smarthr-ui/src/locales/ko_kr.ts @@ -0,0 +1,5 @@ +// キーと値の間に改行が入ると翻訳システムと連携できなくなるため、prettier-ignoreしている +// prettier-ignore +export const locale = { + 'smarthr-ui/TextLink/OpenInNewTab': '', +} as const diff --git a/packages/smarthr-ui/src/locales/pt_br.ts b/packages/smarthr-ui/src/locales/pt_br.ts new file mode 100644 index 0000000000..dad7bc51b2 --- /dev/null +++ b/packages/smarthr-ui/src/locales/pt_br.ts @@ -0,0 +1,5 @@ +// キーと値の間に改行が入ると翻訳システムと連携できなくなるため、prettier-ignoreしている +// prettier-ignore +export const locale = { + 'smarthr-ui/TextLink/OpenInNewTab': '', +} as const diff --git a/packages/smarthr-ui/src/locales/vi_vn.ts b/packages/smarthr-ui/src/locales/vi_vn.ts new file mode 100644 index 0000000000..dad7bc51b2 --- /dev/null +++ b/packages/smarthr-ui/src/locales/vi_vn.ts @@ -0,0 +1,5 @@ +// キーと値の間に改行が入ると翻訳システムと連携できなくなるため、prettier-ignoreしている +// prettier-ignore +export const locale = { + 'smarthr-ui/TextLink/OpenInNewTab': '', +} as const diff --git a/packages/smarthr-ui/src/locales/zh_hans_cn.ts b/packages/smarthr-ui/src/locales/zh_hans_cn.ts new file mode 100644 index 0000000000..dad7bc51b2 --- /dev/null +++ b/packages/smarthr-ui/src/locales/zh_hans_cn.ts @@ -0,0 +1,5 @@ +// キーと値の間に改行が入ると翻訳システムと連携できなくなるため、prettier-ignoreしている +// prettier-ignore +export const locale = { + 'smarthr-ui/TextLink/OpenInNewTab': '', +} as const diff --git a/packages/smarthr-ui/src/locales/zh_hant_tw.ts b/packages/smarthr-ui/src/locales/zh_hant_tw.ts new file mode 100644 index 0000000000..dad7bc51b2 --- /dev/null +++ b/packages/smarthr-ui/src/locales/zh_hant_tw.ts @@ -0,0 +1,5 @@ +// キーと値の間に改行が入ると翻訳システムと連携できなくなるため、prettier-ignoreしている +// prettier-ignore +export const locale = { + 'smarthr-ui/TextLink/OpenInNewTab': '', +} as const From ffa9c3977e702fe4963d0b414d65275d919a5988 Mon Sep 17 00:00:00 2001 From: Qs-F Date: Wed, 25 Dec 2024 15:16:40 +0900 Subject: [PATCH 11/11] refactor: remove unused file --- packages/smarthr-ui/src/locales/types.ts | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 packages/smarthr-ui/src/locales/types.ts diff --git a/packages/smarthr-ui/src/locales/types.ts b/packages/smarthr-ui/src/locales/types.ts deleted file mode 100644 index 5a1376d675..0000000000 --- a/packages/smarthr-ui/src/locales/types.ts +++ /dev/null @@ -1,3 +0,0 @@ -export type Messages = { - 'smarthr-ui/TextLink/OpenInNewTab': string -}