@@ -124,6 +124,13 @@ describe('correctTranslatedContentStrings', () => {
124124 expect ( fix ( '{%- icono "check" %}' , 'es' ) ) . toBe ( '{%- octicon "check" %}' )
125125 } )
126126
127+ test ( 'fixes alto → octicon' , ( ) => {
128+ expect ( fix ( '{% alto "link-external":16 aria-label="link-external" %}' , 'es' ) ) . toBe (
129+ '{% octicon "link-external":16 aria-label="link-external" %}' ,
130+ )
131+ expect ( fix ( '{%- alto "check" %}' , 'es' ) ) . toBe ( '{%- octicon "check" %}' )
132+ } )
133+
127134 test ( 'fixes octicon "bombilla" → octicon "light-bulb"' , ( ) => {
128135 expect ( fix ( '{% octicon "bombilla" aria-label="The light-bulb icon" %}' , 'es' ) ) . toBe (
129136 '{% octicon "light-bulb" aria-label="The light-bulb icon" %}' ,
@@ -424,6 +431,14 @@ describe('correctTranslatedContentStrings', () => {
424431 expect ( fix ( '{% if condition ou other %}' , 'pt' ) ) . toBe ( '{% if condition or other %}' )
425432 } )
426433
434+ test ( 'fixes multi-plan word-order swap with ou (ghes ifversion ou ghec)' , ( ) => {
435+ // `{% ghes ifversion ou ghec %}` — word-order swap + Portuguese "ou" for "or"
436+ expect ( fix ( '{% ghes ifversion ou ghec %}' , 'pt' ) ) . toBe ( '{% ifversion ghes or ghec %}' )
437+ expect ( fix ( '{%- ghes ifversion ou ghec %}' , 'pt' ) ) . toBe ( '{%- ifversion ghes or ghec %}' )
438+ expect ( fix ( '{% fpt ifversion ou ghec %}' , 'pt' ) ) . toBe ( '{% ifversion fpt or ghec %}' )
439+ expect ( fix ( '{% ghec ifversion ou ghes %}' , 'pt' ) ) . toBe ( '{% ifversion ghec or ghes %}' )
440+ } )
441+
427442 test ( 'fixes fully translated reutilizáveis reusables path' , ( ) => {
428443 // `reutilizáveis` is Portuguese for "reusables"
429444 expect ( fix ( '{% dados reutilizáveis.repositórios.reaction_list %}' , 'pt' ) ) . toBe (
@@ -956,6 +971,41 @@ describe('correctTranslatedContentStrings', () => {
956971 fix ( '{% données réutilisables propriétés-personnalisées valeurs-requises %}' , 'fr' ) ,
957972 ) . toBe ( '{% data reusables.organizations.custom-properties-required-values %}' )
958973 } )
974+
975+ test ( 'fixes modules réutilisables → data reusables' , ( ) => {
976+ expect ( fix ( '{% modules réutilisables.enterprise_migrations.ready-to-import %}' , 'fr' ) ) . toBe (
977+ '{% data reusables.enterprise_migrations.ready-to-import %}' ,
978+ )
979+ expect ( fix ( '{%- modules réutilisables.foo.bar %}' , 'fr' ) ) . toBe (
980+ '{%- data reusables.foo.bar %}' ,
981+ )
982+ } )
983+
984+ test ( 'fixes flux de travail variables → data variables' , ( ) => {
985+ // `{% flux de travail variables.` — French "flux de travail" (workflow) mistakenly
986+ // used as the Liquid tag name instead of "data".
987+ expect ( fix ( '{% flux de travail variables.product.prodname_actions %}' , 'fr' ) ) . toBe (
988+ '{% data variables.product.prodname_actions %}' ,
989+ )
990+ expect ( fix ( '{%- flux de travail variables.copilot.foo %}' , 'fr' ) ) . toBe (
991+ '{%- data variables.copilot.foo %}' ,
992+ )
993+ } )
994+
995+ test ( 'fixes invite → prompt' , ( ) => {
996+ expect ( fix ( '{% invite %}' , 'fr' ) ) . toBe ( '{% prompt %}' )
997+ expect ( fix ( '{%- invite %}' , 'fr' ) ) . toBe ( '{%- prompt %}' )
998+ expect ( fix ( '{% invite -%}' , 'fr' ) ) . toBe ( '{% prompt -%}' )
999+ } )
1000+
1001+ test ( 'fixes collaborateurs invités ifversion → ifversion guest-collaborators' , ( ) => {
1002+ expect ( fix ( '{% collaborateurs invités ifversion %}' , 'fr' ) ) . toBe (
1003+ '{% ifversion guest-collaborators %}' ,
1004+ )
1005+ expect ( fix ( '{%- collaborateurs invités ifversion %}' , 'fr' ) ) . toBe (
1006+ '{%- ifversion guest-collaborators %}' ,
1007+ )
1008+ } )
9591009 } )
9601010
9611011 // ─── KOREAN (ko) ──────────────────────────────────────────────────
@@ -1606,6 +1656,24 @@ describe('correctTranslatedContentStrings', () => {
16061656 )
16071657 } )
16081658
1659+ test ( 'fixes missing endprompt on the JS-numCats line (all translation languages)' , ( ) => {
1660+ // The `${}` template literal inside a backtick confused translators and they dropped
1661+ // `{% endprompt %}` from the line. Fix is applied universally across all languages.
1662+ const input =
1663+ "* {% prompt %}How do I write `The ${'cat is' : 'cats are'} hungry.`?{% endprompt %}\n" +
1664+ "* {% prompt %}In JS I'd write: `The ${'cat is' : 'cats are'} hungry.`. ¿How in NEW-LANGUAGE?\n" +
1665+ '* {% prompt %}Next question?{% endprompt %}'
1666+ const output =
1667+ "* {% prompt %}How do I write `The ${'cat is' : 'cats are'} hungry.`?{% endprompt %}\n" +
1668+ "* {% prompt %}In JS I'd write: `The ${'cat is' : 'cats are'} hungry.`. ¿How in NEW-LANGUAGE?{% endprompt %}\n" +
1669+ '* {% prompt %}Next question?{% endprompt %}'
1670+ expect ( fix ( input , 'es' ) ) . toBe ( output )
1671+ expect ( fix ( input , 'pt' ) ) . toBe ( output )
1672+ expect ( fix ( input , 'zh' ) ) . toBe ( output )
1673+ expect ( fix ( input , 'de' ) ) . toBe ( output )
1674+ expect ( fix ( input , 'fr' ) ) . toBe ( output )
1675+ } )
1676+
16091677 test ( 'recovers linebreaks from English' , ( ) => {
16101678 const en = '{% endif %}\nSome text'
16111679 const translated = '{% endif %} Some text'
0 commit comments