feat: Plugin page related document supports multiple languages (#19197)
This commit is contained in:
@@ -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}`
|
||||
}
|
||||
|
Reference in New Issue
Block a user