Subject: Re: bug#64881: [translation] M-x texinfo-all-menus-update breaks translated cookbook

From: Maxim Cournoyer <[email-masked]>
Date: Wed, 16 Aug 2023 11:20:06 -0400

Hi Florian,

"pelzflorian (Florian Pelz)" <[email-masked]> writes:

> Maxim Cournoyer <[email-masked]> writes:
>> M-x texinfo-update-all-menus is available out-of-the-box in Emacs, when
>> visiting a .texi file (you invoke it via Alt-x texinfo-update-all-menus
>> or by visiting the 'Texinfo -> Update All Menus' menu).
>
> Oops my bad.  I should have expected that Emacs commands are invisible
> unless the right Emacs mode is used.  Thank you for clarifying and
> presenting as a patch.
>
> Josselin Poiret <[email-masked]> writes:
>> `make as-derivation` uses #:select? git? to restrict to only files
>> that are checked out in git.  It doesn't try to get the contents of HEAD
>> though, the working directory's state is used instead.
>
> Oh hmm doc/guix-cookbook.de.texi is not checked in, so even `make
> as-derivation` should have worked ...
>
> This got nothing to do with stray .de.texi files.  Apparently it is
> because the menu entries lack menu descriptions (which should be
> optional according to `info texinfo').
>
> The attached patch on top of your patch helps ...
>
> Either we add optional descriptions everywhere or not update menu
> entries without description or change how po4a translates the menu
> entries in po4a source file lib/Locale/Po4a/Texinfo.pm in
> translate_buffer_menuentry, to make po4a translate when there is no
> description.  I don’t plan to do that though.

I've modified po4a to support this use case, with tests and all!  Pushed
as 352c49e1a5c48eb76389ee384eb95fc2e4a6ab32, with coobook menus updated
in the following commit.

Thanks for the analysis and pointers!

-- 
Thanks,
Maxim