Comments (7)
Sorry for the delay.
This is a sample app is created with the TemplateStudio. Let me know if you have any questions.
TemplateStudioWinUI3LocalizerSampleApp
from winui3localizer.
Hi! Is your app a packaged app (default) ? or a non-packaged app?
from winui3localizer.
It's is packaged app sir, Generated with Template Studio.
from winui3localizer.
I'm working on a sample app generated with the TemplateStudio. Just give me a few days🔥
from winui3localizer.
Thanks, appreciated so much 🙏
from winui3localizer.
Sir,
When i try to initialize the localizer, strangely this exception will throw. any idea why?
WinUI3Localizer.LocalizerException: 'Failed to set language. [{PreviousLanguage} -> {NextLanguage}]'
from winui3localizer.
Sorry. That exception message is going to be fixed in the next version.
You might get this message when the SetLanguage(string language)
method is called but failed to find the language
.
This is how the SetLanguage
method is implemented inside the WinUI3Localizer
.
public async Task SetLanguage(string language)
{
string previousLanguage = CurrentDictionary.Language;
try
{
if (this.languageDictionaries.TryGetValue(
language,
out LanguageDictionary? dictionary) is true &&
dictionary is not null)
{
CurrentDictionary = dictionary;
await LocalizeDependencyObjects();
OnLanguageChanged(previousLanguage, CurrentDictionary.Language);
return;
}
}
catch (LocalizerException)
{
throw;
}
catch (Exception exception)
{
ThrowLocalizerException(exception, "Exception setting language. [{PreviousLanguage} -> {NextLanguage}]", previousLanguage, language);
}
ThrowLocalizerException(innerException: null, "Failed to set language. [{PreviousLanguage} -> {NextLanguage}]", previousLanguage, language);
return;
}
My first guess is that you are not setting the DefaultLanguage
in the options:
ILocalizer localizer = await new LocalizerBuilder()
.SetOptions(options =>
{
options.DefaultLanguage = "YOUR DEFAULT LANGUAGE";
}
.Build();
You also need to make sure that your default language is added as a LanguageDictionary
.
from winui3localizer.
Related Issues (20)
- Hyperlink does not get localized when it has default content
- Can I name the .resw files differnently, eg, <PRJNAME>.resw? HOT 1
- Unpackaged sample in README is not correct HOT 1
- MVVM Pattern HOT 4
- FlowDirection not working HOT 2
- multiple resources HOT 4
- Localizing DLLs HOT 2
- Add support for factoring strings into multiple resources files HOT 4
- Options.UseUidWhenLocalizedStringNotFound does not work with Uid on XAML
- Add support for auto populate external string resources files (Resoures.resw)
- How to change language without restart the app? HOT 2
- Add support for attached properties HOT 3
- Add support for brush properties
- Resource key without suffix ".content", ".text" etc. HOT 20
- Localizing Microsoft.UI.Xaml.Controls.CalendarDatePicker weekday and month name HOT 2
- Dynamically Loading a String Dictionary at Runtime HOT 1
- Example for Language Change HOT 2
- Can't change language HOT 23
- How to use this package for projects conststing of multiple DLLs resp. code projects? HOT 2
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 winui3localizer.