Skip to content

Fix DefaultConverter.DefaultCulture#9045

Merged
henon merged 3 commits intoMudBlazor:devfrom
zerox981:fix/defaultconverter-defaultculture
May 24, 2024
Merged

Fix DefaultConverter.DefaultCulture#9045
henon merged 3 commits intoMudBlazor:devfrom
zerox981:fix/defaultconverter-defaultculture

Conversation

@zerox981
Copy link
Contributor

Description

Fixes: #9043
Changed the DefaultCulture in the Converters class from a static field to a static property with a getter only. This update ensures that DefaultCulture reflects the current UI culture at the time of access, providing a more accurate representation of the UI culture.

How Has This Been Tested?

Used the fixed version in our production project and the localization was reflected in the components using the DefaultConverter.

Type of Changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation (fix or improvement to the website or code docs)

It is potentially a breaking change if someone was setting the DefaultCulture manually.

Checklist

  • The PR is submitted to the correct branch (dev).
  • My code follows the code style of this project.
  • I've added relevant tests.

zerox981 added 3 commits June 22, 2021 09:14
` `

`Changed the DefaultCulture in the Converters class from a static field to a static property with a getter only. This update ensures that DefaultCulture always reflects the current UI culture at the time it is accessed, instead of being set once and never updated.`
@github-actions github-actions bot added breaking change This change will require consumer code updates PR: needs review labels May 23, 2024
@codecov
Copy link

codecov bot commented May 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.62%. Comparing base (28bc599) to head (8c5e0b4).
Report is 231 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #9045      +/-   ##
==========================================
+ Coverage   89.82%   90.62%   +0.79%     
==========================================
  Files         412      398      -14     
  Lines       11878    12372     +494     
  Branches     2364     2403      +39     
==========================================
+ Hits        10670    11212     +542     
+ Misses        681      621      -60     
- Partials      527      539      +12     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ScarletKuro ScarletKuro requested a review from henon May 23, 2024 17:15
@henon henon changed the title Fix/defaultconverter defaultculture Fix DefaultConverter.DefaultCulture May 24, 2024
@henon henon merged commit b9a6d07 into MudBlazor:dev May 24, 2024
@henon
Copy link
Contributor

henon commented May 24, 2024

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change This change will require consumer code updates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Globalization/localization does not work correctly with DefaultConverter

3 participants