mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-08-19 06:48:25 +08:00
fix(share): The language of the shared page will cause the language of the original website to change. (#18043)
This commit is contained in:
@@ -97,7 +97,11 @@ export const loadLanguageAsync = async (lng: string): Promise<void> => {
|
||||
}
|
||||
};
|
||||
|
||||
export const changeLanguageAsync = async (lng: string): Promise<void> => {
|
||||
export const changeLanguageAsync = async (
|
||||
lng: string,
|
||||
options: { persist?: boolean } = {},
|
||||
): Promise<void> => {
|
||||
const { persist = true } = options;
|
||||
const normalizedLng = lng;
|
||||
|
||||
if (
|
||||
@@ -107,7 +111,9 @@ export const changeLanguageAsync = async (lng: string): Promise<void> => {
|
||||
await loadLanguageAsync(normalizedLng);
|
||||
}
|
||||
|
||||
storage.setLanguage(lng);
|
||||
if (persist) {
|
||||
storage.setLanguage(lng);
|
||||
}
|
||||
|
||||
updateDocumentLocale(lng);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user