From 9724bc07a6d9bfe3ff32fa4e5657de2da3068d85 Mon Sep 17 00:00:00 2001 From: Lauris Skraucis Date: Mon, 1 Sep 2025 04:56:32 +0200 Subject: [PATCH] feat: enable italian for atoms (#23445) * fix: typo * feat: add italian language to atoms * chore: add changelog entry * docs: document available atoms languages --- .changeset/brave-bees-bake.md | 5 ++++ docs/platform/atoms/cal-provider.mdx | 2 +- .../atoms/cal-provider/BaseCalProvider.tsx | 4 ++++ .../platform/atoms/cal-provider/languages.ts | 23 ++++++++++++++++--- 4 files changed, 30 insertions(+), 4 deletions(-) create mode 100644 .changeset/brave-bees-bake.md diff --git a/.changeset/brave-bees-bake.md b/.changeset/brave-bees-bake.md new file mode 100644 index 0000000000..97272e528c --- /dev/null +++ b/.changeset/brave-bees-bake.md @@ -0,0 +1,5 @@ +--- +"@calcom/atoms": minor +--- + +feat: italian language support diff --git a/docs/platform/atoms/cal-provider.mdx b/docs/platform/atoms/cal-provider.mdx index 387c1e9036..e8392dbad8 100644 --- a/docs/platform/atoms/cal-provider.mdx +++ b/docs/platform/atoms/cal-provider.mdx @@ -38,5 +38,5 @@ Below is a list of props that can be passed to the Cal Provider. | options | Yes | Configuration options - `apiUrl` (should be https://api.cal.com/v2) and `refreshUrl` (URL of endpoint you have to build that to which atoms will send expired access tokens and receive new one in return. Read how to set it up [here](https://cal.com/docs/platform/quickstart#4-backend%3A-setting-up-a-refresh-token-endpoint)) and `readingDirection` (defaults to "ltr" but can also pass "rtl" which will change direction of UI components) | | accessToken | No | The access token of your managed user for whom cal handles scheduling. | | autoUpdateTimezone | No | Whether to automatically update managed user timezone (default: true) | -| language | No | Language code (default: "en") | +| language | No | Language code (default: "en") - available languages: "en", "de", "fr", "it", "nl", "pt-BR", "es" | | organizationId | No | ID of your organization | \ No newline at end of file diff --git a/packages/platform/atoms/cal-provider/BaseCalProvider.tsx b/packages/platform/atoms/cal-provider/BaseCalProvider.tsx index 440901e754..f89b77302d 100644 --- a/packages/platform/atoms/cal-provider/BaseCalProvider.tsx +++ b/packages/platform/atoms/cal-provider/BaseCalProvider.tsx @@ -9,6 +9,7 @@ import deTranslations from "@calcom/web/public/static/locales/de/common.json"; import enTranslations from "@calcom/web/public/static/locales/en/common.json"; import esTranslations from "@calcom/web/public/static/locales/es/common.json"; import frTranslations from "@calcom/web/public/static/locales/fr/common.json"; +import itTranslations from "@calcom/web/public/static/locales/it/common.json"; import nlTranslations from "@calcom/web/public/static/locales/nl/common.json"; import ptBrTranslations from "@calcom/web/public/static/locales/pt-BR/common.json"; @@ -28,6 +29,7 @@ import type { ptBrTranslationKeys, deTranslationKeys, esTranslationKeys, + itTranslationKeys, nlTranslationKeys, i18nProps, } from "./languages"; @@ -224,6 +226,8 @@ function getTranslation(key: string, language: CalProviderLanguagesType) { return deTranslations[key as deTranslationKeys]; case "es": return esTranslations[key as esTranslationKeys]; + case "it": + return itTranslations[key as itTranslationKeys]; case "nl": return nlTranslations[key as nlTranslationKeys]; default: diff --git a/packages/platform/atoms/cal-provider/languages.ts b/packages/platform/atoms/cal-provider/languages.ts index 5828b65191..5508ba90d2 100644 --- a/packages/platform/atoms/cal-provider/languages.ts +++ b/packages/platform/atoms/cal-provider/languages.ts @@ -2,6 +2,7 @@ import type deTranslations from "@calcom/web/public/static/locales/de/common.jso import type enTranslations from "@calcom/web/public/static/locales/en/common.json"; import type esTranslations from "@calcom/web/public/static/locales/es/common.json"; import type frTranslations from "@calcom/web/public/static/locales/fr/common.json"; +import type itTranslations from "@calcom/web/public/static/locales/it/common.json"; import type nlTranslations from "@calcom/web/public/static/locales/nl/common.json"; import type ptBrTranslations from "@calcom/web/public/static/locales/pt-BR/common.json"; @@ -9,6 +10,7 @@ export type enTranslationKeys = keyof typeof enTranslations; export type frTranslationKeys = keyof typeof frTranslations; export type deTranslationKeys = keyof typeof deTranslations; export type esTranslationKeys = keyof typeof esTranslations; +export type itTranslationKeys = keyof typeof itTranslations; export type ptBrTranslationKeys = keyof typeof ptBrTranslations; export type nlTranslationKeys = keyof typeof nlTranslations; export type translationKeys = @@ -16,6 +18,7 @@ export type translationKeys = | frTranslationKeys | deTranslationKeys | esTranslationKeys + | itTranslationKeys | ptBrTranslationKeys | nlTranslationKeys; @@ -24,9 +27,11 @@ export const EN = "en"; export const PT_BR = "pt-BR"; export const DE = "de"; export const ES = "es"; +export const IT = "it"; export const NL = "nl"; -export const CAL_PROVIDER_LANGUAUES = [FR, EN, PT_BR, DE, ES, NL] as const; -export type CalProviderLanguagesType = (typeof CAL_PROVIDER_LANGUAUES)[number]; + +const CAL_PROVIDER_LANGUAGES = [FR, EN, PT_BR, DE, ES, IT, NL] as const; +export type CalProviderLanguagesType = (typeof CAL_PROVIDER_LANGUAGES)[number]; type i18nFrProps = { labels?: Partial>; @@ -53,9 +58,21 @@ type i18nEsProps = { language?: "es"; }; +type i18nItProps = { + labels?: Partial>; + language?: "it"; +}; + type i18nNlProps = { labels?: Partial>; language?: "nl"; }; -export type i18nProps = i18nFrProps | i18nEnProps | i18nPtBrProps | i18nDeProps | i18nEsProps | i18nNlProps; +export type i18nProps = + | i18nFrProps + | i18nEnProps + | i18nPtBrProps + | i18nDeProps + | i18nEsProps + | i18nItProps + | i18nNlProps;