ncurses/nc-cui: musl libc fixes
[petitboot] / ui / ncurses / nc-helpscreen.c
index d70a8ec836f228666942e1e2be71bf276fd6fa43..d332d14923154e442eef2687a4043a2c62e7f3b0 100644 (file)
@@ -25,6 +25,7 @@
 #include <types/types.h>
 #include <log/log.h>
 #include <util/util.h>
+#include <i18n/i18n.h>
 
 #include "nc-cui.h"
 #include "nc-textscreen.h"
@@ -47,7 +48,8 @@ struct nc_scr *help_screen_return_scr(struct help_screen *screen)
 
 struct help_screen *help_screen_init(struct cui *cui,
                struct nc_scr *current_scr,
-               const char *title_suffix, const char *text,
+               const char *title_suffix,
+               const struct help_text *text,
                void (*on_exit)(struct cui *))
 {
        struct help_screen *screen;
@@ -56,13 +58,13 @@ struct help_screen *help_screen_init(struct cui *cui,
        screen = talloc_zero(cui, struct help_screen);
        screen->return_scr = current_scr;
 
-       title = "Petitboot help";
+       title = _("Petitboot help");
        if (title_suffix)
                title = talloc_asprintf(screen,
-                               "Petitboot help: %s", title_suffix);
+                               _("Petitboot help: %s"), title_suffix);
 
        text_screen_init(&screen->text_scr, cui, title, on_exit);
-       text_screen_set_text(&screen->text_scr, text);
+       text_screen_set_text(&screen->text_scr, gettext(text->text));
        text_screen_draw(&screen->text_scr);
 
        return screen;