bug-gettext
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #64481] Gtk.builder.new_from_string strings not extracted


From: Anders Jonsson
Subject: [bug #64481] Gtk.builder.new_from_string strings not extracted
Date: Thu, 27 Jul 2023 05:27:07 -0400 (EDT)

URL:
  <https://savannah.gnu.org/bugs/?64481>

                 Summary: Gtk.builder.new_from_string strings not extracted
                   Group: GNU gettext
               Submitter: haaninjo
               Submitted: Thu 27 Jul 2023 09:27:05 AM UTC
                Category: None
                Severity: 3 - Normal
              Item Group: None
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: Thu 27 Jul 2023 09:27:05 AM UTC By: Anders Jonsson <haaninjo>
In GIMP there are some strings in a gtk.Builder ui xml embedded as a string in
a C file. That is used with Gtk.builder.new_from_string to make a menu. (
https://gitlab.gnome.org/GNOME/gimp/-/blob/master/plug-ins/imagemap/imap_main.c
)

The contents of this string do not get extracted by my usual xgettext flags
[1], and if I instead use -a to extract all it returns that whole xml as a
single string, not only parts marked "translatable".

Same thing can be seen with this example code from gtk:
https://developer-old.gnome.org/gtk4/stable/GtkApplicationWindow.html

Attached file is that example with a string added outside the xml to
demonstrate that only the string outside the xml is extracted.

Is there some way to extract only the labels marked translatable out of the
xml rather than the whole xml? Or is that unimplemented? Moving that xml to
another file makes extraction work as expected, so the problem is probably
that all the xml is in a single string.




[1] xgettext gettext_extract_example.c --from-code utf-8 --add-comments
--output gimp.pot --keyword=_ --keyword=N_ --keyword=C_:1c,2
--keyword=NC_:1c,2 --keyword=g_dcgettext:2 --keyword=g_dngettext:2,3
--keyword=g_dpgettext2:2c,3 --flag=N_:1:pass-c-format
--flag=C_:2:pass-c-format --flag=NC_:2:pass-c-format
--flag=g_dngettext:2:pass-c-format --flag=g_strdup_printf:1:c-format
--flag=g_string_printf:2:c-format --flag=g_string_append_printf:2:c-format
--flag=g_error_new:3:c-format --flag=g_set_error:4:c-format
--msgid-bugs-address https://gitlab.gnome.org/GNOME/gimp/issues







    _______________________________________________________
File Attachments:


-------------------------------------------------------
Date: Thu 27 Jul 2023 09:27:05 AM UTC  Name: gettext_extract_example.c  Size:
1KiB   By: haaninjo

<http://savannah.gnu.org/bugs/download.php?file_id=54976>

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?64481>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]