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

Submember indentation is not possible in languages ​​other than English in the Blazor Sidebar 2 component. #787

Closed
NezihOzkanHd opened this issue Jul 4, 2024 · 1 comment · Fixed by #801
Assignees
Labels
area-sidebar-2 bug Something isn't working

Comments

@NezihOzkanHd
Copy link

Describe the bug
Submember indentation is not possible in languages ​​other than English in the Blazor Sidebar 2 component.

To Reproduce
image

Expected behavior
image

image

Versions (please complete the following information):

  • .NET Version: NET 8

Sample code
private string GetNavLinkStyle()
{
// Implementation:
// Level 0 = 1rem = 0 + 1 + (0 * 0.5)
// Level 1 = 2.5rem = 1 + 1 + (1 * 0.5)
// Level 2 = 4rem = 2 + 1 + (2 * 0.5)
// ...
// Level n = ..... = n + 1 + (n * 0.5)

 var level = Level + 1 + Level * 0.5;

 if (HasChilds && !NavItemGroupExpanded)
     level += 0.25;
 else if (!HasChilds && Level == 0)
     level += 0.25;

 // NezihOzkan level value must be (en-US) culture specific, otherwise the dot sign becomes a comma in other languages.
 //return $"padding-left:{level}rem;";
 return $"padding-left:{level.ToString(CultureInfo.CreateSpecificCulture("en-US"))}rem;";

}

@gvreddy04
Copy link
Contributor

@NezihOzkanHd Thank you for using BlazorBootstrap. You can try using .ToString(CultureInfo.InvariantCulture). We will fix this in the next version.

@gvreddy04 gvreddy04 added area-sidebar-2 bug Something isn't working labels Jul 4, 2024
@gvreddy04 gvreddy04 added this to the 3.0.0 milestone Jul 4, 2024
@gvreddy04 gvreddy04 self-assigned this Jul 12, 2024
gvreddy04 added a commit that referenced this issue Jul 12, 2024
@gvreddy04 gvreddy04 linked a pull request Jul 12, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-sidebar-2 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants