mirror of
http://112.124.100.131/huang.ze/ebiz-dify-ai.git
synced 2025-12-10 03:16:51 +08:00
Chore/slice workflow utils (#17730)
This commit is contained in:
@@ -20,3 +20,10 @@ export const setLocaleOnClient = (locale: Locale, reloadPage = true) => {
|
||||
export const getLocaleOnClient = (): Locale => {
|
||||
return Cookies.get(LOCALE_COOKIE_NAME) as Locale || i18n.defaultLocale
|
||||
}
|
||||
|
||||
export const renderI18nObject = (obj: Record<string, string>, language: string) => {
|
||||
if (!obj) return ''
|
||||
if (obj?.[language]) return obj[language]
|
||||
if (obj?.en_US) return obj.en_US
|
||||
return Object.values(obj)[0]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user