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

Can it be refreshed method #2

Open
visualczm opened this issue Oct 28, 2020 · 2 comments
Open

Can it be refreshed method #2

visualczm opened this issue Oct 28, 2020 · 2 comments

Comments

@visualczm
Copy link

Hi zHaytam,

 LocalizationManager.Instance.CurrentCulture = CultureInfo.GetCultureInfo("zh-CN");
//Whenever the CurrentCulture changes, the whole application is automatically updated without the need to restart it.

Can it be refreshed method?
Because I re-edited the text, but did not change the language
Or what to do

This project helped me a lot, thank you~

@zHaytam
Copy link
Owner

zHaytam commented Oct 29, 2020

Hello,

I'm sorry this project was just me trying things out, and I assume you cloned it and added it in your solution right?
If that's the case, you can go ahead and add a method in LocalizationManager called Refresh like so:

public void Refresh()
{
    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(CultureInfo)));
}

This should help you!

@visualczm
Copy link
Author

visualczm commented Oct 30, 2020

@zHaytam
thank you lot.is help me !!!

but example not work .

public void Refresh()
{
    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(CultureInfo)));
}

fix i.E:

public void Refresh()
{
    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("CurrentCulture"));
}

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

No branches or pull requests

2 participants