cal.com icon indicating copy to clipboard operation
cal.com copied to clipboard

Cal.com website breaks when language change button pressed

Open thepradipvc opened this issue 1 year ago • 4 comments

Issue Summary

On the homepage of Cal.com. When I press the language change button in the footer, the website breaks saying a client-side exception happened.

Steps to Reproduce

  1. Go to the footer of the Cal.com website
  2. Press the button saying "English" and the languages icon.
  3. The website breaks.

Actual Results

The website is breaking with a client-side exception.

Expected Results

There should be an option to change the language

Technical details

  • Happening in all the latest browsers.

Evidence

https://www.loom.com/share/8873a67ae3914fb498051824cdd9e6a8?sid=839d0754-9050-4cdb-8938-db7818108ec8

thepradipvc avatar May 01 '24 05:05 thepradipvc

Hey there, @thepradipvc! 👋 I'm Dosu, a friendly bot here to tackle bugs, answer your queries, and guide you through contributing while we wait for a human maintainer to join us. I'm diving into your issue about the language toggle snafu on Cal.com and will get back to you with some insights real soon. 🛠️😄

dosubot[bot] avatar May 01 '24 05:05 dosubot[bot]

I was trying to find the code for this but couldn't. Then I stumbled upon the cal.com handbook where there is a mention of the website app. But I couldn't find any app named website. Is is not public or what? image

thepradipvc avatar May 01 '24 05:05 thepradipvc

The Cal.com website's code, including the functionality for changing languages, is located in the apps/web directory of the repository, referred to as @calcom/web within the apps/web/package.json. This is the "website app" mentioned in the Cal.com handbook.

For the language change issue you're encountering, it's related to how the website handles locale changes. The functionality involves dynamic locale and direction handling, particularly in the apps/web/pages/_document.tsx file, where the lang and dir attributes of the Html component are set based on the user's locale. This locale determination and setting are crucial for the language change feature to work correctly.

The translations for various text elements are stored in the apps/web/public/static/locales/ directory. The getLocale function from @calcom/features/auth/lib/getLocale is utilized to determine the user's locale, influencing the dynamic setting of language attributes on the website.

To assist further with the client-side exception you're facing, it would be beneficial to have the exact error message or details of the exception. This information would enable a more precise diagnosis of the issue.

Details

Sources


About Dosu This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

To continue the conversation, mention @dosu.

dosubot[bot] avatar May 01 '24 06:05 dosubot[bot]

Hey , Im new to the Open source contributing. I would like to solve this issue if it's possible. Do I need some approval or I can just fork the project and try to fix the issue?

mritosa avatar May 06 '24 11:05 mritosa

I think this issue is resolved

kmakkar20213 avatar Jun 17 '24 14:06 kmakkar20213

Thank you @kmakkar20213 for updating the status. I'm closing this issue.

thepradipvc avatar Jun 19 '24 16:06 thepradipvc