Skip to content

Commit 5b12e24

Browse files
committed
Merge branch 'main' into develop
2 parents f4c0e83 + 4ab79f2 commit 5b12e24

27 files changed

+713
-252
lines changed

.prettierrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

README-EN.md

Lines changed: 261 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,261 @@
1+
# Immersive Translate AI Expert Plugin Submission Guide
2+
3+
Customized AI translation strategies can greatly improve translation quality. Immersive Translate refers to these strategies as "AI Experts" — essentially, a series of carefully designed prompts.
4+
5+
## How to Use "AI Experts" in Immersive Translate?
6+
7+
Open the Immersive Translate settings page, find the "AI Experts" Tab, and install the required "AI Expert." Then, you can easily select different AI Experts in the Immersive Translate plugin panel to meet diverse translation needs. The default translation strategy is "General," suitable for most scenarios.
8+
9+
## How to Contribute "AI Experts"?
10+
11+
We welcome more contributions to [Immersive Translate](https://immersivetranslate.com/) [AI Translation Experts](https://ai.immersivetranslate.com/).
12+
13+
If you do not yet have the ability to write Prompts files, you can initiate an Issue discussion [here](https://github.com/immersive-translate/prompts/issues), describing the AI Expert you want.
14+
15+
If you can write Prompts, you can directly initiate a Pull Request to submit or improve an AI Expert.
16+
17+
To ensure your contribution is smoothly adopted, please refer to our existing AI Expert files under the `plugins/` folder.
18+
19+
## Local Debugging
20+
21+
You can find the 【[Developer Settings](https://dash.immersivetranslate.com/#developer)】 on the Immersive Translate settings page, find 【Custom AI Assistant】, and edit in yaml format there. Please refer to the following for the specific format.
22+
23+
## About Context Variables env
24+
25+
- imt_domain: Web domain
26+
- imt_title: Web title
27+
28+
## AI Expert Configuration File Standards
29+
30+
> You should describe the plugin's basic information in English and include at least Simplified Chinese and Traditional Chinese descriptions in the i18n configuration.
31+
32+
```yaml
33+
// Basic information of the plugin
34+
id: custom // A unique identifier to identify the current AI Expert
35+
version: 1.0.0 // Version number
36+
name: Financial Expert // Name. This is also unique
37+
description: The translation of financial articles becomes more professional. // Description
38+
avatar: https://s.immersivetranslate.com/assets/uploads/fina-AXX5s8.png // Avatar, a usable image URL address
39+
details: This expert is designed for professional financial field translation. You can use it to accurately translate financial articles into the target language specified. // Detailed information about the AI Expert, supports markdown and html format
40+
i18n: // Multilingual description of the plugin information (including name, description, details), at least supports zh-CN, zh-TW
41+
zh-CN:
42+
name: 金融专家
43+
description: 特别为金融领域优化,适合用来翻译财经,金融类文章。
44+
details: 该专家专为专业金融领域翻译而设计,你可以使用它将金融类文章准确翻译为指定的目标语言。
45+
zh-TW:
46+
name: 金融專家
47+
description: 特別為金融領域優化,適合用來翻譯財經,金融類文章。
48+
details: 該專家專為專業金融領域翻譯而設計,你可以使用它將金融類文章準確翻譯為指定的目標語言。
49+
author: Official // Author name
50+
homepage: https://immersivetranslate.com/ // AI Expert homepage, not required
51+
52+
// Prompt information
53+
env: Placeholders used in prompts, such as source text field, translation text field, source subtitle field, and translation subtitle field, etc. The values of these variables will be replaced by specific text in the prompts
54+
systemPrompt: System-level prompt, describes the role and function of the AI Expert
55+
prompt: Prompt for single sentence translation
56+
multiplePrompt: Prompt for multiple segment translation, to preserve more context, Immersive Translate by default includes 3 segments of text per request, the request will be provided in this format.
57+
subtitlePrompt: Prompt for subtitle translation (subtitles often have multiple sentence segmentation issues, so we set a separate prompt for subtitles)
58+
```
59+
60+
For reference, here is a prompt about two-step paraphrasing (first literal translation, then paraphrasing):
61+
62+
```yaml
63+
id: custom
64+
version: 1.0.1
65+
extensionVersion: 1.4.10
66+
name: Paraphrase Expert
67+
description: Designed for nuanced, interpretive translations, this expert ensures that translations go beyond the literal to capture the essence and tone of the original text.
68+
avatar: https://s.immersivetranslate.com/assets/uploads/fluent-7JVve6.png
69+
author: Official
70+
homepage: https://immersivetranslate.com/
71+
details: |-
72+
This expert specializes in interpretive translations, aiming to capture not just the words but the meaning and tone behind them. It's perfect for literature, idiomatic expressions, and any text where context matters as much as content. Use this expert to convey the essence of the original text in the target language, ensuring that cultural nuances and implied meanings are not lost in translation.
73+
i18n:
74+
zh-CN:
75+
name: 意译大师
76+
description: 专门设计用于富有细腻差异和意译的翻译,经过先直译,再意译的步骤,确保翻译超越字面,捕捉原文的精髓和语调。
77+
details: |-
78+
该专家专注于意译翻译,旨在捕捉不仅仅是文字,而是背后的意义和语调。它非常适合文学、成语表达以及任何上下文和内容同等重要的文本。使用此专家可以确保在目标语言中传达原文的精髓,确保文化细微差别和隐含意义不会在翻译中丢失。
79+
zh-TW:
80+
name: 意譯專家
81+
description: 專門設計用於豐富細膩差異和意譯的翻譯,經過先直譯,再意譯的步驟,確保翻譯超越字面,捕捉原文的精髓和語調。
82+
details: |-
83+
該專家專注於意譯翻譯,旨在捕捉不僅僅是文字,而是背後的意義和語調。它非常適合文學、成語表達以及任何上下文和內容同等重要的文本。使用此專家可以確保在目標語言中傳達原文的精髓,確保文化細膩差別和隱含意義不會在翻譯中丟失。
84+
env:
85+
imt_source_field: source
86+
imt_trans_field: step2
87+
imt_sub_source_field: source
88+
imt_sub_trans_field: step2
89+
imt_yaml_item: |-
90+
- id: {{id}}
91+
{{imt_source_field}}: {{text}}
92+
imt_subtitle_yaml_item: |-
93+
- id: {{id}}
94+
{{imt_sub_source_field}}: {{text}}
95+
normal_result_yaml_example: |-
96+
Example request:
97+
- id: 1
98+
{{imt_source_field}}: Source
99+
Example response:
100+
- id: 1
101+
step1: Literal translation result
102+
step2: Paraphrase result
103+
subtitle_result_yaml_example: |-
104+
Example request:
105+
- id: 1
106+
{{imt_sub_source_field}}: ...
107+
- id: 2
108+
{{imt_sub_source_field}}: ...
109+
Example response:
110+
- id: 1
111+
step1: Literal translation result
112+
step2: Paraphrase result
113+
{{imt_sub_source_field}}: ...
114+
- id: 2
115+
step1: Literal translation result
116+
step2: Paraphrase result
117+
{{imt_sub_source_field}}: ...
118+
normal_result_yaml_example_traditional: |-
119+
Example request:
120+
- id: 1
121+
{{imt_source_field}}: Source
122+
Example result:
123+
- id: 1
124+
step1: Literal translation result
125+
step2: Paraphrase result
126+
subtitle_result_yaml_example_traditional: |-
127+
Example request:
128+
- id: 1
129+
{{imt_sub_source_field}}: ...
130+
- id: 2
131+
{{imt_sub_source_field}}: ...
132+
Example response:
133+
- id: 1
134+
step1: Literal translation result
135+
step2: Paraphrase result
136+
{{imt_sub_source_field}}: ...
137+
- id: 2
138+
step1: Literal translation result
139+
step2: Paraphrase result
140+
{{imt_sub_source_field}}: ...
141+
systemPrompt: You are a professional translator proficient in {{to}}, responsible for translating it into Chinese without any explanation.
142+
prompt: |-
143+
Please complete the translation task according to the following requirements:
144+
1. Directly translate the {{imt_source_field}} field in the YAML object below into {{to}}, retaining specific terms or media names (if any). Place the result of this translation into the step1 field of the YAML array.
145+
2: Based on the result of the first translation, perform a paraphrase, striving for faithfulness, expressiveness, and elegance, but still retaining specific terms or media names (if any), making the text more understandable and in line with Chinese expression habits under the premise of adhering to the original meaning. Place the result of the second translation into the step2 field of the YAML array.
146+
147+
Example format:
148+
{{normal_result_yaml_example}}
149+
150+
Start translating:
151+
152+
{{yaml}}
153+
154+
multiplePrompt: |-
155+
Please complete the translation task according to the following requirements:
156+
1. Directly translate the {{imt_source_field}} field in the YAML object below into {{to}}, retaining specific terms or media names (if any). Place the result of this translation into the step1 field of the YAML array.
157+
2: Based on the result of the first translation, perform a paraphrase, striving for faithfulness, expressiveness, and elegance, but still retaining specific terms or media names (if any), making the text more understandable and in line with Chinese expression habits under the premise of adhering to the original meaning. Place the result of the second translation into the step2 field of the YAML array.
158+
159+
Example format:
160+
{{normal_result_yaml_example}}
161+
162+
Start translating:
163+
164+
{{yaml}}
165+
166+
subtitlePrompt: |-
167+
Translate all the text in the {{imt_sub_source_field}} fields of the YAML format video subtitles below into {{to}}, and write the translation result in the {{imt_sub_trans_field}} field. You must complete every {{imt_sub_trans_field}} field, retaining every {{imt_sub_source_field}} field. The requirements are as follows:
168+
169+
1. First, directly translate the content of the {{imt_sub_source_field}} field, placing the result of this translation into the step1 field of the YAML array.
170+
2. Based on the result of the first translation, perform a paraphrase, striving for faithfulness, expressiveness, and elegance, but still retaining specific terms or media names (if any), making the text more understandable and in line with Chinese expression habits under the premise of adhering to the original meaning. Place the result of the second translation into the step2 field of the YAML array.
171+
172+
{{subtitle_result_yaml_example}}
173+
174+
Start translating:
175+
176+
{{yaml}}
177+
178+
langOverrides:
179+
- id: auto2zh-TW
180+
systemPrompt: You are a professional translator proficient in Traditional Chinese, responsible for translating it into Chinese without any explanation.
181+
prompt: |-
182+
Please complete the translation task according to the following requirements:
183+
1. Directly translate the {{imt_source_field}} field in the YAML object below into {{to}}, retaining specific terms or media names (if any). Place the result of this translation into the step1 field of the YAML array.
184+
2: Based on the result of the first translation, perform a paraphrase, striving for faithfulness, expressiveness, and elegance, but still retaining specific terms or media names (if any), making the text more understandable and in line with Chinese expression habits under the premise of adhering to the original meaning. Place the result of the second translation into the step2 field of the YAML array.
185+
186+
Example format:
187+
{{normal_result_yaml_example_traditional}}
188+
189+
Start translating:
190+
191+
{{yaml}}
192+
193+
multiplePrompt: |-
194+
Please complete the translation task according to the following requirements:
195+
1. Directly translate the {{imt_source_field}} field in the YAML object below into {{to}}, retaining specific terms or media names (if any). Place the result of this translation into the step1 field of the YAML array.
196+
2: Based on the result of the first translation, perform a paraphrase, striving for faithfulness, expressiveness, and elegance, but still retaining specific terms or media names (if any), making the text more understandable and in line with Chinese expression habits under the premise of adhering to the original meaning. Place the result of the second translation into the step2 field of the YAML array.
197+
198+
Example format:
199+
{{normal_result_yaml_example_traditional}}
200+
201+
Start translating:
202+
203+
{{yaml}}
204+
205+
subtitlePrompt: |-
206+
Translate all the text in the {{imt_sub_source_field}} fields of the YAML format video subtitles below into {{to}}, and write the translation result in the {{imt_sub_trans_field}} field. You must complete every {{imt_sub_trans_field}} field, retaining every {{imt_sub_source_field}} field. The requirements are as follows:
207+
208+
1. First, directly translate the content of the {{imt_sub_source_field}} field, placing the result of this translation into the step1 field of the YAML array.
209+
2. Based on the result of the first translation, perform a paraphrase, striving for faithfulness, expressiveness, and elegance, but still retaining specific terms or media names (if any), making the text more understandable and in line with Chinese expression habits under the premise of adhering to the original meaning. Place the result of the second translation into the step2 field of the YAML array.
210+
211+
Example format:
212+
{{subtitle_result_yaml_example_traditional}}
213+
214+
Start translating:
215+
216+
{{yaml}}
217+
```
218+
219+
## How to Submit
220+
221+
Please follow the steps below to submit your AI Expert plugin:
222+
223+
1. **Fork the Repository**
224+
225+
Before contributing, you need to fork our repository to your own GitHub account.
226+
227+
2. **Create a New Branch**
228+
229+
In your fork, create a new branch to place your contribution. It is recommended to name the branch after the plugin name.
230+
231+
3. **Add Your Plugin Content**
232+
233+
In the new branch, add your AI Expert plugin content according to the "Submission Content Requirements" mentioned above and place it in a **_yml_** file. Please ensure your content is novel and does not duplicate the existing content in the repository.
234+
235+
4. **Write a Commit Message**
236+
237+
When submitting your changes, provide a clear and accurate commit message explaining the changes and new features you have made.
238+
239+
5. **Initiate a Pull Request (PR)**
240+
241+
After ensuring all changes have been submitted, initiate a PR to the original repository. Please describe the functionality and purpose of your plugin in detail in the PR description, and mention any special dependencies or considerations.
242+
243+
6. **Wait for Feedback**
244+
245+
The repository administrators will review your PR. If further information or changes are needed, the administrators will comment in the PR.
246+
247+
7. **Completion of Merging**
248+
249+
Once your PR is accepted and merged, your AI Expert plugin will become part of the repository!
250+
251+
## Considerations
252+
253+
- Ensure your content complies with all applicable copyright laws.
254+
255+
- The content submitted must be original, or you must have the right to contribute it to our repository.
256+
257+
- Contributions containing any malicious code, inappropriate content, or infringing on others' rights are not accepted.
258+
259+
## Conclusion
260+
261+
We look forward to your contributions and thank you for contributing to the development of the AI Expert ecosystem!

0 commit comments

Comments
 (0)