On 21.11.2013 19:32, Colin Watson wrote:
> * include/grub/util/install.h (GRUB_INSTALL_OPTIONS): Add
> --locale-directory option.
> (enum grub_install_options): Add
> GRUB_INSTALL_OPTIONS_LOCALE_DIRECTORY.
> * util/grub-install-common.c (grub_install_help_filter): Handle
> GRUB_INSTALL_OPTIONS_LOCALE_DIRECTORY.
> (grub_install_parse): Likewise.
> (get_localedir): New function to check for a user-provided option
> before trying grub_util_get_localedir.
> (copy_locales): Use get_localedir rather than
> grub_util_get_localedir.
> (grub_install_copy_files): Likewise.
I think you need an addition to look for all of
$localedir/$lang{.mo,.gmo} and $localedir/$lang/LC_MESSAGES/grub.mo.
Like following (not tested):
diff --git a/util/grub-install-common.c b/util/grub-install-common.c
diff --git a/util/grub-install-common.c b/util/grub-install-common.c
index 4e1d41a..bf722da 100644
--- a/util/grub-install-common.c
+++ b/util/grub-install-common.c
@@ -570,13 +586,26 @@ copy_locales (const char *dstd)
{
char *srcf;
char *dstf;
+ char *ext;
if (strcmp (de->d_name, ".") == 0)
continue;
if (strcmp (de->d_name, "..") == 0)
continue;
- srcf = grub_util_path_concat_ext (4, locale_dir, de->d_name,
+ ext = grub_strrchr (de->d_name, '.');
+ if (ext && (grub_strcmp (ext, ".mo") == 0
+ || grub_strcmp (ext, ".gmo") == 0))
+ {
+ srcf = grub_util_path_concat (2, locale_dir, de->d_name);
+ dstf = grub_util_path_concat (2, dstd, de->d_name);
+ ext = grub_strrchr (dstf, '.');
+ grub_strcpy (ext, ".mo");
+ }
+ else
+ {
+ srcf = grub_util_path_concat_ext (4, locale_dir, de->d_name,
"LC_MESSAGES", PACKAGE, ".mo");
- dstf = grub_util_path_concat_ext (2, dstd, de->d_name, ".mo");
+ dstf = grub_util_path_concat_ext (2, dstd, de->d_name, ".mo");
+ }
grub_install_compress_file (srcf, dstf, 0);
free (srcf);
free (dstf);
signature.asc
Description: OpenPGP digital signature
_______________________________________________ Grub-devel mailing list [email protected] https://lists.gnu.org/mailman/listinfo/grub-devel
