mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
language: a11y: Fix property names
Blueprint uses underscores in property/state/relation names, but GtkBuilder expects dashes because it uses the glib names from the GtkAccessible* enums.
This commit is contained in:
parent
6576e02837
commit
31165b286a
5 changed files with 15 additions and 6 deletions
|
@ -28,9 +28,13 @@ class BaseAttribute(AstNode):
|
|||
tag_name: str = ""
|
||||
attr_name: str = "name"
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
return self.tokens["name"]
|
||||
|
||||
def emit_xml(self, xml: XmlEmitter):
|
||||
value = self.children[Value][0]
|
||||
attrs = { self.attr_name: self.tokens["name"] }
|
||||
attrs = { self.attr_name: self.name }
|
||||
|
||||
if isinstance(value, TranslatedStringValue):
|
||||
attrs = { **attrs, **value.attrs }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue