Skip to content

Commit 62f36aa

Browse files
committed
refactor(i18n): derive supported languages from translation files on disk
1 parent 109edb6 commit 62f36aa

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/utils/i18n.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,11 @@ import fs from 'fs';
33
import i18next from 'i18next';
44
import path from 'path';
55

6-
const languages = ['en', 'pt-BR', 'es', 'it'];
76
const translationsPath = path.join(__dirname, 'translations');
7+
const languages = fs
8+
.readdirSync(translationsPath)
9+
.filter((f) => f.endsWith('.json'))
10+
.map((f) => f.replace('.json', ''));
811
const configService: ConfigService = new ConfigService();
912

1013
const resources: any = {};

0 commit comments

Comments
 (0)