Hello, I've created this PR to clean up the transl...
# i18n
a
Hello, I've created this PR to clean up the translatable strings within the cal.com project 🙌 https://github.com/calcom/cal.com/pull/7437
p
very nice, can you fix the merge conflict too?
a
Done! FYI @Peer @zomars the longer this PR goes unmerged the more conflicts it will have with other merged PR's that include locale changes
z
Just fixed conflicts myself
p
agree, lets get this merged asap
@Udit Takkar can you test if all strings work? go through the app and see if any strings are missing
u
@Aaron Presley @Peer https://github.com/calcom/cal.com/pull/7437 i found a lot of keys missing in the en.json that are being used
p
great discovery
a
Yes, the process of resolving conflicts results in a lot of strings being added back as I err'd on the side of accidentally including unneeded keys (vs removing needed ones) Will take a closer look at the PR today. thanks for the detailed review!
Discovered the problem, and am verifying the solution now. However thought this group would be interested in how I used ChatGPT to help me fix the bug. Basically, my regex looks for all strings in a given file, then checks whether that string exists within the list of known keys. If it does, then it's considered a used key and is removed from the list. At the end all remaining keys are considered unused. My regex was breaking on lines like the following:
Copy code
description={googleCalendarPresent ? "" : t("continue_to_install_google_calendar")}>
Basically the
""
was throwing off my regex. I really struggled to wrap my head around the correct regex to use here, so I figured I'd ask ChatGPT what it thought. Ultimately it didn't solve the problem for me, but it got my unblocked and (potentially) on the path for a working regex. Pretty fascinating 😅
Hello 👋 Following up here - I was able to update my script to create a more thorough deep dive into the translation keys throughout the codebase. Unfortunately, my availability to actually remove the keys from the codebase and foster the PR throughout a merge. However I updated my script to generate a report of sorts, and created this Issue with the information. This approach will allow for smaller PR's as I have time, that address only a few keys. I've closed the above PR as I unfortunately don't have the capacity to work on it. My apologies.