feat: add Simplified Chinese (zh-Hans-CN) translations #6511 (#6518)

Co-authored-by: Dhruwang <dhruwangjariwala18@gmail.com>
This commit is contained in:
Yuuenn
2025-09-10 15:13:48 +03:00
committed by GitHub
parent c259a61f0e
commit d46644fe0d
16 changed files with 3107 additions and 9 deletions

View File

@@ -39,6 +39,10 @@
{
"language": "ja-JP",
"path": "./apps/web/locales/ja-JP.json"
},
{
"language": "zh-Hans-CN",
"path": "./apps/web/locales/zh-Hans-CN.json"
}
],
"forceMode": "OVERRIDE"

View File

@@ -183,6 +183,7 @@ export const AVAILABLE_LOCALES: TUserLocale[] = [
"pt-PT",
"ro-RO",
"ja-JP",
"zh-Hans-CN",
];
// Billing constants

View File

@@ -142,6 +142,7 @@ export const appLanguages = [
"pt-PT": "Inglês (EUA)",
"ro-RO": "Engleză (SUA)",
"ja-JP": "英語(米国)",
"zh-Hans-CN": "英语(美国)",
},
},
{
@@ -155,6 +156,7 @@ export const appLanguages = [
"pt-PT": "Alemão",
"ro-RO": "Germană",
"ja-JP": "ドイツ語",
"zh-Hans-CN": "德语",
},
},
{
@@ -168,6 +170,7 @@ export const appLanguages = [
"pt-PT": "Português (Brasil)",
"ro-RO": "Portugheză (Brazilia)",
"ja-JP": "ポルトガル語(ブラジル)",
"zh-Hans-CN": "葡萄牙语(巴西)",
},
},
{
@@ -181,6 +184,7 @@ export const appLanguages = [
"pt-PT": "Francês",
"ro-RO": "Franceză",
"ja-JP": "フランス語",
"zh-Hans-CN": "法语",
},
},
{
@@ -194,6 +198,7 @@ export const appLanguages = [
"pt-PT": "Chinês (Tradicional)",
"ro-RO": "Chineză (Tradicională)",
"ja-JP": "中国語(繁体字)",
"zh-Hans-CN": "繁体中文",
},
},
{
@@ -207,6 +212,7 @@ export const appLanguages = [
"pt-PT": "Português (Portugal)",
"ro-RO": "Portugheză (Portugalia)",
"ja-JP": "ポルトガル語(ポルトガル)",
"zh-Hans-CN": "葡萄牙语(葡萄牙)",
},
},
{
@@ -220,6 +226,7 @@ export const appLanguages = [
"pt-PT": "Romeno",
"ro-RO": "Română",
"ja-JP": "ルーマニア語",
"zh-Hans-CN": "罗马尼亚语",
},
},
{
@@ -233,6 +240,21 @@ export const appLanguages = [
"pt-PT": "Japonês",
"ro-RO": "Japoneză",
"ja-JP": "日本語",
"zh-Hans-CN": "日语",
},
},
{
code: "zh-Hans-CN",
label: {
"en-US": "Chinese (Simplified)",
"de-DE": "Chinesisch (Vereinfacht)",
"pt-BR": "Chinês (Simplificado)",
"fr-FR": "Chinois (Simplifié)",
"zh-Hant-TW": "簡體中文",
"pt-PT": "Chinês (Simplificado)",
"ro-RO": "Chineză (Simplificată)",
"ja-JP": "中国語(簡体字)",
"zh-Hans-CN": "简体中文",
},
},
];

View File

@@ -1,5 +1,5 @@
import { formatDistance, intlFormat } from "date-fns";
import { de, enUS, fr, ja, pt, ptBR, ro, zhTW } from "date-fns/locale";
import { de, enUS, fr, ja, pt, ptBR, ro, zhCN, zhTW } from "date-fns/locale";
import { TUserLocale } from "@formbricks/types/user";
export const convertDateString = (dateString: string | null) => {
@@ -99,6 +99,8 @@ const getLocaleForTimeSince = (locale: TUserLocale) => {
return ro;
case "ja-JP":
return ja;
case "zh-Hans-CN":
return zhCN;
}
};

View File

@@ -1844,7 +1844,7 @@
"this_quarter": "Dieses Quartal",
"this_year": "Dieses Jahr",
"time_to_complete": "Zeit zur Fertigstellung",
"ttc_tooltip": "Durchschnittliche Zeit bis zum Abschluss der Umfrage.",
"ttc_tooltip": "Durchschnittliche Zeit zum Beantworten der Frage.",
"unknown_question_type": "Unbekannter Fragetyp",
"use_personal_links": "Nutze persönliche Links",
"waiting_for_response": "Warte auf eine Antwort \uD83E\uDDD8",

View File

@@ -1844,7 +1844,7 @@
"this_quarter": "This quarter",
"this_year": "This year",
"time_to_complete": "Time to Complete",
"ttc_tooltip": "Average time to complete the survey.",
"ttc_tooltip": "Average time to complete the question.",
"unknown_question_type": "Unknown Question Type",
"use_personal_links": "Use personal links",
"waiting_for_response": "Waiting for a response \uD83E\uDDD8",

