Skip to content

Commit 59db2cf

Browse files
heiskrCopilot
andauthored
Fix ru saml-access intro orphaned else conditional (#62094)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent f290a34 commit 59db2cf

2 files changed

Lines changed: 30 additions & 0 deletions

File tree

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1251,6 +1251,19 @@ export function correctTranslatedContentStrings(
12511251
'{% ifversion ghec %}аутентификации и{% endif %} провизионирования SCIM{% else %}с помощью Okta',
12521252
'{% ifversion ghec %}SCIM{% else %}аутентификации и{% endif %} провизионирования с помощью Okta',
12531253
)
1254+
1255+
// [SCRAPE-6732] admin/managing-accounts-and-repositories/managing-users-in-your-enterprise/viewing-and-managing-a-users-saml-access-to-your-enterprise.md
1256+
// (intro): translator scrambled `{% ifversion ghec %}...{% else %}...{% endif %}`
1257+
// so the `{% else %}` ended up before any opening `{% ifversion %}` (an orphan)
1258+
// and the `{% ifversion ghec %}` moved into the else branch. This breaks the
1259+
// admin landing page render (`tag "else" not found`). Reconstruct to match
1260+
// English: view and revoke an enterprise member's {% ifversion ghec %}linked
1261+
// identity, active sessions, and authorized credentials{% else %}active SAML
1262+
// sessions{% endif %}. The corrector runs on the PARSED intro value.
1263+
content = content.replaceAll(
1264+
'связанную личность, активные сессии и авторизованные учетные{% else %}данные {% ifversion ghec %}SAML{% endif %}',
1265+
'{% ifversion ghec %}связанную личность, активные сессии и авторизованные учетные данные{% else %}активные сессии SAML{% endif %}',
1266+
)
12541267
}
12551268

12561269
if (context.code === 'fr') {

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2437,4 +2437,21 @@ Para más información, consulta "[AUTOTITLE](/path)".
24372437
expect(fix(broken, 'de')).toBe('auf selbst-gehosteten Runnern ausführen.{% endif %}')
24382438
})
24392439
})
2440+
2441+
// ─── SCRAPE-6732: search-scrape failures ─────────────────────────────
2442+
// The ru admin landing page failed to scrape with `tag "else" not found`
2443+
// because the intro of viewing-and-managing-a-users-saml-access-to-your-enterprise.md
2444+
// had an orphaned `{% else %}` before any opening `{% ifversion %}`
2445+
// (github/docs-engineering#6732). The corrector runs on the PARSED intro value.
2446+
describe('SCRAPE-6732 per-file fixes', () => {
2447+
test('ru: viewing-and-managing-a-users-saml-access intro reorders orphaned else', () => {
2448+
const broken =
2449+
'Вы можете просматривать и отзывать связанную личность, активные сессии и авторизованные учетные{% else %}данные {% ifversion ghec %}SAML{% endif %} участника предприятия.'
2450+
const fixed =
2451+
'Вы можете просматривать и отзывать {% ifversion ghec %}связанную личность, активные сессии и авторизованные учетные данные{% else %}активные сессии SAML{% endif %} участника предприятия.'
2452+
expect(fix(broken, 'ru')).toBe(fixed)
2453+
// idempotent: the fix only matches the broken form
2454+
expect(fix(fixed, 'ru')).toBe(fixed)
2455+
})
2456+
})
24402457
})

0 commit comments

Comments
 (0)