Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,8 @@ private T Assign<T>(T data, Dictionary<string, string> map) where T : class
/// <returns></returns>
private async Task<TranslationOutput> InnerTranslate(List<TranslationInput> texts, string language, string template)
{
var jsonString = JsonSerializer.Serialize(texts);
var options = new JsonSerializerOptions() { Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping };
var jsonString = JsonSerializer.Serialize(texts, options);
var translator = new Agent
{
Id = Guid.Empty.ToString(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@

=====
Translate all the above sentences into {{ language }}.
Output the translated text in JSON {"input_lang":"original text language", "output_count": {{ text_list_size }}, "output_lang":"{{ language }}", "texts":[{"id": 1, "text":""}]}.
Output the translated text in JSON {"input_lang":"original text language", "output_count": {{ text_list_size }}, "output_lang":"{{ language }}", "texts":[{"id": 1, "text":""},{"id": 2, "text":""}]}.
The "output_count" must equal the length of the "texts" array in the output.