-
-
Notifications
You must be signed in to change notification settings - Fork 134
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
Support for a fallback assembly #278
Comments
Hello! |
Thanks for the suggestion! I thought about this as well, but I'm not able to get the MissingKeyEvent to work properly. I tried to match my project with the sample one, but I can't really understand what's going on. I've setup the main Window of the app like this:
Then, in the code behind, I have the following code:
Then, I have a Button control in the page which points to my custom assembly:
The ModernWpfDemo.LocalOverride contains another Strings.resx file, where the key btnChangeLanguage_Content is missing. Overall, the whole behavior is quite strange. I've tried also to change another TextBlock control to manually point to a key that doesn't exist:
The outcome is that, in my window, I see a TextBlock with text "Key: Test", while I would have expected to see the MissingKeyEvent being triggered. Do you have any idea what am I missing? |
Please, in MainMenu move InitializeComponent after the subscription. The problem is that all event generated before subscription. About Button. You do not spicife key in yours |
Yes, this is OK. But unfortunetly |
Thanks @Karnah , by moving the InitializeComponent() after the subscription I've been able to fix the first problem. I will do some more experiment tomorrow. Thanks a lot for your help! |
You are always welcome :) I think there is another way to solve this issue - create your own |
@qmatteoq, do you have any other questions or this issue can be closed? :) |
Hello, I'm trying to implement a scenario with the WPF Localization Extension, but I can't find a way to do it, so I wanted to check if it's indeed a missing feature or if there's any workaround.
Here is my scenario, based on an application which is distributed to multiple customizers, who can require a specific customization of the base app.
My goal, as such, would be to provide to the application a basic .resx file and then, for the same language, provide another one with the same keys (not all of them, just a few) that should override the basic localization.
I tried to implement this scenario by setting the ResxLocalizationProvider.DefaultAssembly property directly to the controls that must support this scenario and to include the customized resources files in a separate class library. However, the problem is that I don't see a way to specify a "Fallback assembly" to use in case the resource isn't present in the customized resource file.
My goal would be to achieve something like "as first priority, take the resource from the custom resource file but, if the key isn't available, fallback to the basic one I've specified for the whole Windows / Page / UserControl".
Is there a way to satisfy this scenario with the current implementation?
Thanks!
The text was updated successfully, but these errors were encountered: