1
0
mirror of synced 2026-01-08 12:01:53 -05:00

Merge pull request #26308 from github/repo-sync

Repo sync
This commit is contained in:
docs-bot
2023-06-28 05:37:41 -07:00
committed by GitHub
7 changed files with 0 additions and 46 deletions

View File

@@ -1,9 +0,0 @@
export default function localization() {
const linkToEnglish = document.querySelector('#to-english-doc') as HTMLAnchorElement
if (linkToEnglish) {
const pathname = window.location.pathname.split('/')
pathname[1] = 'en'
linkToEnglish.href = pathname.join('/')
}
}

View File

@@ -46,11 +46,6 @@ export const HeaderNotifications = () => {
type: NotificationType.TRANSLATION,
content: data.reusables.policies.translation,
})
} else if (router.locale) {
translationNotices.push({
type: NotificationType.TRANSLATION,
content: t('notices.localization_complete'),
})
}
}
const releaseNotices: Array<Notif> = []

View File

@@ -8,10 +8,6 @@ header:
release_candidate:
# The version name is rendered before the below text via includes/header-notification.html
' is currently available as a release candidate. For more information, see "<a href="/admin/overview/about-upgrades-to-new-releases">About upgrades to new releases</a>."'
localization_complete:
We publish frequent updates to our documentation, and translation of this page may still be in progress.
For the most current information, please visit the
<a id="to-english-doc" href="/en">English documentation</a>.
early_access: 📣 Please <b>do not share</b> this URL publicly. This page contains content about an early access feature.
release_notes_use_latest: Please use the latest release for the latest security, performance, and bug fixes.
# GHES release notes

View File

@@ -5,7 +5,6 @@ import { useRouter } from 'next/router'
// typically operating on elements **within** an article.
import copyCode from 'components/lib/copy-code'
import toggleAnnotation from 'components/lib/toggle-annotations'
import localization from 'components/lib/localization'
import wrapCodeTerms from 'components/lib/wrap-code-terms'
import { MainContextT, MainContext, getMainContext } from 'components/context/MainContext'
@@ -40,7 +39,6 @@ import { useEffect } from 'react'
function initiateArticleScripts() {
copyCode()
localization()
wrapCodeTerms()
toggleAnnotation()
}

View File

@@ -8,10 +8,6 @@ header:
release_candidate:
# The version name is rendered before the below text via includes/header-notification.html
' is currently available as a release candidate. For more information, see "<a href="/admin/overview/about-upgrades-to-new-releases">About upgrades to new releases</a>."'
localization_complete:
We publish frequent updates to our documentation, and translation of this page may still be in progress.
For the most current information, please visit the
<a id="to-english-doc" href="/en">English documentation</a>.
early_access: 📣 Please <b>do not share</b> this URL publicly. This page contains content about an early access feature.
release_notes_use_latest: Please use the latest release for the latest security, performance, and bug fixes.
# GHES release notes

View File

@@ -456,13 +456,6 @@ test.describe('translations', () => {
await expect(page.getByRole('heading', { name: '日本 GitHub Docs' })).toBeVisible()
})
test('switch to English from Japanese using banner on home page', async ({ page }) => {
await page.goto('/ja')
await page.getByRole('link', { name: 'English documentation' }).click()
await expect(page).toHaveURL('/en')
await expect(page.getByRole('heading', { name: 'GitHub Docs' })).toBeVisible()
})
test('switch to Japanese from English using widget on home page', async ({ page }) => {
await page.goto('/en')
await page.getByRole('button', { name: 'Select language: current language is English' }).click()
@@ -475,14 +468,6 @@ test.describe('translations', () => {
await expect(page).toHaveURL('/ja')
})
test('switch to English from Japanese using banner on article', async ({ page }) => {
await page.goto('/ja/get-started/quickstart/hello-world')
await expect(page.getByRole('heading', { name: 'こんにちは World' })).toBeVisible()
await page.getByRole('link', { name: 'English documentation' }).click()
await expect(page).toHaveURL('/en/get-started/quickstart/hello-world')
await expect(page.getByRole('heading', { name: 'Hello World' })).toBeVisible()
})
test('switch to Japanese from English using widget on article', async ({ page }) => {
await page.goto('/get-started/quickstart/hello-world')
await page.getByRole('button', { name: 'Select language: current language is English' }).click()

View File

@@ -16,13 +16,6 @@ describe('translations', () => {
// You gotta know your tests/fixtures/translations/ja-jp/data/ui.yml
expect(h1).toBe('日本 GitHub Docs')
// The header banner mentions something about
// "For the most up-to-date content, see the English version."
const notification = $('[data-testid="header-notification"]')
expect(notification.length).toBe(1)
const toEnglishDoc = notification.find('a#to-english-doc')
expect(toEnglishDoc.text()).toBe('English documentation')
// Sidebar uses the translated shortTitle
const links = $('[data-testid=sidebar] a[href]')
const hrefs = links