Compare commits

..

2 commits

Author SHA1 Message Date
jgcodes2020
79e3e4d8ab Merge branch 'variant-literal' into 'main'
Draft: Syntax for variants

See merge request jwestman/blueprint-compiler!224
2025-01-04 16:29:46 +00:00
James Westman
55e5095fba
values: Don't allow translated strings in arrays
Gtk.Builder has no way to translate individual strings in a string
array, so don't allow it in the syntax.
2025-01-03 18:56:24 -06:00
3 changed files with 16 additions and 0 deletions

View file

@ -519,6 +519,14 @@ class ArrayValue(AstNode):
range=quoted_literal.range,
)
)
elif isinstance(value.child, Translated):
errors.append(
CompileError(
"Arrays can't contain translated strings",
range=value.child.range,
)
)
if len(errors) > 0:
raise MultipleErrors(errors)

View file

@ -0,0 +1,7 @@
using Gtk 4.0;
StringList {
strings: [
_("Test")
];
}

View file

@ -0,0 +1 @@
5,5,9,Arrays can't contain translated strings