Skip to content
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

Added formatter for localization #207

Merged
merged 53 commits into from Oct 14, 2021

Conversation

axunonb
Copy link
Member

@axunonb axunonb commented Oct 14, 2021

Added features to localize literals and placeholders

  • Added LocalizationFormatter
  • Added ILocalizationProvider and a standard implemention as LocalizationProvider, which handles resx resource files
  • SmartSettings were exended with category Localization.
  • Custom IFormatter can now make use of localization, if needed.
  • New exception type LocalizationFormattingException
  • FormattingException now contains InnerException where applicable

axunonb and others added 30 commits April 17, 2021 10:25
@codecov
Copy link

codecov bot commented Oct 14, 2021

Codecov Report

Merging #207 (fd7aa89) into version/v3.0 (45d9fdb) will increase coverage by 1%.
The diff coverage is 100%.

❗ Current head fd7aa89 differs from pull request most recent head 9298f46. Consider uploading reports for the commit 9298f46 to get more accurate results
Impacted file tree graph

@@             Coverage Diff              @@
##           version/v3.0    #207   +/-   ##
============================================
+ Coverage            17%     17%   +1%     
============================================
  Files                95      99    +4     
  Lines             12833   12905   +72     
============================================
+ Hits               2146    2224   +78     
+ Misses            10687   10681    -6     
Impacted Files Coverage Δ
src/SmartFormat/Core/Formatting/FormatDetails.cs 100% <ø> (ø)
...SmartFormat/Core/Formatting/FormattingException.cs 100% <100%> (ø)
src/SmartFormat/Core/Settings/Localization.cs 100% <100%> (ø)
src/SmartFormat/Core/Settings/SmartSettings.cs 65% <100%> (+2%) ⬆️
...rc/SmartFormat/Extensions/LocalizationFormatter.cs 100% <100%> (ø)
...rmat/Extensions/LocalizationFormattingException.cs 100% <100%> (ø)
src/SmartFormat/Extensions/LocalizationProvider.cs 100% <100%> (ø)
src/SmartFormat/SmartFormatter.cs 96% <100%> (ø)
src/SmartFormat/Core/Parsing/Placeholder.cs 96% <0%> (+11%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 45d9fdb...9298f46. Read the comment docs.

@axunonb
Copy link
Member Author

axunonb commented Oct 14, 2021

Finally found a fix for the failing unit test, since we have embedded resources in the test project.
The cause was the AltCover package which is used on AppVeyor/CI.

The test now must be invoked with the following additional parameters
dotnet test [...] /p:AltCoverInplace=true /p:AltCoverForce=true

@axunonb axunonb merged commit 3246267 into axuno:version/v3.0 Oct 14, 2021
@axunonb axunonb deleted the localization-formatter branch October 14, 2021 11:11
axunonb added a commit to axunonb/SmartFormat that referenced this pull request Mar 10, 2022
  * Added `LocalizationFormatter`
  * Added `ILocalizationProvider` and a standard implemention as `LocalizationProvider`, which handles `resx` resource files
  * `SmartSettings` were exended with category `Localization`.
  * Custom `IFormatter` can now make use of localization, if needed.
  * New exception type `LocalizationFormattingException`
  * `FormattingException` now contains `InnerException` where applicable
  * Updated unit test packages to latest version
  * Updated appveyor.yml because AltCover made unit tests with resource files fail: Added CLI parameters /p:AltCoverInplace=true /p:AltCoverForce=true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant