Update menu syntax

Sections and submenus can have IDs. Also, change the code to better
reflect the documented grammar.
This commit is contained in:
James Westman 2023-04-09 15:26:07 -05:00
parent 75055ac967
commit dd3c75d2c7
6 changed files with 44 additions and 33 deletions

View file

@ -1,5 +1,5 @@
using Gtk 4.0;
menu menu {
not-allowed: true;
not-allowed: "true";
}

View file

@ -1,2 +1,2 @@
4,5,19,Attributes are not permitted at the top level of a menu
4,16,8,Unexpected tokens
4,5,21,Attributes are not permitted at the top level of a menu
4,16,10,Unexpected tokens

View file

@ -7,7 +7,7 @@ menu my-menu {
}
item {
label: "test item";
label: C_("context", "test translated item");
}
item ("test item shorthand 1")

View file

@ -7,7 +7,7 @@
<attribute name="label">test section</attribute>
</section>
<item>
<attribute name="label">test item</attribute>
<attribute name="label" translatable="true" context="context">test translated item</attribute>
</item>
<item>
<attribute name="label">test item shorthand 1</attribute>

View file

@ -7,7 +7,7 @@ menu my-menu {
}
item {
label: "test item";
label: C_("context", "test translated item");
}
item {