-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathlingui.config.ts
More file actions
72 lines (69 loc) · 2.17 KB
/
lingui.config.ts
File metadata and controls
72 lines (69 loc) · 2.17 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
import type { LinguiConfig } from "@lingui/conf";
const config: LinguiConfig = {
locales: ["en", "ja", "th", "zh-TW", "zh-CN", "ko", "vi"],
compileNamespace: "ts",
fallbackLocales: {
default: "en",
},
catalogs: [
// {
// "path": "<rootDir>/src/locales/{locale}/molecules/{name}",
// "include": ["<rootDir>/src/components/molecules/{name}"],
// "exclude": ["**/*.tsx", "**/*.res", "**/*.ts"],
// },
// {
// "path": "<rootDir>/src/locales/{locale}/organisms/{name}",
// "include": ["<rootDir>/src/components/organisms/{name}"],
// "exclude": ["**/*.tsx", "**/*.res", "**/*.ts"],
// },
// {
// "path": "<rootDir>/src/locales/{locale}/pages/{name}",
// "include": ["<rootDir>/src/components/pages/{name}"],
// "exclude": ["**/*.tsx", "**/*.res", "**/*.ts"],
// },
// {
// // path: "src/locales/{locale}/messages",
// // include: ["src"],
// "path": "src/locales/pages/{locale}/{name}",
// "include": ["src/components/pages/{name}"]
// },
// {
// path: "src/locales/{locale}/messages",
// include: ["src"],
//
// }
],
// "catalogsMergePath": "src/locales/{locale}",
experimental: {
extractor: {
/// ...
// glob pattern of entrypoints
// this will find all nextjs pages
entries: [
"<rootDir>/src/components/routes/**/*.mjs",
"<rootDir>/src/components/pages/**/*.mjs",
"<rootDir>/src/components/organisms/**/*.mjs",
],
// output pattern, this instruct extractor where to store catalogs
// src/pages/faq.tsx -> src/pages/locales/faq/en.po
output: "<rootDir>/src/locales/{entryDir}/{entryName}/{locale}",
resolveEsbuildOptions: (options: import("esbuild").BuildOptions) => {
options.resolveExtensions = [
".ts",
".js",
".jsx",
".tsx",
".mjs",
".webp",
];
// Add loader for .webp files as dataurl (or file, depending on your needs)
options.loader = {
...(options.loader || {}),
".webp": "dataurl",
};
return options;
},
},
},
};
export default config;