-
Notifications
You must be signed in to change notification settings - Fork 45
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
Comparison #2
Comments
if you using VisualStudio, visit https://github.com/netcharm/ngettextutils , it's a small, simple toolkit for NGettext, It's extracting text from from/xaml design file to PO file, and using xgettext extracting text from .cs source file. |
Yet another one :) Personally I'd prefer a purely managed approach/implementation, but I'll have a look anyway. Thanks ! |
you can modify/create new functions of the source for you like... :P |
It's now 2021, and it looks like Vernacular and SecondLanguage haven't received any updates in quite a while. Vernacular's last update was on Jun 17, 2016 It's probably reasonable to declare both of these projects dead. |
If I can toss in my experience, I'd like to describe how NGettext fits into the ecosystem as being the most relied on and probably the most complete implementation of the Gettext standard available today (September 2021) for use in the .Net ecosystem. It is available as an easy to install nuget package as well as through the source code in this repository. The nuget package has been downloaded 468,371 times as of the time of writing this comment. The next most downloaded nuget package (that actually supports the use of po and mo files, rather than the generation of them) is SecondLanguage at 71,068 total downloads, less than a quarter of the downloads of NGettext. Unfortunately, SecondLanguage, which I mentioned in my previous comment, appears to have gone stale, since it's last update was in 2017. As for features and functionality, NGettext provides (almost) identical l10n and i18n syntax in your .Net (framework/standard/core) source code to what is described for C/C++ and C# in the GNU gettext documentation. This means that it is a relatively simple matter to use the GNU gettext tool chain to extract translations from your code and compile PO files into MO files.Since NGettext already follows the rules described for C# in the gettext language documentation for C# (which is pretty cool if you ask me), all of the instructions provided in the gettext documentation for xgettext and the like apply directly to the source code you write using NGettext for localization. See these sections of the gettext documentation's index for links to the gettext utilities docs:
This is a huge advantage to the NGettext project because it reduces the need to write massive amounts of specialized documentation regarding the usage of this library, and how to extract, manipulate, and compile your localized text. The tools provided by GNU are useful if you want to add translation activities to your CI/CD pipelines.
From what I can tell, this is where NGettext differs from the other options available today. Microsoft discusses po files here, where they describe using a library/nuget package named Orchard Core, however after reviewing the docs and details about Orchard Core, I feel that it is far inferior to NGettext, due to it's syntax being vastly different from the original GNU gettext specification. It is possible that I am missing some advantage of Orchard Core when it is used in the context of the Furthermore, while it's mostly a work in progress, I've been working on adding functionality to NGettext to give it almost the exact same If you're curious, I've created a Pull Request to bring my new syntactic sugar into the full NGettext repository that you can find here: #38 |
What Orchad does well is implements IHtmlLocalizer and IStringLocalizer, so using GNU-GetText PO/MO files or Ressources Manager resx files become an implementation detail. It also manage "catalogs" for you, like which request uses which catalog. Reading them at application start and caching them. But the actual implementation of GetText seems minimalist. And only PO file parsing. Some IStringLocalizer wrapper + LocalizationManager from Orchad Core + GetText management from this library migth be the ideal setup in an asp.net situation. |
Comment, and questions in similar motivation around NGettext, actually.
Would be happy for the insights around any, some, or all of these concerns. Cheers 🍻 and thanks! |
Hi,
There seem to be a lot of i18n gettext-inspired-c# libraries, though at first sight yours seems the cleanest (UTs, CI, interface-API, pure gettext).
Though some provide more features, e.g.:
Any thoughts around those other i18n libs and how ngettext fits ?
Thx
The text was updated successfully, but these errors were encountered: