From 42ec8e8252255ab4b5d11eb7226c2fa183bf5ee1 Mon Sep 17 00:00:00 2001 From: Daniel Lautzenheiser Date: Fri, 1 Sep 2023 12:14:34 -0400 Subject: [PATCH] fix: i18n reversion (#860) --- .../core/src/components/entry-editor/EditorInterface.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/core/src/components/entry-editor/EditorInterface.tsx b/packages/core/src/components/entry-editor/EditorInterface.tsx index a60a4274..e2159bb1 100644 --- a/packages/core/src/components/entry-editor/EditorInterface.tsx +++ b/packages/core/src/components/entry-editor/EditorInterface.tsx @@ -4,7 +4,7 @@ import { ScrollSyncPane } from 'react-scroll-sync'; import { EDITOR_SIZE_COMPACT } from '@staticcms/core/constants/views'; import { summaryFormatter } from '@staticcms/core/lib/formatters'; import useBreadcrumbs from '@staticcms/core/lib/hooks/useBreadcrumbs'; -import { getI18nInfo, hasI18n } from '@staticcms/core/lib/i18n'; +import { getI18nInfo, getPreviewEntry, hasI18n } from '@staticcms/core/lib/i18n'; import classNames from '@staticcms/core/lib/util/classNames.util'; import { getFileFromSlug, @@ -305,6 +305,10 @@ const EditorInterface = ({ [collection, entry, fields, fieldsErrors, handleLocaleChange, selectedLocale, submitted, t], ); + const previewEntry = collectHasI18n + ? getPreviewEntry(entry, selectedLocale, defaultLocale) + : entry; + const mobileLocaleEditor = useMemo( () => (