Adding True _() Syntactic Sugar to NGettext #38
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 adds some syntactic sugar to the NGettext implementation.
It allows you to initialize and use a default Catalog that can then be accessed throughout your software by simply prefixing strings with
_()
(no catalog object instance required)Contextual and Formatted strings are accessed by adding
c
and/orf
after the_
eg.
This behavior relies on
using static <fully qualified class name>
The current implementation uses a static class, but it might be worth while to convert the static class into a singleton.
Unfortunately, I haven't been able to get the NGettext Solution to compile on my machine, however I have gotten this static class to compile in another project I was working on that uses the existing NGettext nuget packages, so while I am not going to give up on compiling it, I would like others to get a look at what I've done.