Skip to content

Commit

Permalink
feat: support TextI18n && PlainTextI18n
Browse files Browse the repository at this point in the history
  • Loading branch information
chyroc committed May 14, 2024
1 parent 06cbcfe commit cdcbef1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
6 changes: 6 additions & 0 deletions card/v2/component_content_plain_text.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ func PlainText(text string) *ComponentPlainText {
}
}

func PlainTextI18n(i18n map[Language]string) *ComponentPlainText {
return &ComponentPlainText{
Text: TextI18n(i18n),
}
}

// ComponentPlainText 普通文本
//
// docs: https://open.larkoffice.com/document/uAjLw4CM/ukzMukzMukzM/feishu-cards/card-components/content-components/plain-text
Expand Down
7 changes: 7 additions & 0 deletions card/v2/object_text.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ func Text(text string) *ObjectText {
}
}

func TextI18n(i18n map[Language]string) *ObjectText {
return &ObjectText{
Tag: "plain_text",
I18n: i18n,
}
}

func Md(md string) *ObjectText {
return &ObjectText{
Tag: "lark_md",
Expand Down

0 comments on commit cdcbef1

Please sign in to comment.