On Fri, Jul 19, 2019 at 02:29:52PM +0200, pelzflorian (Florian Pelz) wrote: > I will try writing a custom xgettext that combines > nested·s-expressions·that are marked for translation with G_ > to·a·single·msgstr that gets written to the·PO·file. This combined > string will not be part of the source code but will be generated from > a nested sexp. The PO file containing the combined strings can then > be translated as usual. For reading the translation, the combined > msgstr will be constructed again by the marking procedure G_ and > looked up by reading from an MO file. > > It will take me a few days and a MO file reader will still be missing. > I suppose it would be easier to use for the sxml’s author who would > not need to write special code to internationalize the sxml. > Find attached a work-in-progress patch to guix-artwork that constructs PO entries from nested sexps. Also attached is a file marked for translation and the POT file generated from it. No custom MO reader is needed because gettext is a fine MO reader, the problem is only xgettext that cannot extract sexps. Currently missing though is a procedure or macro for deconstructing the msgstr to an sexp, so the patch can only generate unusable POT files at the moment. I will take a look at it now, but it may again take a week. Please tell me if you think this is the wrong approach. Regards, Florian