Skip to content

Commit d931e85

Browse files
authored
Merge pull request #972 from Shopify/fix/pluralized-translations
Pluralized html translations are valid
2 parents 1a4a4d2 + 8ae9da0 commit d931e85

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

schemas/theme/translations.json

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,15 @@
1616
},
1717
"patternProperties": {
1818
".*_html$": {
19-
"type": "string",
20-
"description": "Translation string that contains HTML. The '_html' suffix prevents the HTML content from being escaped."
19+
"oneOf": [
20+
{
21+
"type": "string",
22+
"description": "A string that can contain HTML content, typically used for translations that include HTML tags."
23+
},
24+
{
25+
"$ref": "#/definitions/pluralizedString"
26+
}
27+
]
2128
}
2229
},
2330
"definitions": {

tests/fixtures/translations-1.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
"pluralized": {
66
"one": "{{ count }} thing",
77
"other": "{{ count }} things"
8+
},
9+
"pluralized_html": {
10+
"one": "<script>console.log</script> {{ count }} thing",
11+
"other": "<script>console.log</script> {{ count }} things"
812
}
913
}
1014
}

0 commit comments

Comments
 (0)