Skip to content

Commit f43120a

Browse files
chore(deps): bump actions/upload-artifact from 4 to 5 (#508)
* Fix: Apply absolute value logic in `PluralRules` (#506) This PR addresses a long-standing inconsistency in the pluralization logic used by `PluralRules`. Previously, the implementation did not explicitly evaluate the absolute value of the input number, contrary to the CLDR specification. This led to incorrect plural category resolution for negative numbers, which typically defaulted to the `OTHER` category. #### Changes - The decimal argument passed to all `PluralRules` delegates is now transformed to its absolute value before evaluation. - This change ensures that plural category resolution aligns with CLDR expectations, particularly because locales with plural forms depend on numeric value regardless of sign. #### Impact - Fixes incorrect plural category resolution for negative numbers in locales such as `DualOneOther`, where the number of plural word variants influences the outcome. - May affect pluralization behavior in edge cases across multiple locales. Unit tests have been updated to reflect the corrected logic. - The change affects `PluralLocalizationFormatter` and `TimeFormatter`. - **Thoroughly test the new version in your localization workflows**, especially if you rely on custom pluralization delegates or locale-specific plural form resolution. This change may surface previously masked edge cases. #### Versioning - The PR will be published with a new **minor version**, as this change corrects a bug but may alter behavior in downstream formatting logic. #### Background See discussion in #503 and #497 for context. * chore(deps): bump actions/upload-artifact from 4 to 5 Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4 to 5. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](actions/upload-artifact@v4...v5) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * Fix error in Demo project --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: axunonb <axunonb@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1 parent 040f236 commit f43120a

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

.github/workflows/CodeQuality.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ jobs:
7575
dotnet test ./src/SmartFormat.sln --no-build --verbosity normal --configuration Release /p:AltCover=true /p:AltCoverXmlReport="coverage.xml" /p:AltCoverStrongNameKey="../SmartFormat.snk" /p:AltCoverAssemblyExcludeFilter="SmartFormat.Tests|SmartFormat.ZString|NUnit3.TestAdapter|AltCover" /p:AltCoverAttributeFilter="ExcludeFromCodeCoverage" /p:AltCoverLineCover="true"
7676
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"
7777
- name: Store coverage report as artifact
78-
uses: actions/upload-artifact@v4
78+
uses: actions/upload-artifact@v5
7979
with:
8080
name: coverage-report
8181
path: ./src/SmartFormat.Tests/coverage.*.xml # store all coverage reports

src/Demo/SmartFormatDemo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,8 @@ private void TxtInput_TextChanged(object sender, EventArgs e)
190190

191191
private void LstExamples_SelectedIndexChanged(object sender, EventArgs e)
192192
{
193+
if (lstExamples.SelectedItem == null) return;
193194
var example = (KeyValuePair<string, string>) lstExamples.SelectedItem;
194-
if (example.Value == null) return;
195195
txtInput.Text = example.Value;
196196
}
197197
}

0 commit comments

Comments
 (0)