Merge branch 'hotfix/v2.0.1' into bugfix/deeplink

This commit is contained in:
Alexey Safronov 2023-12-11 16:54:55 +04:00
commit 258bab5b34
3 changed files with 3 additions and 5 deletions

View File

@ -336,7 +336,7 @@ export const isLanguageRtl = (lng: string) => {
// temporary function needed to replace rtl language in Editor to ltr
export const getLtrLanguageForEditor = (
userLng: string,
userLng: string | undefined,
portalLng: string,
isEditor: boolean = false
): string => {
@ -349,7 +349,6 @@ export const getLtrLanguageForEditor = (
if ((!isEditor && !isEditorPath) || (userLng && !isUserLngRtl))
return userLng;
if (portalLng && !isPortalLngRtl) return portalLng;
return "en";
};

View File

@ -181,7 +181,7 @@ if (IS_DEVELOPMENT) {
const portalLng =
getLanguage(initialEditorState?.portalSettings?.culture) || "en";
const userLng = getLanguage(initialEditorState?.user?.cultureName) || "en";
const userLng = getLanguage(initialEditorState?.user?.cultureName);
const finalLng = getLtrLanguageForEditor(userLng, portalLng, true);
await i18next.changeLanguage(finalLng);

View File

@ -156,10 +156,9 @@ export const initDocEditor = async (req) => {
config.editorConfig.customization.logo.url +
getLogoFromPath(config.editorConfig.customization.customer.logo);
}
// needed to reset rtl language in Editor
config.editorConfig.lang = getLtrLanguageForEditor(
user?.cultureName || "en",
user?.cultureName,
settings.culture,
true
);