-
-
Notifications
You must be signed in to change notification settings - Fork 31
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
Fallback-functionality #25
Comments
Any plans to support fallback-functionality? Sure, let me check why this not included, I already support this in some OSS |
FYI the fallback is here https://github.com/hishamco/My.Extensions.Localization.Json/blob/master/src/My.Extensions.Localization.Json/JsonStringLocalizer.cs#L119-L140 Are you sure it doesn't work, perhaps I need to add a unit test if it is not included yet |
That's really strange, to provide more accurate info: test.en-US.json
test.en.json
test.json
With an empty Test-class:
And then trying to access the values using Do you have an example where the fallback-functionality is used? Maybe I'm missing something. |
I know what you mean exactly, let me create a unit test for that |
Great, thanks for being so fast to respond! |
@thomkle seems the culture fallback works fine with |
It's already merged ;) feel free to use and try the latest bits |
Ah, great! I'll try out the last change. Could you push a NuGet package for it as well? |
@hishamco Seems to be working very well now, thanks! |
@hishamco Sorry to nag, but the fallback doesn't seem to work completely. E.g. say I have set the culture "es-ES", but there are no files .es-ES.json, but I have a .json. It will not fall back to values in .json. I also tested this creating unit tests after cloning the repo and it looks that the unit test fails.
I'll be happy to try to solve this my self and create pull requests, but I understand if you're more comfortable with solving things in the project yourself :) |
I'm not sure for now, but may be a pre release version will be fine |
Any plans to support fallback-functionality? E.g. say I have a TestController and the files testcontroller.es-ES.json, testcontroller.es.json and testcontroller.json. The fallback-functionality would first check the testcontroller.es-ES.json for the key, then the testcontroller.es.json and then testcontroller.json.
Edit: Like explained here
The text was updated successfully, but these errors were encountered: