Skip to content

Commit

Permalink
fix missing trans-text attribute bug
Browse files Browse the repository at this point in the history
  • Loading branch information
trheyi committed Jul 20, 2024
1 parent f32a677 commit dc8cfb6
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions sui/core/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,20 @@ func (page *Page) copyChildren(from *goquery.Selection, to *goquery.Selection) e
return nil
}
children.Find("slot").Remove()

// copy trans-node and trans-text properties
transNode, hasTransNode := from.Attr("s:trans-node")
transText, hasTransText := from.Attr("s:trans-text")
if hasTransNode || hasTransText {
parent := to.Find("children").Parent()
if hasTransNode {
parent.SetAttr("s:trans-node", transNode)
}
if hasTransText {
parent.SetAttr("s:trans-text", transText)
}
}

to.Find("children").ReplaceWithSelection(children)
return nil
}
Expand Down

0 comments on commit dc8cfb6

Please sign in to comment.