After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 518642 - Custom tags and translatable content
Custom tags and translatable content
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Class: GtkBuilder
unspecified
Other Linux
: Normal normal
: ---
Assigned To: GtkBuilder maintainers
GtkBuilder maintainers
Depends on:
Blocks: 517559
 
 
Reported: 2008-02-25 15:46 UTC by Johan (not receiving bugmail) Dahlin
Modified: 2009-04-06 16:14 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch (10.99 KB, patch)
2009-04-06 06:40 UTC, Matthias Clasen
committed Details | Review

Description Johan (not receiving bugmail) Dahlin 2008-02-25 15:46:46 UTC
GtkBuilder supports GtkListStore, but there's no way of marking data inserted into the model as translatable.

The same attributes that are used for properties should be used to make it easier for tools such as gettext/intltool, eg:

translatable=yes/no
comments=string
context=string

A review of all custom tags and their translatable content needs to be done.
Comment 1 Johan (not receiving bugmail) Dahlin 2008-02-25 15:54:05 UTC
Doing a quick grep shows that only accessible [in addition to liststore] needs to be marked as translatable.

Unfortunately, the accessible content is stored in an attribute, which goes against the property norm.
Comment 2 Johan (not receiving bugmail) Dahlin 2008-03-02 01:15:25 UTC
<col> tags under GtkListStore now accepts translatable/context/comment attributes.
Still missing a solution for accessible.

2008-02-29  Johan Dahlin  <johan@gnome.org>

	* demos/gtk-demo/demo.ui:
	* gtk/gtkbuilderparser.c:
	* gtk/gtkbuilderprivate.h:
	* gtk/gtkliststore.c:
	* tests/buildertest.c:
	Add translatable/context and comment attributes on
	<col> tags under a GtkListStore. Refactor parts of the
	translation api and make it available inside gtk+ itself.
	Update tests and example.
	Fixes a part of #518642
Comment 3 Matthias Clasen 2008-07-03 06:02:05 UTC
What accessible content is stored in an attribute ?

   "            <child internal-child=\"accessible\">"
    "              <object class=\"AtkObject\" id=\"a11y-label1\">"
    "                <property name=\"AtkObject::accessible-name\">A Label</property>"
    "              </object>"
    "            </child>"

looks to me like "A Label" is here the accessible content that we want translated.
Comment 4 Johan (not receiving bugmail) Dahlin 2008-07-03 10:50:33 UTC
From gtk/tests/builder.c:

    "          <object class=\"GtkButton\" id=\"button1\">"
    "            <accessibility>"
    "              <action action_name=\"click\" description=\"Click Me\"/>"
    "            </accessibility>"
    "          </object>"

The description "Click Me" should be translatable.
Comment 5 Matthias Clasen 2008-07-12 00:55:24 UTC
How about if we allow

<object class="GtkButton" id="button1">
  <accessibility>
    <action action_name="click" translatable="yes">Click Me</action>
  </accessibility>
</object>

Of course, we'll have to keep support for the description attribute.
Comment 6 Johan (not receiving bugmail) Dahlin 2008-07-12 01:33:22 UTC
That would be pretty fine to me.
We could deprecate the description and use the text instead.
Comment 7 Matthias Clasen 2009-04-06 06:40:26 UTC
Created attachment 132170 [details] [review]
patch