Fix localization return issue.
This commit is contained in:
parent
36e569ea28
commit
2add4a6ae8
|
|
@ -17,6 +17,7 @@ public class ElementButton
|
|||
public string Title { get; set; } = string.Empty;
|
||||
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
[Translate]
|
||||
public string Payload { get; set; }
|
||||
|
||||
[JsonPropertyName("is_primary")]
|
||||
|
|
@ -30,5 +31,6 @@ public class ElementButton
|
|||
[JsonPropertyName("post_action_disclaimer")]
|
||||
[JsonProperty("post_action_disclaimer")]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
[Translate]
|
||||
public string? PostActionDisclaimer { get; set; }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ public partial class ConversationService
|
|||
response.RichContent is RichContent<IRichMessage> template &&
|
||||
string.IsNullOrEmpty(template.Message.Text))
|
||||
{
|
||||
template.Message.Text = response.Content;
|
||||
template.Message.Text = response.SecondaryContent ?? response.Content;
|
||||
}
|
||||
|
||||
// Only read content from RichContent for UI rendering. When richContent is null, create a basic text message for richContent.
|
||||
|
|
@ -138,7 +138,7 @@ public partial class ConversationService
|
|||
response.RichContent = response.RichContent ?? new RichContent<IRichMessage>
|
||||
{
|
||||
Recipient = new Recipient { Id = state.GetConversationId() },
|
||||
Message = new TextMessage(response.Content)
|
||||
Message = new TextMessage(response.SecondaryContent ?? response.Content)
|
||||
};
|
||||
|
||||
// Patch return function name
|
||||
|
|
|
|||
|
|
@ -162,7 +162,7 @@ public partial class RoutingService : IRoutingService
|
|||
}
|
||||
else
|
||||
{
|
||||
response.Content = await translator.Translate(_router,
|
||||
response.SecondaryContent = await translator.Translate(_router,
|
||||
message.MessageId,
|
||||
response.Content,
|
||||
language: inst.Language);
|
||||
|
|
|
|||
Loading…
Reference in a new issue