]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
Initialize the translations on start if they are available
authorSebastien <seb128@ubuntu.com>
Thu, 6 Aug 2020 11:52:01 +0000 (11:52 +0000)
committerSebastien Bacher <seb128@ubuntu.com>
Fri, 7 Aug 2020 14:51:35 +0000 (16:51 +0200)
setlocale was already called on filesystem mounting but that's not enough
to cover all the cases. The call needs to be conditional because doing it
at a time where the locales are not available (in the initrd) would
result in translations to not be working.

src/Makefile.am
src/main.c

index 95ed019265ec77a114a1b7242d6290193f2a34d8..cbba2be446c9acd0c2bff2d5a94474131f4a1b43 100644 (file)
@@ -6,6 +6,7 @@ AM_CPPFLAGS = -I$(top_srcdir)                                                 \
            -I$(srcdir)/libply                                                 \
            -I$(srcdir)/libply-splash-core                                     \
            -I$(srcdir)                                                        \
+           -DPLYMOUTH_LOCALE_DIRECTORY=\"$(localedir)\"                       \
            -DPLYMOUTH_LOG_DIRECTORY=\"$(localstatedir)/log\"                  \
            -DPLYMOUTH_SPOOL_DIRECTORY=\"$(localstatedir)/spool/plymouth\"     \
            -DPLYMOUTH_TIME_DIRECTORY=\"$(localstatedir)/lib/plymouth/\"       \
index 8848ad0dc8f8852591093becf38db9475bdb549e..ab614ca12a76089f3d0d355aa8dfe61cdc62b4ec 100644 (file)
@@ -2089,6 +2089,10 @@ main (int    argc,
 
         state.loop = ply_event_loop_get_default ();
 
+        /* Initialize the translations if they are available (!initrd) */
+        if (ply_directory_exists (PLYMOUTH_LOCALE_DIRECTORY))
+                setlocale(LC_ALL, "");
+
         ply_command_parser_add_options (state.command_parser,
                                         "help", "This help message", PLY_COMMAND_OPTION_TYPE_FLAG,
                                         "attach-to-session", "Redirect console messages from screen to log", PLY_COMMAND_OPTION_TYPE_FLAG,