Skip to content
This repository was archived by the owner on Sep 9, 2024. It is now read-only.

Commit c37f44b

Browse files
authored
fix: handle single file i18n correctly (#936)
1 parent cc07c77 commit c37f44b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

packages/core/src/backend.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { dirname } from 'path';
1010
import { resolveFormat } from './formats/formats';
1111
import { commitMessageFormatter, slugFormatter } from './lib/formatters';
1212
import {
13+
I18N_STRUCTURE_MULTIPLE_FILES,
1314
I18N_STRUCTURE_MULTIPLE_FOLDERS,
1415
formatI18nBackup,
1516
getFilePaths,
@@ -300,7 +301,11 @@ function i18nRulestring(ruleString: string, { defaultLocale, structure }: I18nIn
300301
return `${defaultLocale}\\/${ruleString}`;
301302
}
302303

303-
return `${ruleString}\\.${defaultLocale}\\..*`;
304+
if (structure === I18N_STRUCTURE_MULTIPLE_FILES) {
305+
return `${ruleString}\\.${defaultLocale}\\..*`;
306+
}
307+
308+
return ruleString;
304309
}
305310

306311
function collectionRegex<EF extends BaseField>(collection: Collection<EF>): RegExp | undefined {

0 commit comments

Comments
 (0)