setlocale () does not work when there is no locale info for
the selected LANG / LC_MESSAGES. But it does cache the set
LANG / LC_MESSAGES and on subsequent setlocale () calls with
the same LANG / LC_MESSAGES it does not recheck for the locale info.
Thus if the initrd does not have translations then the setlocale ()
call should be delayed to after the chroot so that e.g.
the "Installing Updates..." text, which only is shown after
the chroot, gets translated properly.
So far we have been checking the /usr/share/locale dir exists,
but it is possible that some initrd generators may create
that without the necessary locale info being available.
Instead check for the NL plymouth.mo file, assuming that
if that is available we have all the necessary locale info.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
state.loop = ply_event_loop_get_default ();
/* Initialize the translations if they are available (!initrd) */
- if (ply_directory_exists (PLYMOUTH_LOCALE_DIRECTORY))
+ if (ply_file_exists (PLYMOUTH_LOCALE_DIRECTORY "/nl/LC_MESSAGES/plymouth.mo"))
setlocale (LC_ALL, "");
ply_command_parser_add_options (state.command_parser,