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

Commit

Permalink
fix: handle single file i18n correctly (#936)
Browse files Browse the repository at this point in the history
  • Loading branch information
KaneFreeman authored Oct 12, 2023
1 parent cc07c77 commit c37f44b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/core/src/backend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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<EF extends BaseField>(collection: Collection<EF>): RegExp | undefined {
Expand Down

0 comments on commit c37f44b

Please sign in to comment.