locale-util: add new helper locale_is_installed()

This new helper checks whether the specified locale is installed. It's
distinct from locale_is_valid() which just superficially checks if a
string looks like something that could be a valid locale.

Heavily inspired by @jsynacek's #13964.

Replaces: #13964
This commit is contained in:
Lennart Poettering
2020-05-07 17:23:23 +02:00
parent 5cea17a177
commit 23fa786ca6
2 changed files with 16 additions and 0 deletions
+1
View File
@@ -31,6 +31,7 @@ typedef enum LocaleVariable {
int get_locales(char ***l);
bool locale_is_valid(const char *name);
int locale_is_installed(const char *name);
#define _(String) gettext(String)
#define N_(String) String