0
0
Fork 0

Ignore diacritics on game search (#6602)

This commit is contained in:
gdkchan 2024-04-05 15:26:45 -03:00 committed by GitHub
parent 8c2da1aa04
commit 05c041feeb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -36,6 +36,7 @@ using SixLabors.ImageSharp.PixelFormats;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
using System.Globalization;
using System.IO; using System.IO;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
@ -980,7 +981,14 @@ namespace Ryujinx.Ava.UI.ViewModels
{ {
if (arg is ApplicationData app) if (arg is ApplicationData app)
{ {
return string.IsNullOrWhiteSpace(_searchText) || app.TitleName.ToLower().Contains(_searchText.ToLower()); if (string.IsNullOrWhiteSpace(_searchText))
{
return true;
}
CompareInfo compareInfo = CultureInfo.CurrentCulture.CompareInfo;
return compareInfo.IndexOf(app.TitleName, _searchText, CompareOptions.IgnoreCase | CompareOptions.IgnoreNonSpace) >= 0;
} }
return false; return false;