Skip to content

Conversation

@liruohrh
Copy link

@liruohrh liruohrh commented Dec 6, 2025

  • Avoid version control conflicts when modifying built-in i18n files during secondary development
  • Support custom i18n directories (e.g., data directory or other paths) for developers

@shuashuai shuashuai self-requested a review December 8, 2025 02:28
@shuashuai
Copy link
Member

Avoid version control conflicts when modifying built-in i18n files during secondary development

What do we mean by version control conflicts? Are you referring to avoiding code conflicts caused by merging new versions from Answer each time by customizing the i18n file path to implement your own language file directory?

@liruohrh
Copy link
Author

liruohrh commented Dec 8, 2025

Yes, this makes it easier for developers to manage i18n—e.g., by merging custom and built-in Answer translations into /data/answer/i18n without modifying Answer's built-in files, keeping things clean and organized.

@shuashuai
Copy link
Member

Yes, this makes it easier for developers to manage i18n—e.g., by merging custom and built-in Answer translations into /data/answer/i18n without modifying Answer's built-in files, keeping things clean and organized.

According to the description, it appears that when using this variable, users are required to handle the merging of file content themselves. However, the submitted code does not involve this part of the operation, which may cause confusion for users regarding this variable.

If this environment variable is only used in development mode, is it sufficient to define it only in your .env*.local file? Because this file will not be submitted to the code repository.

The environment variables we currently use are all explained in the confiugs/config.yaml file. config file docs,

@liruohrh
Copy link
Author

liruohrh commented Dec 9, 2025

yes, it shoule be in .env*.local. it like dir /data.
like REACT_APP_API_URL = http://10.0.20.84:8080/ in .env.development, i need .env.local to set tohttp://127.0.0.1/.

"merging custom and built-in" is my way to handle custom i18n(by write /cmd/i18nmerge in my local repo).
I think perhaps others might need it too, so I created this pr,
for if has the env, we do not need to modify ui/config-overrides.js.
actually it must alaways is /data/i18n (same with backend i18n in data dir).

such as, i run /cmd/i18nmerge to merge /data/i18n and /answer/myi18n to /data/i18n, backend and frontend both use /data/i18n. (/answer/ is the source code repo).

create-answer-plugin. also use ANSWER_I18N_PATH(which will invoke answer i18n after install plugin to merge plugin i18n).

for create-answer-plugin, i decide to change ANSWER_I18N_ROOT to ANSWER_I18N_PATH.

and i add some code comments for ANSWER_I18N_PATH.

so, how do you feel now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants