Skip to content

Commit

Permalink
Optimize i18n key generation logic
Browse files Browse the repository at this point in the history
  • Loading branch information
trheyi committed Jul 14, 2024
1 parent 98f2f2a commit 1ed1973
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions sui/core/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func (page *Page) Build(ctx *BuildContext, option *BuildOption) (*goquery.Docume
}

// Add the translation marks
sequence := 0
sequence := 1
err = page.TranslateMarks(ctx, doc, &sequence)
if err != nil {
return nil, warnings, err
Expand Down Expand Up @@ -186,7 +186,7 @@ func (page *Page) BuildAsComponent(sel *goquery.Selection, ctx *BuildContext, op
data.ReplaceSelectionUse(slotRe, first)

// Add the translation marks
sequence := 0
sequence := 1
err = page.TranslateMarks(ctx, doc, &sequence)
if err != nil {
return "", err
Expand Down Expand Up @@ -590,7 +590,6 @@ func (page *Page) TranslateMarks(ctx *BuildContext, doc *goquery.Document, seque
func (page *Page) translateNode(node *html.Node, sequence *int) ([]Translation, error) {

translations := []Translation{}
*sequence = *sequence + 1

switch node.Type {
case html.DocumentNode:
Expand Down

0 comments on commit 1ed1973

Please sign in to comment.