Translate just a portion of a label in XML Gtk+ UI definition

Given this GtkLabel:

var label = new Gtk.Label (_ (“Something”) + “:”);

Is tehre any way to write a XML definition of a label that mark as translatable a portion of the text in the label, as is done in the code above?

<object class=“GtkLabel” id=“label”>
<property name=“label” translatable=“yes”>Something:</property>

This will mark the “:” character as transalatable too.

I couldn’t find anything about this.

Best regards.

No, there’s no such thing.

You also don’t want to do that; just leave the : in the translatable string. Concatenating translatable strings with other strings is generally a bad idea.

You probably want to add a context attribute, instead; or a translator notice, describing where the label is used.

1 Like

https://wiki.gnome.org/TranslationProject/DevGuidelines/Never%20split%20sentences

1 Like

…and I would just like to add another hit on the nail: yes, even the : at the end should be there and is relevant for translation. For example, in French you’d want to add some kind of space (ask the typo nerds) before the colon, whereas in English you wouldn’t.

So just leave the whole string alone, translators won’t complain they have to translate both “Something” and “Something:”, it’s normal and more often than not they’ll use a software that will even give a meaningful suggestion once they did one or the other.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.