feat: Plugin page related document supports multiple languages (#19197)

This commit is contained in:
诗浓
2025-05-03 20:03:56 +08:00
committed by GitHub
parent bb1d1dc263
commit 50fa0d1512
3 changed files with 21 additions and 3 deletions

View File

@@ -1,3 +1,5 @@
import { LanguagesSupported } from '@/i18n/language'
import {
categoryKeys,
tagKeys,
@@ -10,3 +12,15 @@ export const getValidTagKeys = (tags: string[]) => {
export const getValidCategoryKeys = (category?: string) => {
return categoryKeys.find(key => key === category)
}
export const getDocsUrl = (locale: string, path: string) => {
let localePath = 'en'
if (locale === LanguagesSupported[1])
localePath = 'zh-hans'
else if (locale === LanguagesSupported[7])
localePath = 'ja-jp'
return `https://docs.dify.ai/${localePath}${path}`
}