-
Notifications
You must be signed in to change notification settings - Fork 9
/
lingui.config.ts
43 lines (38 loc) · 986 Bytes
/
lingui.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import type { LinguiConfig } from '@lingui/conf';
import { formatter } from '@lingui/format-po';
// The list of locales supported by the application. This must match the list in
// `src/locales/index.ts`.
const SUPPORTED_LOCALES = [
'de-DE',
'en-US',
'ja-JP',
'pt-BR',
'ru-RU',
'tr-TR',
'zh-CN',
];
const format = formatter({
lineNumbers: false,
});
const config: LinguiConfig = {
compileNamespace: 'es',
locales: SUPPORTED_LOCALES,
sourceLocale: 'en-US',
format: {
catalogExtension: format.catalogExtension,
parse: format.parse.bind(format),
serialize: async (catalog, context) => {
const serialized = await format.serialize.bind(format)(catalog, context);
// Crowdin adds a newline at the end of the file, so we need to add it
// here as well.
return `${serialized}\n`;
},
},
catalogs: [
{
path: '<rootDir>/src/locales/{locale}/messages',
include: ['src'],
},
],
};
export default config;