Skip to content

Commit 3164da1

Browse files
committed
Format SDK i18n files and account for locale in front-component context test
1 parent c91091d commit 3164da1

3 files changed

Lines changed: 12 additions & 4 deletions

File tree

packages/twenty-front/src/modules/front-components/hooks/__tests__/useFrontComponentExecutionContext.test.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ describe('useFrontComponentExecutionContext', () => {
180180
recordId: 'record-456',
181181
selectedRecordIds: ['record-456'],
182182
colorScheme: 'light',
183+
locale: i18n.locale,
183184
});
184185
});
185186

@@ -195,6 +196,7 @@ describe('useFrontComponentExecutionContext', () => {
195196
recordId: null,
196197
selectedRecordIds: ['record-1', 'record-2', 'record-3'],
197198
colorScheme: 'light',
199+
locale: i18n.locale,
198200
});
199201
});
200202

packages/twenty-sdk/src/cli/utilities/i18n/compile-application-translations.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ export const compileApplicationTranslations = async (
1616
return undefined;
1717
}
1818

19-
const localeFiles = (await readdir(localesDir)).filter(
20-
(entry) => entry.endsWith('.json'),
19+
const localeFiles = (await readdir(localesDir)).filter((entry) =>
20+
entry.endsWith('.json'),
2121
);
2222

2323
const translations: Record<string, Record<string, string>> = {};

packages/twenty-sdk/src/cli/utilities/i18n/extract-application-translations.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@ export const extractApplicationTranslations = async ({
3030
sourceCatalog[source] = source;
3131
}
3232

33-
await writeJson(path.join(localesDir, `${SOURCE_LOCALE}.json`), sourceCatalog);
33+
await writeJson(
34+
path.join(localesDir, `${SOURCE_LOCALE}.json`),
35+
sourceCatalog,
36+
);
3437

3538
const existingLocaleFiles = (await readdir(localesDir)).filter(
3639
(entry) => entry.endsWith('.json') && entry !== `${SOURCE_LOCALE}.json`,
@@ -48,5 +51,8 @@ export const extractApplicationTranslations = async ({
4851
await writeJson(filePath, merged);
4952
}
5053

51-
return { sourceCount: sources.length, updatedLocaleFiles: existingLocaleFiles };
54+
return {
55+
sourceCount: sources.length,
56+
updatedLocaleFiles: existingLocaleFiles,
57+
};
5258
};

0 commit comments

Comments
 (0)