зеркало из https://github.com/github/docs.git
correct language link in header notification (#29799)
This commit is contained in:
Родитель
101e7155c8
Коммит
5084160024
|
@ -31,9 +31,13 @@ export const HeaderNotifications = () => {
|
|||
const translationNotices: Array<Notif> = []
|
||||
if (router.locale === 'en') {
|
||||
if (userLanguage && userLanguage !== 'en') {
|
||||
let href = `/${userLanguage}`
|
||||
if (currentPathWithoutLanguage !== '/') {
|
||||
href += currentPathWithoutLanguage
|
||||
}
|
||||
translationNotices.push({
|
||||
type: NotificationType.TRANSLATION,
|
||||
content: `This article is also available in <a href="/${userLanguage}${currentPathWithoutLanguage}">${languages[userLanguage]?.name}</a>.`,
|
||||
content: `This article is also available in <a href="${href}">${languages[userLanguage]?.name}</a>.`,
|
||||
})
|
||||
}
|
||||
} else {
|
||||
|
|
Загрузка…
Ссылка в новой задаче