Skip to content

Commit a7cb079

Browse files
heiskrCopilot
andauthored
🌎 Fix two translation Liquid corruptions for github/docs-engineering#6572 (#61158)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 559833c commit a7cb079

2 files changed

Lines changed: 46 additions & 0 deletions

File tree

src/languages/lib/correct-translation-content.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1027,6 +1027,17 @@ export function correctTranslatedContentStrings(
10271027
'{% ifversion ghes %}Владелец предприятия может{%else %}{% data variables.product.company_short %} перенести образы Docker, ранее хранящиеся в реестре Docker на {% data variables.product.github %} на {% data variables.product.prodname_container_registry %}.',
10281028
'{% ifversion ghes %}Владелец предприятия может{% else %}{% data variables.product.company_short %} может{% endif %} перенести образы Docker, ранее хранящиеся в реестре Docker на {% data variables.product.github %} на {% data variables.product.prodname_container_registry %}.',
10291029
)
1030+
1031+
// [SCRAPE-6572] Per-file fix:
1032+
// repositories/viewing-activity-and-data-for-your-repository/viewing-a-projects-contributors.md
1033+
// (intro): translator swapped `{% endif %}` and `{% ifversion fpt or ghec %}`,
1034+
// leaving an orphan `endif` at the start of the intro and the `ifversion`
1035+
// unclosed. This broke the `/ru/repositories` landing page scrape since
1036+
// this page is one of its children. Restore correct ordering.
1037+
content = content.replaceAll(
1038+
'Вы можете увидеть, кто внес{% endif %} коммиты в репозиторий{% ifversion fpt or ghec %} и его зависимости.',
1039+
'Вы можете увидеть, кто внес коммиты в репозиторий{% ifversion fpt or ghec %} и его зависимости{% endif %}.',
1040+
)
10301041
}
10311042

10321043
if (context.code === 'fr') {
@@ -1320,6 +1331,18 @@ export function correctTranslatedContentStrings(
13201331
'인스턴스에서 기본 제공 인증{% endif %}를 사용하는 경우 {% data variables.product.github %} 계정 {% ifversion ghes %}의 사용자 이름을 변경할 수 있습니다.',
13211332
'{% data variables.product.github %} 계정의 사용자 이름을 변경할 수 있습니다.{% ifversion ghes %} 인스턴스에서 기본 제공 인증을 사용하는 경우.{% endif %}',
13221333
)
1334+
1335+
// [SCRAPE-6572] Per-file fix:
1336+
// code-security/how-tos/secure-your-supply-chain/manage-your-dependency-security/configuring-access-to-private-registries-for-dependabot.md
1337+
// (intro): translator dropped the closing `{% endif %}` and replaced it
1338+
// with a duplicate `{% data variables.product.prodname_dependabot %}`
1339+
// reference. This left `{% ifversion dependabot-on-actions-self-hosted %}`
1340+
// unclosed and broke the `/ko/code-security` landing page scrape since
1341+
// this page is one of its children. Restore the `{% endif %}`.
1342+
content = content.replaceAll(
1343+
'자체 호스팅된 실행기에서 실행 중인 {% data variables.product.prodname_dependabot %}에 대한 액세스를 구성할 수도 있습니다.{% data variables.product.prodname_dependabot %}',
1344+
'자체 호스팅된 실행기에서 실행 중인 {% data variables.product.prodname_dependabot %}에 대한 액세스를 구성할 수도 있습니다.{% endif %}',
1345+
)
13231346
}
13241347

13251348
if (context.code === 'de') {

src/languages/tests/correct-translation-content.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1878,4 +1878,27 @@ Para más información, consulta "[AUTOTITLE](/path)".
18781878
expect(out).toBe(text)
18791879
})
18801880
})
1881+
1882+
// ─── SCRAPE-6572: search-scrape failures ─────────────────────────────
1883+
// Tests for the per-file Liquid corrections added to stop the daily
1884+
// search-scrape failures reported in github/docs-engineering#6572.
1885+
describe('SCRAPE-6572 per-file fixes', () => {
1886+
test('ko: configuring-access-to-private-registries-for-dependabot intro missing endif', () => {
1887+
const broken =
1888+
'자체 호스팅된 실행기에서 실행 중인 {% data variables.product.prodname_dependabot %}에 대한 액세스를 구성할 수도 있습니다.{% data variables.product.prodname_dependabot %}'
1889+
const out = fix(broken, 'ko')
1890+
expect(out).toContain('{% endif %}')
1891+
expect(out).not.toMatch(
1892+
/ \.\{% data variables\.product\.prodname_dependabot %\}$/,
1893+
)
1894+
})
1895+
1896+
test('ru: viewing-a-projects-contributors intro swapped endif/ifversion', () => {
1897+
const broken =
1898+
'Вы можете увидеть, кто внес{% endif %} коммиты в репозиторий{% ifversion fpt or ghec %} и его зависимости.'
1899+
const out = fix(broken, 'ru')
1900+
expect(out).not.toContain('внес{% endif %}')
1901+
expect(out).toMatch(/\{% ifversion fpt or ghec %\} и его зависимости\{% endif %\}\.$/)
1902+
})
1903+
})
18811904
})

0 commit comments

Comments
 (0)