feat: add language switcher (#1337)

## Description

Web changes:

- Enabled i18n for web
- Add option to change language in command menu
- Add option to change language in menu-switcher

Web and marketing changes:

- Stop setting 'en' preference into cookie if the user's language is not
supported
- Dropped middleware changes
- Rotated cookie from 'i18n' to 'language'

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **New Features**
- Introduced a language switcher in the footer for improved language
selection.
	- Added dynamic language change functionality in the command menu.
- Implemented a dropdown menu item for quick access to the language
switcher.

- **Bug Fixes**
- Resolved issues related to language change notifications and state
management.

- **Translations**
- Added new translation entries for improved language support, including
"Search languages..." in English and German.
	- Updated existing translations to enhance clarity and accuracy.

- **Chores**
	- Simplified internationalization handling in middleware.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: github-actions <github-actions@documenso.com>
This commit is contained in:
David Nguyen
2024-09-11 13:22:43 +10:00
committed by GitHub
parent 7b06b68572
commit 357bdd374f
18 changed files with 241 additions and 196 deletions

View File

@ -298,7 +298,7 @@ msgstr "Adding and removing seats will adjust your invoice accordingly."
msgid "Admin Actions"
msgstr "Admin Actions"
#: apps/web/src/components/(dashboard)/layout/menu-switcher.tsx:257
#: apps/web/src/components/(dashboard)/layout/menu-switcher.tsx:262
msgid "Admin panel"
msgstr "Admin panel"
@ -306,7 +306,7 @@ msgstr "Admin panel"
msgid "All"
msgstr "All"
#: apps/web/src/components/(dashboard)/common/command-menu.tsx:37
#: apps/web/src/components/(dashboard)/common/command-menu.tsx:42
msgid "All documents"
msgstr "All documents"
@ -322,7 +322,7 @@ msgstr "All inserted signatures will be voided"
msgid "All recipients will be notified"
msgstr "All recipients will be notified"
#: apps/web/src/components/(dashboard)/common/command-menu.tsx:52
#: apps/web/src/components/(dashboard)/common/command-menu.tsx:57
msgid "All templates"
msgstr "All templates"
@ -476,6 +476,7 @@ msgstr "An error occurred while uploading your document."
#: apps/web/src/app/(dashboard)/settings/profile/delete-account-dialog.tsx:63
#: apps/web/src/app/(signing)/sign/[token]/complete/claim-account.tsx:98
#: apps/web/src/app/(teams)/t/[teamUrl]/settings/team-transfer-status.tsx:54
#: apps/web/src/components/(dashboard)/common/command-menu.tsx:301
#: apps/web/src/components/(dashboard)/settings/token/delete-token-dialog.tsx:97
#: apps/web/src/components/(dashboard)/settings/webhooks/delete-webhook-dialog.tsx:88
#: apps/web/src/components/(teams)/dialogs/add-team-email-dialog.tsx:100
@ -788,7 +789,7 @@ msgstr "Complete Viewing"
msgid "Completed"
msgstr "Completed"
#: apps/web/src/components/(dashboard)/common/command-menu.tsx:43
#: apps/web/src/components/(dashboard)/common/command-menu.tsx:48
msgid "Completed documents"
msgstr "Completed documents"
@ -922,8 +923,8 @@ msgstr "Create now"
msgid "Create one automatically"
msgstr "Create one automatically"
#: apps/web/src/components/(dashboard)/layout/menu-switcher.tsx:176
#: apps/web/src/components/(dashboard)/layout/menu-switcher.tsx:246
#: apps/web/src/components/(dashboard)/layout/menu-switcher.tsx:181
#: apps/web/src/components/(dashboard)/layout/menu-switcher.tsx:251
#: apps/web/src/components/(teams)/dialogs/create-team-dialog.tsx:138
#: apps/web/src/components/(teams)/dialogs/create-team-dialog.tsx:146
msgid "Create team"
@ -1003,7 +1004,7 @@ msgstr "Current plan: {0}"
msgid "Daily"
msgstr "Daily"
#: apps/web/src/components/(dashboard)/common/command-menu.tsx:255
#: apps/web/src/components/(dashboard)/common/command-menu.tsx:265
msgid "Dark Mode"
msgstr "Dark Mode"
@ -1313,7 +1314,7 @@ msgstr "Document will be permanently deleted"
#: apps/web/src/app/(dashboard)/documents/documents-page-view.tsx:110
#: apps/web/src/app/(profile)/p/[url]/page.tsx:166
#: apps/web/src/app/not-found.tsx:21
#: apps/web/src/components/(dashboard)/common/command-menu.tsx:200
#: apps/web/src/components/(dashboard)/common/command-menu.tsx:205
#: apps/web/src/components/(dashboard)/layout/desktop-nav.tsx:18
#: apps/web/src/components/(dashboard)/layout/mobile-navigation.tsx:35
#: apps/web/src/components/ui/user-profile-timur.tsx:60
@ -1355,7 +1356,7 @@ msgstr "Download Certificate"
msgid "Draft"
msgstr "Draft"
#: apps/web/src/components/(dashboard)/common/command-menu.tsx:41
#: apps/web/src/components/(dashboard)/common/command-menu.tsx:46
msgid "Draft documents"
msgstr "Draft documents"
@ -1682,7 +1683,7 @@ msgstr "If your authenticator app does not support QR codes, you can use the fol
msgid "Inbox"
msgstr "Inbox"
#: apps/web/src/components/(dashboard)/common/command-menu.tsx:47
#: apps/web/src/components/(dashboard)/common/command-menu.tsx:52
msgid "Inbox documents"
msgstr "Inbox documents"
@ -1772,6 +1773,10 @@ msgstr "It seems that there is no token provided, if you are trying to verify yo
msgid "It seems that there is no token provided. Please check your email and try again."
msgstr "It seems that there is no token provided. Please check your email and try again."
#: apps/web/src/components/(dashboard)/layout/menu-switcher.tsx:286
msgid "Language"
msgstr "Language"
#: apps/web/src/components/(dashboard)/period-selector/period-selector.tsx:61
msgid "Last 14 days"
msgstr "Last 14 days"
@ -1809,7 +1814,7 @@ msgstr "Leave"
msgid "Leave team"
msgstr "Leave team"
#: apps/web/src/components/(dashboard)/common/command-menu.tsx:254
#: apps/web/src/components/(dashboard)/common/command-menu.tsx:264
msgid "Light Mode"
msgstr "Light Mode"
@ -1899,7 +1904,7 @@ msgstr "Manage subscriptions"
msgid "Manage team subscription."
msgstr "Manage team subscription."
#: apps/web/src/components/(dashboard)/layout/menu-switcher.tsx:163
#: apps/web/src/components/(dashboard)/layout/menu-switcher.tsx:168
msgid "Manage teams"
msgstr "Manage teams"
@ -2053,7 +2058,7 @@ msgstr "No recent activity"
msgid "No recipients"
msgstr "No recipients"
#: apps/web/src/components/(dashboard)/common/command-menu.tsx:195
#: apps/web/src/components/(dashboard)/common/command-menu.tsx:200
msgid "No results found."
msgstr "No results found."
@ -2145,7 +2150,7 @@ msgid "Otherwise, the document will be created as a draft."
msgstr "Otherwise, the document will be created as a draft."
#: apps/web/src/app/(dashboard)/admin/documents/document-results.tsx:86
#: apps/web/src/components/(dashboard)/layout/menu-switcher.tsx:76
#: apps/web/src/components/(dashboard)/layout/menu-switcher.tsx:81
msgid "Owner"
msgstr "Owner"
@ -2190,7 +2195,7 @@ msgstr "Passkeys allow you to sign in and authenticate using biometrics, passwor
msgid "Passkeys are not supported on this browser"
msgstr "Passkeys are not supported on this browser"
#: apps/web/src/components/(dashboard)/common/command-menu.tsx:65
#: apps/web/src/components/(dashboard)/common/command-menu.tsx:70
#: apps/web/src/components/forms/password.tsx:123
#: apps/web/src/components/forms/reset-password.tsx:110
#: apps/web/src/components/forms/signin.tsx:344
@ -2224,7 +2229,7 @@ msgstr "Payment overdue"
msgid "Pending"
msgstr "Pending"
#: apps/web/src/components/(dashboard)/common/command-menu.tsx:46
#: apps/web/src/components/(dashboard)/common/command-menu.tsx:51
msgid "Pending documents"
msgstr "Pending documents"
@ -2240,11 +2245,11 @@ msgstr "Pending invitations"
msgid "Pending team deleted."
msgstr "Pending team deleted."
#: apps/web/src/components/(dashboard)/layout/menu-switcher.tsx:129
#: apps/web/src/components/(dashboard)/layout/menu-switcher.tsx:134
msgid "Personal"
msgstr "Personal"
#: apps/web/src/components/(dashboard)/layout/menu-switcher.tsx:72
#: apps/web/src/components/(dashboard)/layout/menu-switcher.tsx:77
msgid "Personal Account"
msgstr "Personal Account"
@ -2328,7 +2333,7 @@ msgstr "Please try again later."
msgid "Please type <0>{0}</0> to confirm."
msgstr "Please type <0>{0}</0> to confirm."
#: apps/web/src/components/(dashboard)/common/command-menu.tsx:209
#: apps/web/src/components/(dashboard)/common/command-menu.tsx:214
msgid "Preferences"
msgstr "Preferences"
@ -2346,7 +2351,7 @@ msgid "Private templates can only be modified and viewed by you."
msgstr "Private templates can only be modified and viewed by you."
#: apps/web/src/app/(dashboard)/settings/profile/page.tsx:28
#: apps/web/src/components/(dashboard)/common/command-menu.tsx:64
#: apps/web/src/components/(dashboard)/common/command-menu.tsx:69
#: apps/web/src/components/(dashboard)/settings/layout/desktop-nav.tsx:36
#: apps/web/src/components/(dashboard)/settings/layout/mobile-nav.tsx:39
msgid "Profile"
@ -2665,8 +2670,8 @@ msgid "Set a password"
msgstr "Set a password"
#: apps/web/src/app/(dashboard)/settings/layout.tsx:20
#: apps/web/src/components/(dashboard)/common/command-menu.tsx:60
#: apps/web/src/components/(dashboard)/common/command-menu.tsx:206
#: apps/web/src/components/(dashboard)/common/command-menu.tsx:65
#: apps/web/src/components/(dashboard)/common/command-menu.tsx:211
#: apps/web/src/components/(dashboard)/layout/mobile-navigation.tsx:47
msgid "Settings"
msgstr "Settings"
@ -2750,7 +2755,7 @@ msgstr "Sign In"
msgid "Sign in to your account"
msgstr "Sign in to your account"
#: apps/web/src/components/(dashboard)/layout/menu-switcher.tsx:285
#: apps/web/src/components/(dashboard)/layout/menu-switcher.tsx:297
#: apps/web/src/components/(dashboard)/layout/mobile-navigation.tsx:84
msgid "Sign Out"
msgstr "Sign Out"
@ -2956,7 +2961,7 @@ msgstr "Success"
msgid "Successfully created passkey"
msgstr "Successfully created passkey"
#: apps/web/src/components/(dashboard)/common/command-menu.tsx:256
#: apps/web/src/components/(dashboard)/common/command-menu.tsx:266
msgid "System Theme"
msgstr "System Theme"
@ -3041,7 +3046,7 @@ msgstr "Team ownership transferred!"
msgid "Team Public Profile"
msgstr "Team Public Profile"
#: apps/web/src/components/(dashboard)/layout/menu-switcher.tsx:272
#: apps/web/src/components/(dashboard)/layout/menu-switcher.tsx:277
msgid "Team settings"
msgstr "Team settings"
@ -3067,7 +3072,7 @@ msgid "Team URL"
msgstr "Team URL"
#: apps/web/src/app/(dashboard)/settings/teams/page.tsx:25
#: apps/web/src/components/(dashboard)/layout/menu-switcher.tsx:157
#: apps/web/src/components/(dashboard)/layout/menu-switcher.tsx:162
#: apps/web/src/components/(dashboard)/layout/mobile-navigation.tsx:43
#: apps/web/src/components/(dashboard)/settings/layout/desktop-nav.tsx:64
#: apps/web/src/components/(dashboard)/settings/layout/mobile-nav.tsx:67
@ -3113,7 +3118,7 @@ msgstr "Template saved"
#: apps/web/src/app/(dashboard)/templates/[id]/template-page-view.tsx:60
#: apps/web/src/app/(dashboard)/templates/templates-page-view.tsx:55
#: apps/web/src/components/(dashboard)/common/command-menu.tsx:203
#: apps/web/src/components/(dashboard)/common/command-menu.tsx:208
#: apps/web/src/components/(dashboard)/layout/desktop-nav.tsx:22
#: apps/web/src/components/(dashboard)/layout/mobile-navigation.tsx:39
msgid "Templates"
@ -3521,7 +3526,7 @@ msgstr "Type"
msgid "Type 'delete' to confirm"
msgstr "Type 'delete' to confirm"
#: apps/web/src/components/(dashboard)/common/command-menu.tsx:181
#: apps/web/src/components/(dashboard)/common/command-menu.tsx:186
msgid "Type a command or search..."
msgstr "Type a command or search..."
@ -3529,6 +3534,10 @@ msgstr "Type a command or search..."
msgid "Uh oh! Looks like you're missing a token"
msgstr "Uh oh! Looks like you're missing a token"
#: apps/web/src/components/(dashboard)/common/command-menu.tsx:303
msgid "Unable to change the language at this time. Please try again later."
msgstr "Unable to change the language at this time. Please try again later."
#: apps/web/src/components/forms/2fa/recovery-code-list.tsx:31
msgid "Unable to copy recovery code"
msgstr "Unable to copy recovery code"
@ -3727,7 +3736,7 @@ msgstr "User ID"
msgid "User profiles are here!"
msgstr "User profiles are here!"
#: apps/web/src/components/(dashboard)/layout/menu-switcher.tsx:264
#: apps/web/src/components/(dashboard)/layout/menu-switcher.tsx:269
msgid "User settings"
msgstr "User settings"
@ -4359,7 +4368,7 @@ msgstr "Your document has been uploaded successfully."
msgid "Your document has been uploaded successfully. You will be redirected to the template page."
msgstr "Your document has been uploaded successfully. You will be redirected to the template page."
#: apps/web/src/components/(dashboard)/common/command-menu.tsx:215
#: apps/web/src/components/(dashboard)/common/command-menu.tsx:223
msgid "Your documents"
msgstr "Your documents"