mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
Add GtkComboBoxText items
This commit is contained in:
parent
f1e1811e1f
commit
aa447466c0
12 changed files with 137 additions and 17 deletions
|
@ -455,15 +455,16 @@ class BaseAttribute(AstNode):
|
|||
""" A helper class for attribute syntax of the form `name: literal_value;`"""
|
||||
|
||||
tag_name: str = ""
|
||||
attr_name: str = "name"
|
||||
|
||||
def emit_xml(self, xml: XmlEmitter):
|
||||
value = self.children[Value][0]
|
||||
translatable = isinstance(value, TranslatedStringValue)
|
||||
xml.start_tag(
|
||||
self.tag_name,
|
||||
name=self.tokens["name"],
|
||||
translatable="true" if translatable else None,
|
||||
)
|
||||
attrs = {
|
||||
self.attr_name: self.tokens["name"],
|
||||
"translatable": "true" if translatable else None
|
||||
}
|
||||
xml.start_tag(self.tag_name, **attrs)
|
||||
if translatable:
|
||||
xml.put_text(value.string)
|
||||
else:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue