-
Notifications
You must be signed in to change notification settings - Fork 3
/
inlang.config.js
30 lines (27 loc) · 931 Bytes
/
inlang.config.js
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
/**
* @type {import("@inlang/core/config").DefineConfig}
*/
export async function defineConfig(env) {
// importing plugin from local file for testing purposes
const plugin = await env.$import("../dist/index.js");
const pluginConfig = {
// pathPattern: "./example/locale/{language}/LC_MESSAGES/django.po",
pathPattern: "./example/{language}.po",
// Your referenceResourcePath could be
// null or "./example/locale/en/LC_MESSAGES/django.pot",
// dependent if you use pot file as you referenceLanguage
referenceResourcePath: "./example/en.pot",
};
return {
referenceLanguage: "en",
languages: await plugin.getLanguages({
referenceLanguage: "en",
...env,
pluginConfig,
}),
readResources: (args) =>
plugin.readResources({ ...args, ...env, pluginConfig }),
writeResources: (args) =>
plugin.writeResources({ ...args, ...env, pluginConfig }),
};
}