From fd5cb60a1456cdd50cd2387a177d95df519dfb15 Mon Sep 17 00:00:00 2001 From: Daniel Lautzenheiser Date: Fri, 13 Oct 2023 04:04:07 -0400 Subject: [PATCH] fix: handle single file i18n (#6942) --- packages/decap-cms-core/src/backend.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/decap-cms-core/src/backend.ts b/packages/decap-cms-core/src/backend.ts index 2150cd984fd5..0f31fc8889de 100644 --- a/packages/decap-cms-core/src/backend.ts +++ b/packages/decap-cms-core/src/backend.ts @@ -314,7 +314,12 @@ function i18nRulestring(ruleString: string, { defaultLocale, structure }: I18nIn if (structure === I18N_STRUCTURE.MULTIPLE_FOLDERS) { return `${defaultLocale}\\/${ruleString}`; } - return `${ruleString}\\.${defaultLocale}\\..*`; + + if (structure === I18N_STRUCTURE.MULTIPLE_FILES) { + return `${ruleString}\\.${defaultLocale}\\..*`; + } + + return ruleString; } function collectionRegex(collection: Collection): RegExp | undefined {