Resolve #40 language switching#51
Merged
Merged
Conversation
Collaborator
|
I love this feature, thank you so much for implementing it! I also got an error on line 56 of monologue_dropdown.gd saying that item_id is a String and it cannot be converted to an int. It's always appening when I select a node. |
Collaborator
|
In fact, I think it's because of the redesign of the characters. I tested with a new file and everything works. My bad. |
atomic-junky
approved these changes
Jan 19, 2025
atomic-junky
left a comment
Collaborator
There was a problem hiding this comment.
Looks good to me👍🏼
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Language switcher should work for the following:
The class
Localizablewhich extendsPropertyis added. Basically, values inLocalizableare always stored as Dictionary, where it will automatically get the currently selected language from the global language switcher. For example, if you have English and Spanish in the language switcher, and have Spanish selected, settingholaas a value inLocalizablewill be stored internally as:This dictionary is outputted only on
_to_dict(), but if you're just callinglocalizable.value, it has a getter to automatically retrieve the correct value based on the currently selected language. When selecting a language, it will trigger a GlobalSignal to refresh all node previews and side panel so that it will use the corresponding language's values.The .json and graph_edits now store an additional
languagesvariable. Each graph_edit keeps track of thecurrent_language_indexto support tab-switching. Undo/redo should automatically switch languages when needed.Example JSON Structure: SentenceNode
Before
After
Top-level addition:
Notes
For now, the following features are missing but could be useful in future: