1 /* SPDX-License-Identifier: LGPL-2.1-or-later */
10 typedef enum LocaleVariable
{
11 /* We don't list LC_ALL here on purpose. People should be
12 * using LANG instead. */
25 VARIABLE_LC_TELEPHONE
,
26 VARIABLE_LC_MEASUREMENT
,
27 VARIABLE_LC_IDENTIFICATION
,
29 _VARIABLE_LC_INVALID
= -EINVAL
,
32 int get_locales(char ***l
);
33 bool locale_is_valid(const char *name
);
34 int locale_is_installed(const char *name
);
36 #define _(String) gettext(String)
37 #define N_(String) String
38 void init_gettext(void);
40 bool is_locale_utf8(void);
42 typedef enum SpecialGlyph
{
43 SPECIAL_GLYPH_TREE_VERTICAL
,
44 SPECIAL_GLYPH_TREE_BRANCH
,
45 SPECIAL_GLYPH_TREE_RIGHT
,
46 SPECIAL_GLYPH_TREE_SPACE
,
47 SPECIAL_GLYPH_TRIANGULAR_BULLET
,
48 SPECIAL_GLYPH_BLACK_CIRCLE
,
49 SPECIAL_GLYPH_WHITE_CIRCLE
,
50 SPECIAL_GLYPH_MULTIPLICATION_SIGN
,
51 SPECIAL_GLYPH_CIRCLE_ARROW
,
54 SPECIAL_GLYPH_CHECK_MARK
,
55 SPECIAL_GLYPH_CROSS_MARK
,
57 SPECIAL_GLYPH_ELLIPSIS
,
58 SPECIAL_GLYPH_LIGHT_SHADE
,
59 SPECIAL_GLYPH_DARK_SHADE
,
61 SPECIAL_GLYPH_EXTERNAL_LINK
,
62 _SPECIAL_GLYPH_FIRST_EMOJI
,
63 SPECIAL_GLYPH_ECSTATIC_SMILEY
= _SPECIAL_GLYPH_FIRST_EMOJI
,
64 SPECIAL_GLYPH_HAPPY_SMILEY
,
65 SPECIAL_GLYPH_SLIGHTLY_HAPPY_SMILEY
,
66 SPECIAL_GLYPH_NEUTRAL_SMILEY
,
67 SPECIAL_GLYPH_SLIGHTLY_UNHAPPY_SMILEY
,
68 SPECIAL_GLYPH_UNHAPPY_SMILEY
,
69 SPECIAL_GLYPH_DEPRESSED_SMILEY
,
70 SPECIAL_GLYPH_LOCK_AND_KEY
,
73 _SPECIAL_GLYPH_INVALID
= -EINVAL
,
76 const char *special_glyph(SpecialGlyph code
) _const_
;
78 bool emoji_enabled(void);
80 const char* locale_variable_to_string(LocaleVariable i
) _const_
;
81 LocaleVariable
locale_variable_from_string(const char *s
) _pure_
;
83 static inline void freelocalep(locale_t
*p
) {
84 if (*p
== (locale_t
) 0)
90 void locale_variables_free(char* l
[_VARIABLE_LC_MAX
]);
91 static inline void locale_variables_freep(char*(*l
)[_VARIABLE_LC_MAX
]) {
92 locale_variables_free(*l
);
95 static inline const char *special_glyph_check_mark(bool b
) {
96 return b
? special_glyph(SPECIAL_GLYPH_CHECK_MARK
) : special_glyph(SPECIAL_GLYPH_CROSS_MARK
);