mirror of
https://github.com/formbricks/formbricks.git
synced 2026-01-06 00:49:42 -06:00
feat: traditional Chinese translations (#4705)
Co-authored-by: Dhruwang Jariwala <67850763+Dhruwang@users.noreply.github.com> Co-authored-by: Dhruwang <dhruwangjariwala18@gmail.com>
This commit is contained in:
@@ -23,6 +23,10 @@
|
||||
{
|
||||
"language": "pt-BR",
|
||||
"path": "./packages/lib/messages/pt-BR.json"
|
||||
},
|
||||
{
|
||||
"language": "zh-Hant-TW",
|
||||
"path": "./packages/lib/messages/zh-Hant-TW.json"
|
||||
}
|
||||
],
|
||||
"forceMode": "OVERRIDE"
|
||||
|
||||
@@ -12,15 +12,14 @@ import { Metadata, NextPage } from "next";
|
||||
import { getServerSession } from "next-auth";
|
||||
import Link from "next/link";
|
||||
import { redirect } from "next/navigation";
|
||||
import { SURVEYS_PER_PAGE, WEBAPP_URL } from "@formbricks/lib/constants";
|
||||
import { DEFAULT_LOCALE, SURVEYS_PER_PAGE, WEBAPP_URL } from "@formbricks/lib/constants";
|
||||
import { getEnvironment, getEnvironments } from "@formbricks/lib/environment/service";
|
||||
import { getMembershipByUserIdOrganizationId } from "@formbricks/lib/membership/service";
|
||||
import { getAccessFlags } from "@formbricks/lib/membership/utils";
|
||||
import { getOrganizationByEnvironmentId } from "@formbricks/lib/organization/service";
|
||||
import { getProjectByEnvironmentId } from "@formbricks/lib/project/service";
|
||||
import { getSurveyCount } from "@formbricks/lib/survey/service";
|
||||
import { getUser } from "@formbricks/lib/user/service";
|
||||
import { findMatchingLocale } from "@formbricks/lib/utils/locale";
|
||||
import { getUser, getUserLocale } from "@formbricks/lib/user/service";
|
||||
import { TTemplateRole } from "@formbricks/types/templates";
|
||||
|
||||
export const metadata: Metadata = {
|
||||
@@ -86,7 +85,7 @@ const SurveysPage = async ({ params: paramsProps, searchParams: searchParamsProp
|
||||
const otherEnvironment = environments.find((e) => e.type !== environment.type)!;
|
||||
|
||||
const currentProjectChannel = project.config.channel ?? null;
|
||||
const locale = await findMatchingLocale();
|
||||
const locale = (await getUserLocale(session.user.id)) ?? DEFAULT_LOCALE;
|
||||
const CreateSurveyButton = () => {
|
||||
return (
|
||||
<Button size="sm" asChild>
|
||||
|
||||
@@ -23,7 +23,7 @@ const nextConfig = {
|
||||
"app/api/packages": ["../../packages/js-core/dist/*", "../../packages/surveys/dist/*"],
|
||||
},
|
||||
i18n: {
|
||||
locales: ["en-US", "de-DE", "fr-FR", "pt-BR"],
|
||||
locales: ["en-US", "de-DE", "fr-FR", "pt-BR", "zh-Hant-TW"],
|
||||
localeDetection: false,
|
||||
defaultLocale: "en-US",
|
||||
},
|
||||
|
||||
@@ -4,7 +4,7 @@ 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"];
|
||||
export const ALL_LANGUAGES = ["en-US", "de-DE", "fr-FR", "pt-BR", "zh-Hant-TW"];
|
||||
|
||||
export const DEFAULT_LANGUAGE = "en-US";
|
||||
|
||||
@@ -20,6 +20,7 @@ export function TolgeeBase() {
|
||||
"de-DE": () => import("@formbricks/lib/messages/de-DE.json"),
|
||||
"fr-FR": () => import("@formbricks/lib/messages/fr-FR.json"),
|
||||
"pt-BR": () => import("@formbricks/lib/messages/pt-BR.json"),
|
||||
"zh-Hant-TW": () => import("@formbricks/lib/messages/zh-Hant-TW.json"),
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@@ -200,7 +200,7 @@ export const STRIPE_API_VERSION = "2024-06-20";
|
||||
export const MAX_ATTRIBUTE_CLASSES_PER_ENVIRONMENT = 150 as const;
|
||||
|
||||
export const DEFAULT_LOCALE = "en-US";
|
||||
export const AVAILABLE_LOCALES: TUserLocale[] = ["en-US", "de-DE", "pt-BR", "fr-FR"];
|
||||
export const AVAILABLE_LOCALES: TUserLocale[] = ["en-US", "de-DE", "pt-BR", "fr-FR", "zh-Hant-TW"];
|
||||
|
||||
// Billing constants
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1245,7 +1245,7 @@
|
||||
"edit": {
|
||||
"1_choose_the_default_language_for_this_survey": "1. Wähle die Standardsprache für diese Umfrage:",
|
||||
"2_activate_translation_for_specific_languages": "2. Übersetzung für bestimmte Sprachen aktivieren:",
|
||||
"add": "Hinzufügen +",
|
||||
"add": "+ hinzufügen",
|
||||
"add_a_delay_or_auto_close_the_survey": "Füge eine Verzögerung hinzu oder schließe die Umfrage automatisch.",
|
||||
"add_a_four_digit_pin": "Füge eine vierstellige PIN hinzu",
|
||||
"add_a_new_question_to_your_survey": "Neue Frage hinzufügen",
|
||||
|
||||
2837
packages/lib/messages/zh-Hant-TW.json
Normal file
2837
packages/lib/messages/zh-Hant-TW.json
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,5 @@
|
||||
import { formatDistance, intlFormat } from "date-fns";
|
||||
import { de, enUS, fr, ptBR } from "date-fns/locale";
|
||||
import { de, enUS, fr, ptBR, zhTW } from "date-fns/locale";
|
||||
import { TUserLocale } from "@formbricks/types/user";
|
||||
|
||||
export const convertDateString = (dateString: string) => {
|
||||
@@ -86,6 +86,8 @@ const getLocaleForTimeSince = (locale: TUserLocale) => {
|
||||
return ptBR;
|
||||
case "fr-FR":
|
||||
return fr;
|
||||
case "zh-Hant-TW":
|
||||
return zhTW;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import { z } from "zod";
|
||||
|
||||
const ZRole = z.enum(["project_manager", "engineer", "founder", "marketing_specialist", "other"]);
|
||||
|
||||
export const ZUserLocale = z.enum(["en-US", "de-DE", "pt-BR", "fr-FR"]);
|
||||
export const ZUserLocale = z.enum(["en-US", "de-DE", "pt-BR", "fr-FR", "zh-Hant-TW"]);
|
||||
|
||||
export type TUserLocale = z.infer<typeof ZUserLocale>;
|
||||
export const ZUserObjective = z.enum([
|
||||
|
||||
Reference in New Issue
Block a user