Skip to content

Commit df9aeb5

Browse files
committed
feat(i18n): add env ANSWER_I18N_ROOT for secondary development
1 parent 740ac61 commit df9aeb5

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

ui/config-overrides.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,18 @@ const {
2626
const webpack = require('webpack');
2727

2828
const path = require("path");
29-
const i18nPath = path.resolve(__dirname, "../i18n");
29+
30+
let i18nRoot = path.resolve(__dirname, '../i18n');
31+
/**
32+
* ANSWER_I18N_PATH: same with create-answer-plugin, which will merge plugin i18n and /i18n of repo.
33+
* you can change i18nRoot to your i18n directory.(Without modifying /i18n in this repo).
34+
* it is useful for secondary development.
35+
* such as, merge /myi18n in my repo and /i18n in this repo to the path.(merge by myself)
36+
*/
37+
if (process.env.ANSWER_I18N_PATH) {
38+
i18nRoot = process.env.ANSWER_I18N_PATH;
39+
}
40+
const i18nPath = i18nRoot;
3041

3142
module.exports = {
3243
webpack: function(config, env) {

0 commit comments

Comments
 (0)