Skip to content
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: localization token dropdown #87

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

anastasiia-sotnykova
Copy link
Contributor

Purpose of this PR

Added option to select localization token from available tokens in selected sheet.

Testing status

  • No tests have been added.

Manual testing status

Tested in the editor using created Sample scene.

Copy link
Contributor

@alexey-yaremenko alexey-yaremenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great update so far! I highlighted a few concerns in the code.
Please, address those. If you have any questions - let me know, would be happy to help.


internal void FinalizeDataUpdate()
{
OnDataStoredOnDisk?.Invoke();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
OnDataStoredOnDisk?.Invoke();
OnDataStoredOnDisk.Invoke();

Redundant null-check here. If you initialize event Action with an empty delegate (just like on Line 55), there is no need to check it for a null before invocation.

/// <summary>
/// An event track the saving of spreadsheet data.
/// </summary>
public event Action OnDataStoredOnDisk = delegate { };
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public event Action OnDataStoredOnDisk = delegate { };
public event Action<DataStoredOnDiskArgs> OnDataStoredOnDisk = delegate { };

We should consider providing an Arguments struct for this event Action (yes, it will be just an empty struct DataStoredOnDiskArgs{} for the moment). It will save us from breaking changes in future updates. Just in case we will need to pass additional data with this Action.

/// <summary>
/// Notify that the language settings of the spreadsheet have been changed
/// </summary>
void NotifyLanguageChanged()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
void NotifyLanguageChanged()
void OnDataStoredOnDiskHandler()

The callback method name is out of our convention. Please, consider renaming.

/// </summary>
void NotifyLanguageChanged()
{
OnLanguageChanged?.Invoke();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant null-check here. If you initialize event Action with an empty delegate (just like on Line 12), there is no need to check it for a null before invocation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants