From c37f44b5f51293b24b090304167cec8547c264f6 Mon Sep 17 00:00:00 2001 From: Daniel Lautzenheiser Date: Thu, 12 Oct 2023 12:03:26 -0400 Subject: [PATCH] fix: handle single file i18n correctly (#936) --- packages/core/src/backend.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/core/src/backend.ts b/packages/core/src/backend.ts index 05208b2b9..d14d01e40 100644 --- a/packages/core/src/backend.ts +++ b/packages/core/src/backend.ts @@ -10,6 +10,7 @@ import { dirname } from 'path'; import { resolveFormat } from './formats/formats'; import { commitMessageFormatter, slugFormatter } from './lib/formatters'; import { + I18N_STRUCTURE_MULTIPLE_FILES, I18N_STRUCTURE_MULTIPLE_FOLDERS, formatI18nBackup, getFilePaths, @@ -300,7 +301,11 @@ function i18nRulestring(ruleString: string, { defaultLocale, structure }: I18nIn return `${defaultLocale}\\/${ruleString}`; } - return `${ruleString}\\.${defaultLocale}\\..*`; + if (structure === I18N_STRUCTURE_MULTIPLE_FILES) { + return `${ruleString}\\.${defaultLocale}\\..*`; + } + + return ruleString; } function collectionRegex(collection: Collection): RegExp | undefined {