Skip to content
This repository has been archived by the owner on Aug 20, 2024. It is now read-only.

Localization issue #43

Closed
wullemsb opened this issue Apr 4, 2024 · 3 comments · Fixed by dotnet/smartcomponents#17
Closed

Localization issue #43

wullemsb opened this issue Apr 4, 2024 · 3 comments · Fixed by dotnet/smartcomponents#17

Comments

@wullemsb
Copy link

wullemsb commented Apr 4, 2024

When testing the Smart Combobox on my local machine, I never got any semantic matches back.

Further investigation showed that the minimal-threshold was incorrectly parsed due to my localization settings(nl-BE).
On my local machine 0.6f was parsed as 6 which is out of the range of supported values(0-1).

In my language the decimal separator is a ',' (comma) and not a '.' (period).

I was able to work around the issue by explicitly setting the locale to en-US:

var defaultCulture = "en-US";
var ci = new CultureInfo(defaultCulture);
app.UseRequestLocalization(new RequestLocalizationOptions
{
    DefaultRequestCulture = new RequestCulture("en-US"),
    SupportedCultures = new List<CultureInfo>
    {
        ci,
    },
    SupportedUICultures = new List<CultureInfo>
    {
        ci,
    }
});
@SteveSandersonMS
Copy link
Contributor

Interesting - thanks! Looks like we need to fix something in the parsing flow to ensure it uses culture-invariant parsing, so it will work regardless of your thread culture.

@SteveSandersonMS
Copy link
Contributor

This should be fixed as of the latest update, 0.1.0-preview10148. If you still encounter similar issues after upgrading, please let us know! Thanks again for reporting it.

@wullemsb
Copy link
Author

wullemsb commented Apr 7, 2024 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants