MichaIng / DietPi

Lightweight justice for your single-board computer!
https://dietpi.com/
GNU General Public License v2.0
4.8k stars 494 forks source link

Dietpi-software: Find Baïkal by typing "baikal" #7174

Open Krik658 opened 1 month ago

Krik658 commented 1 month ago

Is your feature request related to a problem? Please describe:

I tried finding Baïkal in the Dietpi-software search using the term "baikal". It won't find it because i guess the program expects an ï (two dots) instead of an i (one dot). I don't know how to type that.

Describe the solution you'd like:

Find Baïkal by typing "baikal".

Maybe that'll help: You can strip diacritics from letters by using iconv to convert them to ASCII. This will give you the 'base' letter in most cases. I guess that only works for letters derived from latin.

$ echo 'ï' | iconv -t ascii//TRANSLIT
i
$ echo 'Baïkal' | iconv -t ascii//TRANSLIT
Baikal

Note: Some letters give unexpected results for people that don't know/use them:

$ echo 'äöü' | iconv -t ascii//TRANSLIT
aeoeue

Current workarounds

Use the "browse" function of dietpi-software to find Baïkal or use the id: sudo dietpi-software install 57 sudo dietpi-software reinstall 57 sudo dietpi-software uninstall 57

MichaIng commented 1 month ago

Thanks, indeed that annoyed myself as well one time: I like to keep showing the original/correct character in our menus, but it should be possible to find without copy&pasting such special character.

For completeness: it also works searching for "caldav" or "carddav", but I agree "baikal" needs to work as well.

Which package is iconv from? At least it's not in coreutils. Otherwise, for now, we can replace this particular character either for Baikal only, or in all software names and description, when using the search menu, and can implement a more generic solution when a 2nd such character appears with a software implementation.

I wonder whether we should check against both: the name with special character + the name with "i"? Just in case someone copy&pastes the original name into the input field.

Krik658 commented 1 month ago

iconv is part of libc-bin.

krik@krux:~$ dpkg-query -S /usr/bin/iconv
libc-bin: /usr/bin/iconv
krik@krux:~$ apt-cache search libc-bin
libc-bin - GNU C Library: Binaries

I wonder whether we should check against both: the name with special character + the name with "i"? Just in case someone copy&pastes the original name into the input field.

I think that's the easiest way and will work for quite a while.

If there'll be more apps with non-latin letters in the future then it's time to implement a revised search function.