From 4686d3ff48e90e5ad79c04941979e48b10a48204 Mon Sep 17 00:00:00 2001 From: Max Oehrlein <72990986+OMaxOe@users.noreply.github.com> Date: Wed, 7 Dec 2022 21:53:44 +0100 Subject: [PATCH] Improve multilingualism and fix search routes (#5334) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fixed search routes * made static text multilingual and fixed german translations # Conflicts: # apps/web/components/availability/Schedule.tsx * delete empty file created by fixing merge conflicts * fixing TextField placeholder by passing attendeeName and fixed json variable * Using useLocal to modify static text to make it multilingual, and passing the correct variables for brand and mail * seperated whitelabel and improved translations * added missing translation * added missing translation for webhooks * Updated AdminAppsView with dynamic translations. Added translations for german and english files only. * changed back to one liner * updated german and english translations for impersonation.tsx * updated german and english translations for impersonation.tsx and users.tsx. added missing german translation for timeformat_profile_hint * updated german and english translations for team-billing-view.tsx * updated german and english translations for LicenseRequired.tsx * updated routes for profile and avatar * yarn.lock updated from newer changes * Revert " yarn.lock updated from newer changes" This reverts commit efd9a90bf774371a331861e4fb441ab4f4d0b7fd. * sanitize dangerouslySetInnerHTML to prevent xss attacks * tried to fix window title flicker * changed ssdInit to ssrInit for getServerSideProps. Serverside translation works but current route still set as a window title * flicker with route in window title is caused here. It is not necessary to check if isPublic and session is false because it already gets checked in useRedirectToLoginIfUnauthenticated hook. * fixed window title translation flicker for availability page * fixed window title translation flicker for teams page * fixed window title translation flicker for workflow page * fixed error that div may not be rendered within p element * fixed window title translation flicker for booking page * fixed window title translation flicker by adding getServerSideProps * Only set HeadSeo if an page title exists. If window title is set by the Meta component, shell is causing a flicker because it overwrites the title which is set by Meta. It is a problem especially for settings pages. * fixed window title translation flicker by adding the Meta component to the skeleton * fixed condition * removed condition and added withoutSeo for settings pages * using translations for create team page further fixed flicker for window title * fixed flicker for window title for event-type creation page * fixed flicker for window title for availability creation page * fixed flicker for window title for sso page * updated conferencing en translation * added meta.CTA back it was mistakenly removed * fixed flicker for workflows page * fixed missing variable * Update packages/ui/v2/core/Shell.tsx * Delete index.tsx * Update sso.tsx * Updates subdmoules Co-authored-by: maxi Co-authored-by: Peer Richelsen Co-authored-by: Omar López --- apps/web/components/apps/App.tsx | 2 +- .../components/eventtype/AvailabilityTab.tsx | 6 +- .../components/eventtype/EventAdvancedTab.tsx | 4 +- .../components/eventtype/EventSetupTab.tsx | 3 +- .../eventtype/EventTypeSingleLayout.tsx | 2 +- apps/web/pages/500.tsx | 5 +- apps/web/pages/availability/[schedule].tsx | 8 +- apps/web/pages/availability/index.tsx | 13 +++ apps/web/pages/bookings/[status].tsx | 6 +- apps/web/pages/event-types/[type]/index.tsx | 3 + apps/web/pages/event-types/index.tsx | 15 +++- apps/web/pages/settings/admin/apps.tsx | 20 ++++- .../pages/settings/admin/impersonation.tsx | 17 +++- apps/web/pages/settings/admin/index.tsx | 14 +++ apps/web/pages/settings/admin/users.tsx | 20 ++++- apps/web/pages/settings/billing/index.tsx | 15 +++- .../web/pages/settings/developer/api-keys.tsx | 13 +++ .../pages/settings/my-account/appearance.tsx | 20 ++++- .../pages/settings/my-account/calendars.tsx | 19 +++-- .../settings/my-account/conferencing.tsx | 21 ++++- .../web/pages/settings/my-account/general.tsx | 22 ++++- .../web/pages/settings/my-account/profile.tsx | 22 ++++- .../pages/settings/security/impersonation.tsx | 15 +++- apps/web/pages/settings/security/password.tsx | 13 +++ apps/web/pages/settings/security/sso.tsx | 14 +++ .../settings/security/two-factor-auth.tsx | 43 +++++++++- .../pages/settings/teams/[id]/appearance.tsx | 14 +++ .../web/pages/settings/teams/[id]/billing.tsx | 14 +++ .../web/pages/settings/teams/[id]/members.tsx | 14 +++ .../web/pages/settings/teams/[id]/profile.tsx | 14 +++ apps/web/pages/settings/teams/[id]/sso.tsx | 14 +++ apps/web/pages/settings/teams/new/index.tsx | 19 ++++- apps/web/pages/teams/index.tsx | 14 +++ apps/web/pages/workflows/index.tsx | 14 +++ apps/web/public/static/locales/ar/common.json | 2 +- apps/web/public/static/locales/cs/common.json | 2 +- apps/web/public/static/locales/de/common.json | 15 +++- apps/web/public/static/locales/en/common.json | 14 ++- apps/web/public/static/locales/es/common.json | 2 +- apps/web/public/static/locales/fr/common.json | 2 +- apps/web/public/static/locales/he/common.json | 2 +- apps/web/public/static/locales/it/common.json | 2 +- apps/web/public/static/locales/ja/common.json | 2 +- apps/web/public/static/locales/ko/common.json | 2 +- apps/web/public/static/locales/nl/common.json | 2 +- apps/web/public/static/locales/pl/common.json | 2 +- .../public/static/locales/pt-BR/common.json | 2 +- apps/web/public/static/locales/pt/common.json | 2 +- apps/web/public/static/locales/ro/common.json | 2 +- apps/web/public/static/locales/ru/common.json | 2 +- apps/web/public/static/locales/sr/common.json | 2 +- apps/web/public/static/locales/sv/common.json | 2 +- apps/web/public/static/locales/tr/common.json | 2 +- apps/web/public/static/locales/uk/common.json | 2 +- apps/web/public/static/locales/vi/common.json | 2 +- .../public/static/locales/zh-CN/common.json | 2 +- .../public/static/locales/zh-TW/common.json | 2 +- package.json | 1 + .../ee/common/components/LicenseRequired.tsx | 13 +-- .../common/components/v2/LicenseRequired.tsx | 13 +-- .../ee/sso/components/SAMLConfiguration.tsx | 2 +- .../ee/teams/pages/team-appearance-view.tsx | 2 +- .../ee/teams/pages/team-billing-view.tsx | 3 +- .../ee/teams/pages/team-members-view.tsx | 2 +- .../ee/teams/pages/team-profile-view.tsx | 2 +- .../features/ee/workflows/pages/index.tsx | 8 +- .../webhooks/pages/webhook-edit-view.tsx | 2 +- .../webhooks/pages/webhook-new-view.tsx | 2 +- packages/ui/Kbar.tsx | 85 ++++++++++--------- packages/ui/v2/core/EmptyScreen.tsx | 4 +- packages/ui/v2/core/Shell.tsx | 2 - packages/ui/v2/core/apps/SkeletonLoader.tsx | 13 ++- .../ui/v2/core/layouts/SettingsLayout.tsx | 3 +- yarn.lock | 9 +- 74 files changed, 568 insertions(+), 141 deletions(-) diff --git a/apps/web/components/apps/App.tsx b/apps/web/components/apps/App.tsx index e2ec06701e..f390eab310 100644 --- a/apps/web/components/apps/App.tsx +++ b/apps/web/components/apps/App.tsx @@ -195,7 +195,7 @@ const Component = ({

{t("pricing")}

{price === 0 ? ( - "Free" + t("free_to_use_apps") ) : ( <> {Intl.NumberFormat("en-US", { diff --git a/apps/web/components/eventtype/AvailabilityTab.tsx b/apps/web/components/eventtype/AvailabilityTab.tsx index 0a9f307b91..c94b69675e 100644 --- a/apps/web/components/eventtype/AvailabilityTab.tsx +++ b/apps/web/components/eventtype/AvailabilityTab.tsx @@ -20,12 +20,13 @@ type AvailabilityOption = { const Option = ({ ...props }: OptionProps) => { const { label, isDefault } = props.data; + const { t } = useLocale(); return ( {label} {isDefault && ( - Default + {t("default")} )} @@ -34,12 +35,13 @@ const Option = ({ ...props }: OptionProps) => { const SingleValue = ({ ...props }: SingleValueProps) => { const { label, isDefault } = props.data; + const { t } = useLocale(); return ( {label} {isDefault && ( - Default + {t("default")} )} diff --git a/apps/web/components/eventtype/EventAdvancedTab.tsx b/apps/web/components/eventtype/EventAdvancedTab.tsx index 1ad322503b..6998a1eaa4 100644 --- a/apps/web/components/eventtype/EventAdvancedTab.tsx +++ b/apps/web/components/eventtype/EventAdvancedTab.tsx @@ -103,7 +103,7 @@ export const EventAdvancedTab = ({ eventType, team }: Pick diff --git a/apps/web/components/eventtype/EventSetupTab.tsx b/apps/web/components/eventtype/EventSetupTab.tsx index 0dd3715f00..1204d1d6b6 100644 --- a/apps/web/components/eventtype/EventSetupTab.tsx +++ b/apps/web/components/eventtype/EventSetupTab.tsx @@ -130,6 +130,7 @@ export const EventSetupTab = ( {validLocations.length === 0 && (