[i18n] g_desktop_app_info_search could also use english keywords
Currently, with a french locale, in gnome shell, which use g_desktop_app_info_search
to search for applications by their .desktop
Keywords, if I search for "weather" it does not finds the "gnome-weather" app, but if I search for "meteo" (the french word for weather) it finds it.
That's because g_desktop_app_info_search
only use translated keywords to search for an app, I think it could also yield apps that match their untranslated keywords with a lower score.
To test it I used:
#include <stdio.h>
#include <gio/gdesktopappinfo.h>
int main(int argc, char *argv[])
{
char ***results, ***groups, **ids;
results = g_desktop_app_info_search(argv[1]);
for (groups = results; *groups; groups++) {
for (ids = *groups; *ids; ids++) {
printf("%s, ", *ids);
}
printf("\n");
}
return 0;
}
and tried:
$ LANGUAGE=en_US.UTF-8 ./search weather # Just to test it works.
org.gnome.Weather.desktop,
$ LANGUAGE=en_US.UTF-8 ./search meteo # I didn't expected this to find anything :)
$ LANGUAGE=fr_FR.UTF-8 ./search meteo # Just to test it works in french.
org.gnome.Weather.desktop,
$ LANGUAGE=fr_FR.UTF-8 ./search weather # I expected this one to give org.gnome.Weather.desktop too.
A lot of non-native-english people may now english too, they may also know the name of the app, here "gnome-weather", and may also work in some desktop configured in english. So typing english words can be natural from a part of the population.