Skip to content

Commit

Permalink
LanguageTagHelper RTL support
Browse files Browse the repository at this point in the history
  • Loading branch information
LazZiya committed Sep 1, 2019
1 parent 8d61d86 commit c5a7ef7
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 51 deletions.
7 changes: 6 additions & 1 deletion LazZiya.TagHelpers/LanguageNavTagHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,12 @@ private void CreateClassicItems(ref TagHelperOutput output, List<LanguageItem> l
private void CreateBootstrapItems(ref TagHelperOutput output, List<LanguageItem> langDictionary)
{
var div = new TagBuilder("div");
div.AddCssClass("dropdown-menu dropdown-menu-right");

if(CultureInfo.CurrentCulture.TextInfo.IsRightToLeft)
div.AddCssClass("dropdown-menu dropdown-menu-left");
else
div.AddCssClass("dropdown-menu dropdown-menu-right");

div.Attributes.Add("aria-labeledby", "dropdownlang");

foreach (var lang in langDictionary.Where(x => x.Name != CultureInfo.CurrentCulture.Name).OrderBy(x=>x.DisplayText))
Expand Down
6 changes: 5 additions & 1 deletion LazZiya.TagHelpers/LazZiya.TagHelpers.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@
<PackageIcon>files\icon.png</PackageIcon>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageTags>asp.net, core, razor, mvc, taghelpers, taghelper,tag,helper,language,culture,dropdown, pagination, select, enum</PackageTags>
<PackageReleaseNotes>Endpoint routing for dotnet core 3</PackageReleaseNotes>
<PackageReleaseNotes>
- support for dotnetcore 3.0
- Endpoint routing for dotnet core 3
- RTL support for language nav
</PackageReleaseNotes>
<Version>3.0.0-preview1</Version>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<FileVersion>3.0.0.0</FileVersion>
Expand Down
56 changes: 7 additions & 49 deletions LazZiya.TagHelpers/files/LazZiya.TagHelpers.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c5a7ef7

Please sign in to comment.