Re: [PATCH 4/4] fs/hfsplus: Mark error strings for translation
On Fri, Apr 21, 2023 at 12:03:52AM +0200, Vladimir 'phcoder' Serbinenko wrote: > Is there any reason to translate those strings? They refer to deep > HFS+ structures and problems and to common people they are meaningless > even in their language. And someone in IT is likely to understand > those concepts in English. I wouldn't know a word for "extent" in my > native language. And those errors are very rare as they indicate a Yeah, I know what you mean... :-) > corrupted FS in the files GRUB cares about. OTOH translating them > requires a lot of effort on translator's side for little benefit. They > were not forgotten. They were not marked for translation on purpose. > If we mark all errors for translation we will make our already large > list of strings 10x larger and 90% of it are hyper-obscure error > conditions. Error conditions are translated only if they are likely to > occur and indicate a resolution direction like "linux command needs to > be run before initrd command" This patch has been suggested by me because I thought the lack of N_() was a mistake. Your comments shed some light to this. Though I still think some messages, e.g. "not a HFS+ filesystem", could be translated. Daniel > On Thu, Apr 20, 2023 at 8:00 PM Lidong Chen wrote: > > > > Signed-off-by: Lidong Chen > > --- > > grub-core/fs/hfsplus.c | 30 +++--- > > 1 file changed, 15 insertions(+), 15 deletions(-) > > > > diff --git a/grub-core/fs/hfsplus.c b/grub-core/fs/hfsplus.c > > index cf13e8a63..f91af1477 100644 > > --- a/grub-core/fs/hfsplus.c > > +++ b/grub-core/fs/hfsplus.c > > @@ -179,7 +179,7 @@ grub_hfsplus_read_block (grub_fshelp_node_t node, > > grub_disk_addr_t fileblock) > >if (node->fileid == GRUB_HFSPLUS_FILEID_OVERFLOW) > > { > > grub_error (GRUB_ERR_READ_ERROR, > > - "extra extents found in an extend overflow file"); > > + N_("extra extents found in an extend overflow file")); > > break; > > } > > > > @@ -190,7 +190,7 @@ grub_hfsplus_read_block (grub_fshelp_node_t node, > > grub_disk_addr_t fileblock) > >if (!node->data->extoverflow_tree_ready) > > { > > grub_error (GRUB_ERR_BAD_FS, > > - "attempted to read extent overflow tree before > > loading"); > > + N_("attempted to read extent overflow tree before > > loading")); > > break; > > } > > > > @@ -205,8 +205,8 @@ grub_hfsplus_read_block (grub_fshelp_node_t node, > > grub_disk_addr_t fileblock) > > || !nnode) > > { > > grub_error (GRUB_ERR_READ_ERROR, > > - "no block found for the file id 0x%x and the block" > > - " offset 0x%" PRIuGRUB_UINT64_T, > > + N_("no block found for the file id 0x%x and the block" > > + " offset 0x%" PRIuGRUB_UINT64_T), > > node->fileid, fileblock); > > break; > > } > > @@ -277,7 +277,7 @@ grub_hfsplus_mount (grub_disk_t disk) > >/* See if there's an embedded HFS+ filesystem. */ > >if (grub_be_to_cpu16 (volheader.hfs.embed_sig) != GRUB_HFSPLUS_MAGIC) > > { > > - grub_error (GRUB_ERR_BAD_FS, "not a HFS+ filesystem"); > > + grub_error (GRUB_ERR_BAD_FS, N_("not a HFS+ filesystem")); > > goto fail; > > } > > > > @@ -303,7 +303,7 @@ grub_hfsplus_mount (grub_disk_t disk) > >|| ((volheader.hfsplus.blksize & (volheader.hfsplus.blksize - 1)) != > > 0) > >|| grub_be_to_cpu32 (volheader.hfsplus.blksize) < > > GRUB_DISK_SECTOR_SIZE) > > { > > - grub_error (GRUB_ERR_BAD_FS, "not a HFS+ filesystem"); > > + grub_error (GRUB_ERR_BAD_FS, N_("not a HFS+ filesystem")); > >goto fail; > > } > > > > @@ -358,7 +358,7 @@ grub_hfsplus_mount (grub_disk_t disk) > > > >if (data->catalog_tree.nodesize < 2) > > { > > - grub_error (GRUB_ERR_BAD_FS, "invalid catalog node size"); > > + grub_error (GRUB_ERR_BAD_FS, N_("invalid catalog node size")); > >goto fail; > > } > > > > @@ -378,7 +378,7 @@ grub_hfsplus_mount (grub_disk_t disk) > > > >if (data->extoverflow_tree.nodesize < 2) > > { > > - grub_error (GRUB_ERR_BAD_FS, "invalid extents overflow node size"); > > + grub_error (GRUB_ERR_BAD_FS, N_("invalid extents overflow node > > size")); > >goto fail; > > } > > > > @@ -406,7 +406,7 @@ grub_hfsplus_mount (grub_disk_t disk) > > fail: > > > >if (grub_errno == GRUB_ERR_OUT_OF_RANGE) > > -grub_error (GRUB_ERR_BAD_FS, "not a HFS+ filesystem"); > > +grub_error (GRUB_ERR_BAD_FS, N_("not a HFS+ filesystem")); > > > >grub_free (data); > >return 0; > > @@ -550,7 +550,7 @@ grub_hfsplus_btree_iterate_node (struct > > grub_hfsplus_btree *btree, > > > >if (node_count && first_node->next == saved_node) > > { > > - grub_error (GRUB_ERR_B
Re: [PATCH 4/4] fs/hfsplus: Mark error strings for translation
> On Apr 21, 2023, at 6:10 AM, Daniel Kiper wrote: > > On Fri, Apr 21, 2023 at 12:03:52AM +0200, Vladimir 'phcoder' Serbinenko wrote: >> Is there any reason to translate those strings? They refer to deep >> HFS+ structures and problems and to common people they are meaningless >> even in their language. And someone in IT is likely to understand >> those concepts in English. I wouldn't know a word for "extent" in my >> native language. And those errors are very rare as they indicate a > > Yeah, I know what you mean... :-) > >> corrupted FS in the files GRUB cares about. OTOH translating them >> requires a lot of effort on translator's side for little benefit. They >> were not forgotten. They were not marked for translation on purpose. >> If we mark all errors for translation we will make our already large >> list of strings 10x larger and 90% of it are hyper-obscure error >> conditions. Error conditions are translated only if they are likely to >> occur and indicate a resolution direction like "linux command needs to >> be run before initrd command" > > This patch has been suggested by me because I thought the lack of N_() > was a mistake. Your comments shed some light to this. Though I still > think some messages, e.g. "not a HFS+ filesystem", could be translated. I can revert the changes, except the general messages as mentioned by Daniel. Thanks, Lidong > > Daniel > >> On Thu, Apr 20, 2023 at 8:00 PM Lidong Chen wrote: >>> >>> Signed-off-by: Lidong Chen >>> --- >>> grub-core/fs/hfsplus.c | 30 +++--- >>> 1 file changed, 15 insertions(+), 15 deletions(-) >>> >>> diff --git a/grub-core/fs/hfsplus.c b/grub-core/fs/hfsplus.c >>> index cf13e8a63..f91af1477 100644 >>> --- a/grub-core/fs/hfsplus.c >>> +++ b/grub-core/fs/hfsplus.c >>> @@ -179,7 +179,7 @@ grub_hfsplus_read_block (grub_fshelp_node_t node, >>> grub_disk_addr_t fileblock) >>> if (node->fileid == GRUB_HFSPLUS_FILEID_OVERFLOW) >>>{ >>> grub_error (GRUB_ERR_READ_ERROR, >>> - "extra extents found in an extend overflow file"); >>> + N_("extra extents found in an extend overflow file")); >>> break; >>>} >>> >>> @@ -190,7 +190,7 @@ grub_hfsplus_read_block (grub_fshelp_node_t node, >>> grub_disk_addr_t fileblock) >>> if (!node->data->extoverflow_tree_ready) >>>{ >>> grub_error (GRUB_ERR_BAD_FS, >>> - "attempted to read extent overflow tree before >>> loading"); >>> + N_("attempted to read extent overflow tree before >>> loading")); >>> break; >>>} >>> >>> @@ -205,8 +205,8 @@ grub_hfsplus_read_block (grub_fshelp_node_t node, >>> grub_disk_addr_t fileblock) >>> || !nnode) >>>{ >>> grub_error (GRUB_ERR_READ_ERROR, >>> - "no block found for the file id 0x%x and the block" >>> - " offset 0x%" PRIuGRUB_UINT64_T, >>> + N_("no block found for the file id 0x%x and the block" >>> + " offset 0x%" PRIuGRUB_UINT64_T), >>> node->fileid, fileblock); >>> break; >>>} >>> @@ -277,7 +277,7 @@ grub_hfsplus_mount (grub_disk_t disk) >>> /* See if there's an embedded HFS+ filesystem. */ >>> if (grub_be_to_cpu16 (volheader.hfs.embed_sig) != GRUB_HFSPLUS_MAGIC) >>>{ >>> - grub_error (GRUB_ERR_BAD_FS, "not a HFS+ filesystem"); >>> + grub_error (GRUB_ERR_BAD_FS, N_("not a HFS+ filesystem")); >>> goto fail; >>>} >>> >>> @@ -303,7 +303,7 @@ grub_hfsplus_mount (grub_disk_t disk) >>> || ((volheader.hfsplus.blksize & (volheader.hfsplus.blksize - 1)) != >>> 0) >>> || grub_be_to_cpu32 (volheader.hfsplus.blksize) < >>> GRUB_DISK_SECTOR_SIZE) >>> { >>> - grub_error (GRUB_ERR_BAD_FS, "not a HFS+ filesystem"); >>> + grub_error (GRUB_ERR_BAD_FS, N_("not a HFS+ filesystem")); >>> goto fail; >>> } >>> >>> @@ -358,7 +358,7 @@ grub_hfsplus_mount (grub_disk_t disk) >>> >>> if (data->catalog_tree.nodesize < 2) >>> { >>> - grub_error (GRUB_ERR_BAD_FS, "invalid catalog node size"); >>> + grub_error (GRUB_ERR_BAD_FS, N_("invalid catalog node size")); >>> goto fail; >>> } >>> >>> @@ -378,7 +378,7 @@ grub_hfsplus_mount (grub_disk_t disk) >>> >>> if (data->extoverflow_tree.nodesize < 2) >>> { >>> - grub_error (GRUB_ERR_BAD_FS, "invalid extents overflow node size"); >>> + grub_error (GRUB_ERR_BAD_FS, N_("invalid extents overflow node >>> size")); >>> goto fail; >>> } >>> >>> @@ -406,7 +406,7 @@ grub_hfsplus_mount (grub_disk_t disk) >>> fail: >>> >>> if (grub_errno == GRUB_ERR_OUT_OF_RANGE) >>> -grub_error (GRUB_ERR_BAD_FS, "not a HFS+ filesystem"); >>> +grub_error (GRUB_ERR_BAD_FS, N_("not a HFS+ filesystem")); >>> >>> grub_free (data); >>> return 0; >>> @@ -550,7 +550,7 @@ grub_hfsplus_btree_iterat
Installed Fedora 38 (sway) / grub2 on a new HD - boots OK but does not have a menuentry item in grub.cfg ?
People, My Fedora WS has 4 drive bays and I access old boot and other HDs in bays 2-4. I just did a clean install of Fedora Sway to /dev/sda - everything is fine and the system boots OK but I am confused: - cat /etc/os-release NAME="Fedora Linux" VERSION="38 (Sway)" . PRETTY_NAME="Fedora Linux 38 (Sway)" ANSI_COLOR="0;38;2;60;110;180" . VARIANT="Sway" VARIANT_ID=sway - The install picked up old Fedora boot setups which show up in /boot/grub2/grub.conf like this: menuentry 'Fedora Linux 37 (KDE Plasma) (on /dev/sde3)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-6.0.7-301.fc37.x86_64--f6f43412-e6ed-4dff-808b-fe013691c3b6' { - but why is there is not a line like this in /boot/grub2/grub.conf for Fedora 38 Sway? I can see that the appropriate other Sway files are in the /boot tree so I am guessing that grub2 somehow knows the proper, default boot image - even though the default does not have a menuentry in grub.cfg? A pointer to a link for info would be great . . Thanks! Phil. -- Philip Rhoades PO Box 896 Cowra NSW 2794 Australia E-mail: p...@pricom.com.au ___ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel