Skip to content

Commit 2d83ef5

Browse files
committed
playwright: add a regression test for the git remote renom issue
A bug in one of the translated manual pages was reported via https://discord.com/channels/1042895022950994071/1043101606549401661/1248660690676224124 where the command `git remote rename` was translated to `git remote renom`. While it _is_ true that the French translation of the noun "rename" is "renom", in this instance the translation is incorrect because it is a Git command, and Git will complain about an unknown subcommand when thusly invoked. It's a bit tricky to find the source of these contents of git-scm.com: https://github.com/jnavila/git-html-l10n/blob/master/fr/git-remote.txt, Or at least it _should_ be, but strangely enough that source does not have the typo and it has not changed for the last 7 months. The actual _actual_ source of these git-scm.com contents is https://github.com/jnavila/git-manpages-l10n/blob/master/po/documentation.fr.po, from which `git-html-l10n` is auto-generated, but even there, the text correctly reads `git remote rename`. Digging a bit deeper, this was fixed in jnavila/git-manpages-l10n@b435bfd (Translated using Weblate (French), 2022-04-16) and that fix trickled into jnavila/git-html-l10n@506285b (update 2022-04-22, 2022-04-22) a week later. But apparently almost 2.5 years later, the fix did not make it to the Git home page. Most likely the problem is a glitch somewhere in the cache/database of the Rails app. Document this particular problem as fixed in the Hugo/Pagefind version of Git's home page, and as broken on the Rails app version, by specifically checking for this in the Playwright tests. Reported-by: emmanuel Hesry <[email protected]> Signed-off-by: Johannes Schindelin <[email protected]>
1 parent b037fa5 commit 2d83ef5

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/git-scm.spec.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,18 @@ test('manual pages', async ({ page }) => {
158158
await expect(gitRevisionsLink).toHaveAttribute('href', /\/docs\/gitrevisions\/fr$/)
159159
await gitRevisionsLink.click()
160160
await expect(page).toHaveURL(/\/docs\/gitrevisions$/)
161+
162+
// Ensure that the French mis-translation of `git remote renom` is not present
163+
await page.goto(`${url}docs/git-remote/fr`)
164+
const synopsis = page.locator('xpath=//h2[contains(text(), "SYNOPSIS")]/following-sibling::*[1]').first()
165+
if (isRailsApp) {
166+
// This is a bug in the Rails app, and it is unclear what the root cause is
167+
await expect(synopsis).not.toHaveText(/git remote rename.*<ancien> <nouveau>/)
168+
await expect(synopsis).toHaveText(/git remote renom.*<ancien> <nouveau>/)
169+
} else {
170+
await expect(synopsis).toHaveText(/git remote rename.*<ancien> <nouveau>/)
171+
await expect(synopsis).not.toHaveText(/git remote renom.*<ancien> <nouveau>/)
172+
}
161173
})
162174

163175
test('book', async ({ page }) => {

0 commit comments

Comments
 (0)