Comments (4)
Ok I published :
- CodingSeb.Localization : 1.1.2.0
- CodingSeb.Localization.JsonfileLoader : 1.1.2.0
- CodingSeb.Localization.YamlFileLoader : 1.1.2.0
- CodingSeb.Localization.WPF : 1.1.5.0
To allow hot reloading of files and implement the method RaiseLanguageChangeEvents
in class Loc
.
I also implemented an example of hot reloading in CodingSeb.Localization.Examples.
See :
<Button x:Name="LanguageChangedRefreshButton"
DockPanel.Dock="Right"
Content="Refresh"
Click="LanguageChangedRefreshButton_Click" />
private void LanguageChangedRefreshButton_Click(object sender, RoutedEventArgs e)
{
Languages.ReloadFiles();
Loc.Instance.RaiseLanguageChangeEvents();
}
- And in Languages.cs
public static void ReloadFiles()
{
string exampleFileFileName = Path.Combine(languagesFilesDirectory, "Example1.loc.json");
LocalizationLoader.Instance.ClearAllTranslations();
LocalizationLoader.Instance.AddFile(exampleFileFileName);
}
from localization.
Hello again @linhmc
Yes it's a good idea. Thanks for it.
I will include it in Loc.cs as soon as possible and publish a new CodingSeb.Localization version
from localization.
Hi @codingseb
In Loc.cs class I suggest add method.
public void RaiseLanguageChange()
{
TMLanguageChangingEventArgs changingArgs = new TMLanguageChangingEventArgs(currentLanguage, currentLanguage);
TMLanguageChangedEventArgs changedArgs = new TMLanguageChangedEventArgs(currentLanguage, currentLanguage);
CurrentLanguageChanging?.Invoke(this, changingArgs);
if (!changingArgs.Cancel)
{
CurrentLanguageChanged?.Invoke(this, changedArgs);
}
}
Developer can invoke to update language. Please consider.
from localization.
Many thanks @codingseb.
from localization.
Related Issues (6)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from localization.