@@ -54,3 +54,8 @@ Did you have an issue, like a merge conflict, or don't know how to open a pull r
## Community channels
Stuck somewhere? Have any questions? Join the [Discord Community Server](https://discord.gg/AhzKf7dNgk). We are here to help!
### i18n (Internationalization) Support
We are looking for contributors to help with translations in other languages. If you are interested in helping, please join the [Discord Community Server](https://discord.gg/AhzKf7dNgk) and let us know.
Also check out the [Frontend i18n README]((web/i18n/README_EN.md)) for more information.
`api/libs/helper.py:117` Add corresponding language support. Such as:
```python
defsupported_language(lang):
iflangin['en-US','zh-Hans','de','de-AT']:
returnlang
```
## Adding multiple language files
Add multilingual files for different modules under web/i18n/lang. The file name is Module name.{LANG}.ts. Please refer [LANG](https://www.venea.net/web/culture_code) for details.
## Introducing a newly added multilingual file
Introduce the newly added multilingual file in the resources object in web/i18n/i18next-config.ts. For example:
```javascript
constresources={
'en':{...},
'zh-Hans':{...},
_// Introduce the newly added language_
'new LANG':{
translation:{
common:commonNewLan,
layout:layoutNewLan,
...
}
}
}
```
## Changes in the translation process
### Multi-language processing of date formatting
Currently, two files are involved in date formatting in multiple languages:
There will be variables in the translation, and the value of the variables will be replaced at runtime. Variables in translation will be wrapped in {{ and }}.
When translating content with variables:
1. Do not change the variable name. That is: the variable name does not need to be translated.
2. Ensure that the statement remains smooth after the variable is filled.
Find all translations with variables: search for {{ under ./web/i18n/lang.
### Translation content is too long to destroy UI
If a certain translation content is much longer than other languages, check if it will destroy the UI.
## Help documentation
The current logic for adjusting the help documentation is: Chinese jumps to Chinese, other languages jump to English. If the help documentation is also multilingual, changes need to be made in this area.
## Verification
It is recommended to verify the newly added language pack through local deployment of the latest code. For reference: https://docs.dify.ai/getting-started/install-self-hosted/local-source-code
Verification points:
1. Whether the initial installation has new language drop-down options, and whether the new language can be used for initialization
2. Whether there is a new language drop-down option in personal settings, and whether the new language can be selected and saved
3. Whether the text in the interface is displayed in the new language, and whether the text destroys the UI
4. Whether the content created from the template is all in the new language
5. (CLOUD version) After logging in through OAuth authorization, whether the current browser language is set directly as the interface language
'How much to penalize new tokens based on their existing frequency in the text so far. Decreases the model\'s likelihood to repeat the same line verbatim.',
maxToken:'Max token',
maxTokenTip:
'Max tokens generated is 2,048 or 4,000, depending on the model. Prompt and completion share this limit. One token is roughly 1 English character.',
'Max tokens depending on the model. Prompt and completion share this limit. One token is roughly 1 English character.',
setToCurrentModelMaxTokenTip:'Max token is updated to the maximum token of the current model 4,000.',