-
Notifications
You must be signed in to change notification settings - Fork 1
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
Huge Overhaul #47
Merged
Huge Overhaul #47
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I've got a much nicer way of doing localized bindings, this currently supports 1:1 parameter to binding but that's a great start!
There is now a markup extension for binding to enums. The implementation works well and I'm going to enhance it so everything to do with enums is configurable!
Added the ability to specify how mocale deals with enums in order to grab a translation key using attributes etc. There is global settings and overrides for specific types!
I now have a good working sample of code only, I've integrated with markup ui so its easy to mocalize without using xaml!
I've added a testing mechanism for mocale since its not friendly to test the behavior at all. There is now a proxy class that does all the bits without the jazz and can be used in unit tests to emulate whats happening at runtime.
Everything is now versioned centrally using the packages.props file. I've updated packages where applicable and also remove maui compatibility references
I've added some csproj glitter to automatically reference mocale resources as EmbeddedResource and AdditionalFiles by default, the user can override them also!
There is now the ability to multibind for a list of bindings, this was alot less strife than I anticipated
I broke the tests by design of the fix earlier in this branch for the race condition. I have now made an internal abstraction for the translator manager which can be moq tested, this is also part of the proxy
Minimum allowed coverage is Generated by 🐒 cobertura-action against 5e50ca0 |
All of the build warnings have been addressed ready for merging
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is a mish mash of upgrades and enhancements that I had been planning for sometime:
LocalizeBinding
for explicitly binding to a property. This now correctly changes language when locales change.EmbeddedResource
andAdditionalFiles
items at default location ("Resources/Locales/"
) + ability to override itLocalizeEnum
, these by default will pull translation keys from the[Description]
attribute but this behaviour is fully configurable for the library and for individual enums.LocalizeMultiBinding
for localizing when using 2 or more bindings as the format parameters.Mocale.Testing
a new package for allowing users to easily run mocale code in unit tests. The reason for this is usingSetTranslation
in a unit test requires mocale to be setup and the behaviour ofMock<ITranslatorManager
isn't quite up to scratch since it needs to invokeINotifyPropertyChanged
, I had personally been using a proxy class so I have made that part of this library.Binding
andParameters
onLocalize
markup extension, please use the dedicated bindings now since these actually update with locale changes!