Skip to content

Commit 9724bc0

Browse files
authored
feat: enable italian for atoms (calcom#23445)
* fix: typo * feat: add italian language to atoms * chore: add changelog entry * docs: document available atoms languages
1 parent 24ff362 commit 9724bc0

4 files changed

Lines changed: 30 additions & 4 deletions

File tree

.changeset/brave-bees-bake.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@calcom/atoms": minor
3+
---
4+
5+
feat: italian language support

docs/platform/atoms/cal-provider.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,5 @@ Below is a list of props that can be passed to the Cal Provider.
3838
| 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) |
3939
| accessToken | No | The access token of your managed user for whom cal handles scheduling. |
4040
| autoUpdateTimezone | No | Whether to automatically update managed user timezone (default: true) |
41-
| language | No | Language code (default: "en") |
41+
| language | No | Language code (default: "en") - available languages: "en", "de", "fr", "it", "nl", "pt-BR", "es" |
4242
| organizationId | No | ID of your organization |

packages/platform/atoms/cal-provider/BaseCalProvider.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import deTranslations from "@calcom/web/public/static/locales/de/common.json";
99
import enTranslations from "@calcom/web/public/static/locales/en/common.json";
1010
import esTranslations from "@calcom/web/public/static/locales/es/common.json";
1111
import frTranslations from "@calcom/web/public/static/locales/fr/common.json";
12+
import itTranslations from "@calcom/web/public/static/locales/it/common.json";
1213
import nlTranslations from "@calcom/web/public/static/locales/nl/common.json";
1314
import ptBrTranslations from "@calcom/web/public/static/locales/pt-BR/common.json";
1415

@@ -28,6 +29,7 @@ import type {
2829
ptBrTranslationKeys,
2930
deTranslationKeys,
3031
esTranslationKeys,
32+
itTranslationKeys,
3133
nlTranslationKeys,
3234
i18nProps,
3335
} from "./languages";
@@ -224,6 +226,8 @@ function getTranslation(key: string, language: CalProviderLanguagesType) {
224226
return deTranslations[key as deTranslationKeys];
225227
case "es":
226228
return esTranslations[key as esTranslationKeys];
229+
case "it":
230+
return itTranslations[key as itTranslationKeys];
227231
case "nl":
228232
return nlTranslations[key as nlTranslationKeys];
229233
default:

packages/platform/atoms/cal-provider/languages.ts

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,23 @@ import type deTranslations from "@calcom/web/public/static/locales/de/common.jso
22
import type enTranslations from "@calcom/web/public/static/locales/en/common.json";
33
import type esTranslations from "@calcom/web/public/static/locales/es/common.json";
44
import type frTranslations from "@calcom/web/public/static/locales/fr/common.json";
5+
import type itTranslations from "@calcom/web/public/static/locales/it/common.json";
56
import type nlTranslations from "@calcom/web/public/static/locales/nl/common.json";
67
import type ptBrTranslations from "@calcom/web/public/static/locales/pt-BR/common.json";
78

89
export type enTranslationKeys = keyof typeof enTranslations;
910
export type frTranslationKeys = keyof typeof frTranslations;
1011
export type deTranslationKeys = keyof typeof deTranslations;
1112
export type esTranslationKeys = keyof typeof esTranslations;
13+
export type itTranslationKeys = keyof typeof itTranslations;
1214
export type ptBrTranslationKeys = keyof typeof ptBrTranslations;
1315
export type nlTranslationKeys = keyof typeof nlTranslations;
1416
export type translationKeys =
1517
| enTranslationKeys
1618
| frTranslationKeys
1719
| deTranslationKeys
1820
| esTranslationKeys
21+
| itTranslationKeys
1922
| ptBrTranslationKeys
2023
| nlTranslationKeys;
2124

@@ -24,9 +27,11 @@ export const EN = "en";
2427
export const PT_BR = "pt-BR";
2528
export const DE = "de";
2629
export const ES = "es";
30+
export const IT = "it";
2731
export const NL = "nl";
28-
export const CAL_PROVIDER_LANGUAUES = [FR, EN, PT_BR, DE, ES, NL] as const;
29-
export type CalProviderLanguagesType = (typeof CAL_PROVIDER_LANGUAUES)[number];
32+
33+
const CAL_PROVIDER_LANGUAGES = [FR, EN, PT_BR, DE, ES, IT, NL] as const;
34+
export type CalProviderLanguagesType = (typeof CAL_PROVIDER_LANGUAGES)[number];
3035

3136
type i18nFrProps = {
3237
labels?: Partial<Record<frTranslationKeys, string>>;
@@ -53,9 +58,21 @@ type i18nEsProps = {
5358
language?: "es";
5459
};
5560

61+
type i18nItProps = {
62+
labels?: Partial<Record<itTranslationKeys, string>>;
63+
language?: "it";
64+
};
65+
5666
type i18nNlProps = {
5767
labels?: Partial<Record<nlTranslationKeys, string>>;
5868
language?: "nl";
5969
};
6070

61-
export type i18nProps = i18nFrProps | i18nEnProps | i18nPtBrProps | i18nDeProps | i18nEsProps | i18nNlProps;
71+
export type i18nProps =
72+
| i18nFrProps
73+
| i18nEnProps
74+
| i18nPtBrProps
75+
| i18nDeProps
76+
| i18nEsProps
77+
| i18nItProps
78+
| i18nNlProps;

0 commit comments

Comments
 (0)