Localized help urls:

Links to documentation are now using the front-end language to point to the translated documentation page
(except for some links generated from the backend, in the diagnostic tool for example).

Partial fix for #224.
This commit is contained in:
John Livingston
2023-09-06 17:58:54 +02:00
parent 21de3404c3
commit 5ecff1d916
5 changed files with 57 additions and 8 deletions

View File

@ -4,7 +4,7 @@ import { helpButtonSVG } from './buttons'
import { logger } from './logger'
import { getIframeUri, getXMPPAddr, UriOptions } from './uri'
import { isAutoColorsAvailable } from 'shared/lib/autocolors'
import { helpUrl } from 'shared/lib/help'
import { localizedHelpUrl } from '../utils/help'
interface ShareForm {
shareString: HTMLInputElement
@ -25,6 +25,10 @@ interface ShareForm {
async function shareChatUrl (registerOptions: RegisterClientOptions, settings: any, video: Video): Promise<void> {
const peertubeHelpers = registerOptions.peertubeHelpers
const streamersHelpUrl = await localizedHelpUrl(registerOptions, {
page: 'documentation/user/streamers'
})
const [
labelShare,
labelWeb,
@ -92,9 +96,7 @@ async function shareChatUrl (registerOptions: RegisterClientOptions, settings: a
divShareString.append(openButton)
const helpButton = document.createElement('a')
helpButton.href = helpUrl({
page: 'documentation/user/streamers'
})
helpButton.href = streamersHelpUrl
helpButton.target = '_blank'
helpButton.innerHTML = helpButtonSVG()
helpButton.title = labelHelp