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
Feature/icelandic language support #1116
Feature/icelandic language support #1116
Conversation
Make basic tests for accessing resources pass. Overload DefaultFormatter in IcelandicFormatter, having to trim plural endings that do not apply to Icelandic while anticipating gender rules for Icelandic localisation of time based units with month and day being masculine, year being neuter and others, eg. seconds and hours taking the feminine gender. This called for access to CultureInfo as base class does not expose this (improvement suggestion?). Register the Icelandic Formatter in Formatter Registry. Some code branches cannot be unit tested in formatter as e.g. Argument Exception can only be thrown if missing resource key. Dual and TrialQuadral resource strings not included as they do not apply to the Icelandic implementation.
Consisted of adding "og" to registry.
Similar tests as applied to e.g. German made to pass for Icelandic. Using Tölvuorðasafn and Íðorðasafn as base for using kB for kilobtytes and b as symbol for bit.
Relied on already translated resources and similar tests for other languages of Germanic origin.
Included TimeOnly as usage in .NET 6.0 is approaching.
Icelandic has some complexity that can be attributed to being 'closer' to its root than other surviving Germanic languages and having both more irregularities and retaining inflections such as four case synthetic grammar. This can mostly be represented with code branching specific to this implementation. Among other thing the first four natural numbers change based on gender and gender must be applied to the last number in a sequence. Rules are mostly consistent for powers of ten, but 'hundred' varies between single and plural. After performance measurements the final version was chosen to closely align with other implementations, while trying to be as transparent as possible. The Icelandic rules for ordinals are have additional requirements, e.g. on whether the penultimate number group or only the last match the rule. BenchmarkDotnet used on a parallel branch to make sure the implementation compares favarobly to other localisations.
Code analysis run and no issues found in Icelandic language support files.
Fix one mission EOL warning in PR view.
Restore AND handling code previously suggested by code coverage to be superfluous, but that turned out to be needed.
Added test and fix for the somewhat edge case of "the one million and two thousandth" ordinal in Icelandic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great, thank you! I noticed a few things in the ResX that did not appear to be translated; are those accurate?
Missing in _Above20 for seconds, days and years.
Forgot to add tests again after debugging
The one remaining piece is to add a reference to this language in the main metapackage, like this: Once that's done, I can merge this and get a release out. |
As a native Icelandic speaker I wanted to contribute support for the language. Converting numeric data to words was my main aspiration so localisations of ToWords and ToOrdinalWords was the core aim, with Dates, TimeSpans, Headings and Bytes then being straightforward enough to add along the way. Icelandic has a few nuances there that some other North Germanic languages have left behind, even though heavier levels of inflection including four cases and noun declension are not in the picture. Still, I hope the submitted implementation is both transparent and in line with the established code. I have run a copy of the build process to validate that all tests pass on the PR, and did some benchmarks on the side to try and make sure the performance compared favorably with a selection of other language implementations.
The PR checklist:
dev
branch (more info below)fixes #<the issue number>
build.cmd
orbuild.ps1
and ensure there are no test failures