vikramlearning / blazorbootstrap

An Enterprise-class Blazor Bootstrap Component library built on the Blazor and Bootstrap CSS frameworks.
https://docs.blazorbootstrap.com/
Apache License 2.0
690 stars 33 forks source link

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

Closed NezihOzkanHd closed 2 months ago

NezihOzkanHd commented 3 months ago

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):

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 commented 3 months ago

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