-
Notifications
You must be signed in to change notification settings - Fork 937
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
fix: Extra UI of searchBar #4252
Conversation
Looks good. But why did you change Search to Search for blocks? If we make that change, we'll need to update all the translations. Is it important? Also, in one place you use Search for Blocks. Elsewhere, Search for blocks. This adds an additional translation burden. |
Hey, @walterbender I think you're saying that I changed "Search for Blocks" to "Search".Changing "Search for blocks" to "Search" is important because it PREVENTS OVERFLOW OF TEXT outside the Search Bar Widget.I completely understood the problem of translation burden."Search" doesn't have a translation of it's own.But after reading the translation files, I realized that translation for "search" is available but not for "Search" (with capital 'S' ).So, we don't need AN EXTRA translation for "Search" in each and every translation file:So, I made a javascript function which: (for example)1) Converts "Search" -> "search" -> "put search to translation"2) "translated (example, in spanish) buscar" -> "capitalization of buscar's first letter" -> "Buscar" -> "Displays Buscar"Here's the preview of different languages: (Spanish, Hindi, and English respectively.)WhatsApp.Video.2025-01-12.at.10.43.47.AM.mp4This function also helps in the future, since now, whenever we have to write the first letter of any word in capital and THAT translation doesn't exist, we can simply put the text inside the function.It works for every language, you may check for others as well. |
The translateText method is a nice idea but I think it belongs in the _() method. I could imagine a flow such as: There really isn't a problem with block names in search itself, since they are all lower case. I initially raised the issue because of the inconsistency of the placeholder text. |
You're COMPLETELY correct about that. @walterbender sir. We can directly change the _() method rather than making a new function.Following your advice, I improved the _() method. Now it will automatically search thoroughly.Now:
Preview:Languages where english letters are usedMusic.Blocks.-.Google.Chrome.2025-01-13.01-25-27.mp4Languages where symbol letters are usedMusic.Blocks.-.Google.Chrome.2025-01-13.01-24-42.mp4This piece of code might actually help as well in future if new words have to added, reducing translation burden problems. |
Could you please make the utils.js changes in a separate PR? |
done, In Pull Request: #4265 |
I think we've opted for the other solution. Thx. |
Fixed Search Bar UI
the searchBar UI was overflowing and too big earlier, fixed it while maintaining the 'search blocks' functionality.
fixes: #3804
UI earlier:
Music.Blocks.is.a.collection.of.tools.for.exploring.fundamental.musical.concepts.in.a.fun.way.-.Google.Chrome.2025-01-10.16-18-22.mp4
UI now
Music.Blocks.-.Google.Chrome.2025-01-10.16-17-13.mp4
Changes made:
Fixed the UI of the extra search bar by overlapping the extra UI to completely match the beneath one. This would allow us to have the same functionality without shifting the entire functionality to the beneath search block.