View File

@@ -1844,7 +1844,7 @@
"this_quarter": "Ce trimestre",
"this_year": "Cette année",
"time_to_complete": "Temps à compléter",
"ttc_tooltip": "Temps moyen pour compléter l'enquête.",
"ttc_tooltip": "Temps moyen pour compléter la question.",
"unknown_question_type": "Type de question inconnu",
"use_personal_links": "Utilisez des liens personnels",
"waiting_for_response": "En attente d'une réponse \uD83E\uDDD8",

View File

@@ -1844,7 +1844,7 @@
"this_quarter": "Este trimestre",
"this_year": "Este ano",
"time_to_complete": "Tempo para Concluir",
"ttc_tooltip": "Tempo médio para completar a pesquisa.",
"ttc_tooltip": "Tempo médio para completar a pergunta.",
"unknown_question_type": "Tipo de pergunta desconhecido",
"use_personal_links": "Use links pessoais",
"waiting_for_response": "Aguardando uma resposta \uD83E\uDDD8",

View File

@@ -1844,7 +1844,7 @@
"this_quarter": "Este trimestre",
"this_year": "Este ano",
"time_to_complete": "Tempo para Concluir",
"ttc_tooltip": "Tempo médio para concluir o inquérito.",
"ttc_tooltip": "Tempo médio para concluir a pergunta.",
"unknown_question_type": "Tipo de Pergunta Desconhecido",
"use_personal_links": "Utilize links pessoais",
"waiting_for_response": "A aguardar uma resposta \uD83E\uDDD8",

View File

@@ -1844,7 +1844,7 @@
"this_quarter": "Trimestrul acesta",
"this_year": "Anul acesta",
"time_to_complete": "Timp de finalizare",
"ttc_tooltip": "Timp mediu pentru a completa sondajul.",
"ttc_tooltip": "Timp mediu pentru a completa întrebarea.",
"unknown_question_type": "Tip de întrebare necunoscut",
"use_personal_links": "Folosește linkuri personale",
"waiting_for_response": "Așteptând un răspuns \uD83E\uDDD8",

File diff suppressed because it is too large Load Diff

View File

@@ -1844,7 +1844,7 @@
"this_quarter": "本季",
"this_year": "今年",
"time_to_complete": "完成時間",
"ttc_tooltip": "完成問卷的平均時間。",
"ttc_tooltip": "完成 問題 的 平均 時間。",
"unknown_question_type": "未知的問題類型",
"use_personal_links": "使用 個人 連結",
"waiting_for_response": "正在等待回應 \uD83E\uDDD8",

View File

@@ -12,6 +12,9 @@ vi.mock("@/locales/fr-FR.json", () => ({}));
vi.mock("@/locales/pt-BR.json", () => ({}));
vi.mock("@/locales/pt-PT.json", () => ({}));
vi.mock("@/locales/zh-Hant-TW.json", () => ({}));
vi.mock("@/locales/ro-RO.json", () => ({}));
vi.mock("@/locales/ja-JP.json", () => ({}));
vi.mock("@/locales/zh-Hans-CN.json", () => ({}));
describe("Tolgee Configuration", () => {
beforeEach(() => {
@@ -37,6 +40,7 @@ describe("Tolgee Configuration", () => {
"zh-Hant-TW",
"ro-RO",
"ja-JP",
"zh-Hans-CN",
]);
});
});

View File

@@ -4,7 +4,17 @@ import { DevTools, Tolgee } from "@tolgee/web";
const apiKey = process.env.NEXT_PUBLIC_TOLGEE_API_KEY;
const apiUrl = process.env.NEXT_PUBLIC_TOLGEE_API_URL;
export const ALL_LANGUAGES = ["en-US", "de-DE", "fr-FR", "pt-BR", "pt-PT", "zh-Hant-TW", "ro-RO", "ja-JP"];
export const ALL_LANGUAGES = [
"en-US",
"de-DE",
"fr-FR",
"pt-BR",
"pt-PT",
"zh-Hant-TW",
"ro-RO",
"ja-JP",
"zh-Hans-CN",
];
export const DEFAULT_LANGUAGE = "en-US";
@@ -24,6 +34,7 @@ export function TolgeeBase() {
"zh-Hant-TW": () => import("@/locales/zh-Hant-TW.json"),
"ro-RO": () => import("@/locales/ro-RO.json"),
"ja-JP": () => import("@/locales/ja-JP.json"),
"zh-Hans-CN": () => import("@/locales/zh-Hans-CN.json"),
},
});
}

File diff suppressed because it is too large Load Diff

View File

@@ -11,6 +11,7 @@ export const ZUserLocale = z.enum([
"pt-PT",
"ro-RO",
"ja-JP",
"zh-Hans-CN",
]);
export type TUserLocale = z.infer<typeof ZUserLocale>;