-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Fix: Prevent unnecessary title-case conversion in i18n helper function #4782
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Refactor translation logic to remove title case fallback.
|
✅ All Jest tests passed! This PR is ready to merge. |
|
LGTM but the issue still persisting ??? |
|
@omsuneri output from my branch |
|
✅ All Jest tests passed! This PR is ready to merge. |
|
@omsuneri Removed previously added cleanedText fallback (added earlier by me) to preserve original text exactly and avoid unwanted changes for punctuation-sensitive strings like musical notes or codes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes an issue where the i18n helper function was unintentionally modifying the casing of untranslated strings. The function previously attempted multiple fallback translation lookups with various text transformations (lowercase, title case, hyphenated), but when all translations failed, it would return title-cased text instead of the original. This caused problems with domain-specific strings like musical notes and codes that require specific casing.
Key changes:
- Removed all fallback translation attempts that modified text casing (lowercase, title case, hyphenated variants)
- Simplified the translation logic to preserve original text casing when no translation is found
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
✅ All Jest tests passed! This PR is ready to merge. |
|
@omsuneri Updated _getPitch(c) in block.js to decouple logic lookup from localized display
|
|
@ac-mmi issue is not recurring anymore |
omsuneri
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM



The
_function in our i18n helper was unnecessarily converting text to title case as a fallback when a translation was missing. This caused issues with domain-specific strings like musical notes, codes, and proper nouns where the original casing should be preserved.Changes made:
Fixes #4779