@@ -131,6 +131,11 @@ describe('correctTranslatedContentStrings', () => {
131131 '{% data reusables.profile.access_org %}' ,
132132 )
133133 } )
134+
135+ test ( 'fixes siVersion → ifversion' , ( ) => {
136+ expect ( fix ( '{% siVersion productos-ghas %}' , 'es' ) ) . toBe ( '{% ifversion productos-ghas %}' )
137+ expect ( fix ( '{%- siVersion productos-ghas %}' , 'es' ) ) . toBe ( '{%- ifversion productos-ghas %}' )
138+ } )
134139 } )
135140
136141 // ─── JAPANESE (ja) ──────────────────────────────────────────────────
@@ -318,6 +323,26 @@ describe('correctTranslatedContentStrings', () => {
318323 )
319324 } )
320325
326+ test ( 'fixes en-dash in trim modifier' , ( ) => {
327+ // `{%–` — en-dash (U+2013) used instead of hyphen in `{%-` trim modifier
328+ expect ( fix ( '{%– ifversion projects-v1 %}' , 'pt' ) ) . toBe ( '{%- ifversion projects-v1 %}' )
329+ expect ( fix ( '{%– endif %}' , 'pt' ) ) . toBe ( '{%- endif %}' )
330+ } )
331+
332+ test ( 'fixes datavariables / dadosvariables (no space)' , ( ) => {
333+ // `{% datavariables` — no space between "data" and "variables" (post-translation)
334+ expect ( fix ( '{% datavariables.product.github %}' , 'pt' ) ) . toBe (
335+ '{% data variables.product.github %}' ,
336+ )
337+ expect ( fix ( '{%- datavariables.product.github %}' , 'pt' ) ) . toBe (
338+ '{%- data variables.product.github %}' ,
339+ )
340+ // `{% dadosvariables` — Portuguese "dados" fused with "variables"
341+ expect ( fix ( '{% dadosvariables.product.github %}' , 'pt' ) ) . toBe (
342+ '{% data variables.product.github %}' ,
343+ )
344+ } )
345+
321346 test ( 'fixes translated else variants' , ( ) => {
322347 expect ( fix ( '{% senão %}' , 'pt' ) ) . toBe ( '{% else %}' )
323348 expect ( fix ( '{%- senão %}' , 'pt' ) ) . toBe ( '{%- else %}' )
@@ -434,6 +459,13 @@ describe('correctTranslatedContentStrings', () => {
434459 '{% data variables.product.github %}' ,
435460 )
436461 expect ( fix ( '{% 数据可重用s.foo %}' , 'zh' ) ) . toBe ( '{% data reusables.foo %}' )
462+ // No space between `{%` and 数据
463+ expect ( fix ( '{%数据variables.product.github%}' , 'zh' ) ) . toBe (
464+ '{% data variables.product.github%}' ,
465+ )
466+ expect ( fix ( '{%数据 variables.product.github%}' , 'zh' ) ) . toBe (
467+ '{% data variables.product.github%}' ,
468+ )
437469 } )
438470
439471 test ( 'fixes translated else and raw' , ( ) => {
@@ -687,6 +719,14 @@ describe('correctTranslatedContentStrings', () => {
687719 '{% data variables.product.github %}' ,
688720 )
689721 expect ( fix ( '{% données reusables.foo %}' , 'fr' ) ) . toBe ( '{% data reusables.foo %}' )
722+ // `{% de données variables.` — preposition "de" prepended
723+ expect ( fix ( '{% de données variables.product.github %}' , 'fr' ) ) . toBe (
724+ '{% data variables.product.github %}' ,
725+ )
726+ // `{% de data variables.` — partially-corrected form
727+ expect ( fix ( '{% de data variables.product.github %}' , 'fr' ) ) . toBe (
728+ '{% data variables.product.github %}' ,
729+ )
690730 } )
691731
692732 test ( 'fixes translated else' , ( ) => {
@@ -889,6 +929,15 @@ describe('correctTranslatedContentStrings', () => {
889929 expect ( fix ( '{% 주석 끝 %}' , 'ko' ) ) . toBe ( '{% endnote %}' )
890930 expect ( fix ( '{%- 주석 끝 %}' , 'ko' ) ) . toBe ( '{%- endnote %}' )
891931 } )
932+
933+ test ( 'fixes capitalized Variables → data variables' , ( ) => {
934+ expect ( fix ( '{% data Variables.product.github %}' , 'ko' ) ) . toBe (
935+ '{% data variables.product.github %}' ,
936+ )
937+ expect ( fix ( '{%- data Variables.product.github %}' , 'ko' ) ) . toBe (
938+ '{%- data variables.product.github %}' ,
939+ )
940+ } )
892941 } )
893942
894943 // ─── GERMAN (de) ──────────────────────────────────────────────────
@@ -1088,6 +1137,44 @@ describe('correctTranslatedContentStrings', () => {
10881137 '{% ifversion enterprise-installed-apps %}' ,
10891138 )
10901139 } )
1140+
1141+ test ( 'fixes data-variables (hyphen instead of space)' , ( ) => {
1142+ expect ( fix ( '{% data-variables.product.github %}' , 'de' ) ) . toBe (
1143+ '{% data variables.product.github %}' ,
1144+ )
1145+ expect ( fix ( '{%- data-variables.product.github %}' , 'de' ) ) . toBe (
1146+ '{%- data variables.product.github %}' ,
1147+ )
1148+ } )
1149+
1150+ test ( 'fixes Datenworkflow variables → data variables' , ( ) => {
1151+ expect ( fix ( '{%- Datenworkflow variables.product.prodname_actions %}' , 'de' ) ) . toBe (
1152+ '{%- data variables.product.prodname_actions %}' ,
1153+ )
1154+ expect ( fix ( '{% Datenworkflow variables.product.prodname_actions %}' , 'de' ) ) . toBe (
1155+ '{% data variables.product.prodname_actions %}' ,
1156+ )
1157+ } )
1158+
1159+ test ( 'fixes ifec → ifversion' , ( ) => {
1160+ expect ( fix ( '{% ifec ghec %}' , 'de' ) ) . toBe ( '{% ifversion ghec %}' )
1161+ expect ( fix ( '{%- ifec ghec %}' , 'de' ) ) . toBe ( '{%- ifversion ghec %}' )
1162+ } )
1163+
1164+ test ( 'fixes andere → else' , ( ) => {
1165+ expect ( fix ( '{% andere %}' , 'de' ) ) . toBe ( '{% else %}' )
1166+ expect ( fix ( '{%- andere %}' , 'de' ) ) . toBe ( '{%- else %}' )
1167+ } )
1168+
1169+ test ( 'fixes Datenauflistung → data' , ( ) => {
1170+ // `{% Datenauflistung variables.X %}` — "data listing" compound = data
1171+ expect ( fix ( '{% Datenauflistung variables.product.github %}' , 'de' ) ) . toBe (
1172+ '{% data variables.product.github %}' ,
1173+ )
1174+ expect ( fix ( '{%- Datenauflistung variables.product.github %}' , 'de' ) ) . toBe (
1175+ '{%- data variables.product.github %}' ,
1176+ )
1177+ } )
10911178 } )
10921179
10931180 describe ( 'Generic fixes (all languages)' , ( ) => {
@@ -1108,6 +1195,28 @@ describe('correctTranslatedContentStrings', () => {
11081195 )
11091196 } )
11101197
1198+ test ( 'fixes leading dot in {% data paths' , ( ) => {
1199+ // `{% data .variables.X %}` — translator inserted a stray dot
1200+ expect ( fix ( '{% data .variables.product.prodname_ghe_server %}' , 'ja' ) ) . toBe (
1201+ '{% data variables.product.prodname_ghe_server %}' ,
1202+ )
1203+ expect ( fix ( '{%- data .variables.product.github %}' , 'pt' ) ) . toBe (
1204+ '{%- data variables.product.github %}' ,
1205+ )
1206+ expect ( fix ( '{% data .reusables.foo.bar %}' , 'zh' ) ) . toBe ( '{% data reusables.foo.bar %}' )
1207+ } )
1208+
1209+ test ( 'fixes singular variable / reusable in {% data paths' , ( ) => {
1210+ // `{% data variable.product.X %}` (singular) → `{% data variables.product.X %}`
1211+ expect ( fix ( '{% data variable.product.prodname_container_registry %}' , 'zh' ) ) . toBe (
1212+ '{% data variables.product.prodname_container_registry %}' ,
1213+ )
1214+ expect ( fix ( '{%- data variable.product.github %}' , 'es' ) ) . toBe (
1215+ '{%- data variables.product.github %}' ,
1216+ )
1217+ expect ( fix ( '{% data reusable.foo.bar %}' , 'fr' ) ) . toBe ( '{% data reusables.foo.bar %}' )
1218+ } )
1219+
11111220 test ( 'fixes capitalized platform tags across all languages' , ( ) => {
11121221 expect ( fix ( '{% Windows %}' , 'zh' ) ) . toBe ( '{% windows %}' )
11131222 expect ( fix ( '{% Eclipse %}' , 'zh' ) ) . toBe ( '{% eclipse %}' )
0 commit comments