-
-
Notifications
You must be signed in to change notification settings - Fork 183
feat: make glossary entries work in other languages #687
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
feat: make glossary entries work in other languages #687
Conversation
If changes are okay, please label it for Hacktoberfest |
Thanks for the help! This currently doesn't work because it tries to underline the English keywords in other languages. For example, in Spanish, "function" becomes "función" so we should underline the work "función" when the language is set to Spanish. To achieve that, you'll need to update The way it works right now is we make a big regex with all the glossary terms to find and use a regex replace to find and underline them. But it's only done in English. Let me know if you have any questions or need a hand. |
Yes, you right. To handle this for other languages like Spanish, there are more work to do. As you already wrote. I will think about it how to archive this, if you have already something in mind i would appreciate if you shared it with me 😊 Should this done with an addtional PR or in this one? Thank you for your help. |
Thanks. I'd prefer this to be done in this PR because otherwise, fixing this bug the way it's currently done will introduce a separate bug for people using other languages. We might as well handle both cases at once. |
If we create/read the glossary after TranslationManager is ready and also recreate it after a languange switch. But not completely sure if these changes are wanted. |
Rebuilding the glossary on a language change and changing the highlighted keywords at that time sounds good to me, it's a good approach! |
I did these changes in my last commit 959c670 In my test it works as expected: Edit: |
Thank you Nathan. Just want to use the change, writing with you. To say Thank you! of course to you and the whole GDQuest-Team. But also to all the work you (GDQuest) put into the OpenSource-Community, the GameDevelopment community. So, yeah im not so good with words. But wanted to let you know. An just once again Thank you.. |
Thanks :) |
Please check if the PR fulfills these requirements:
Related issue (if applicable): #685
What kind of change does this PR introduce?
Emit the "translation_changed" signal from the TranslationManager when the language is set.
Listen to this signal in UILesson.gd and trigger the new defined function
_underline_glossary_entries
for Underline glossary entries.