dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.42k stars 4.76k forks source link

CultureInfo.TextInfo.IsRightToLeft returns false for Uyghur culture in Blazor WebAssembly #110015

Open abduwaris opened 1 day ago

abduwaris commented 1 day ago

Is there an existing issue for this?

Describe the bug

I have encountered an issue with the CultureInfo.TextInfo.IsRightToLeft property in Blazor WebAssembly. Specifically, when using the Uyghur culture (ug-CN), the IsRightToLeft property returns false, which is not the expected behavior since Uyghur is a right-to-left language.

In Blazor WebAssembly, the following code snippet returns false:

@page "/text-direction"

@using System.Globalization

<div>
    @if (ugCulture.TextInfo.IsRightToLeft)
    {
        <p>The text direction is set to Right-To-Left.</p>
    }
    else
    {
        <p>The text direction is set to Left-To-Right.</p>
    }
</div>

@code {
    private CultureInfo ugCulture;

    protected override void OnInitialized()
    {
        ugCulture = new CultureInfo("ug-CN");
    }
}

This behavior may affect the rendering of Uyghur text in Blazor applications, as proper text direction is crucial for correct display and user experience.

If there is a known workaround or if this behavior is expected, please let me know. Otherwise, I would appreciate any guidance on how this issue might be addressed in future updates.

Thank you!

Expected Behavior

For the Uyghur culture (ug-CN), I expect the TextInfo.IsRightToLeft property to return true.

Steps To Reproduce

No response

Exceptions (if any)

No response

.NET Version

9.0.100

Anything else?

No response

dotnet-policy-service[bot] commented 1 day ago

Tagging subscribers to this area: @dotnet/area-system-globalization See info in area-owners.md if you want to be subscribed.

dotnet-policy-service[bot] commented 16 hours ago

Tagging subscribers to 'arch-wasm': @lewing See info in area-owners.md if you want to be subscribed.

tarekgh commented 16 hours ago

@ilonatommy