docs: #301 issue in TOCs with different order for ه و:

This commit is contained in:
Hamid Reza Mohammadi 2022-03-26 11:19:44 +04:30
parent 465a00d540
commit 4f3c719391
2 changed files with 11 additions and 3 deletions

View File

@ -8,8 +8,8 @@
},
"AllowedHosts": "*",
"GoogleAnalyticsCode": "",
"APIRoot": "https://api.ganjoor.net",
"GlobalAPIRoot": "https://api.ganjoor.net",
"APIRoot": "http://localhost:3439",
"GlobalAPIRoot": "http://localhost:3439",
"SiteUrl": "http://localhost:33081",
"MockSpotify": "False",
"Spotify": {

View File

@ -378,7 +378,15 @@ namespace RMuseum.Services.Implementation
}
}
var fa = new CultureInfo("fa-IR");
foundLastChars.Sort((a, b) => fa.CompareInfo.Compare(a, b));
if (foundLastChars.Contains("و") && foundLastChars.Contains("ی") && foundLastChars.IndexOf("ه") == (foundLastChars.IndexOf("و") - 1))
{
foundLastChars.Sort((a, b) => a == "ه" && b == "و" ? -1 : a == "و" && b == "ه" ? 1 : fa.CompareInfo.Compare(a, b));
}
else
{
foundLastChars.Sort((a, b) => fa.CompareInfo.Compare(a, b));
}
foreach (var poemLastChar in foundLastChars)
{
string rep = poemLastChar == "ا" ? "الف" : poemLastChar;