Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

duplacate msg header #5

Merged
merged 1 commit into from
Jan 19, 2025
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
2 changes: 1 addition & 1 deletion cmd/xtemplate/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.17
require (
github.com/cockroachdb/errors v1.8.6
github.com/smartystreets/goconvey v1.6.4
github.com/youthlin/t v0.0.5
github.com/youthlin/t v0.0.8
)

require (
Expand Down
4 changes: 2 additions & 2 deletions cmd/xtemplate/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
)

// Version the version
var Version string = "v0.0.5"
var Version string = "v0.0.9"

//go:embed lang
var embedLangs embed.FS
Expand Down Expand Up @@ -52,7 +52,7 @@ func buildParam() *internal.Param {
input = flag.String("i", "", t.T("input file pattern"))
left = flag.String("left", "{{", t.T("left delim"))
right = flag.String("right", "}}", t.T("right delim"))
keywords = flag.String("k", "", t.T("keywords e.g.: gettext;T:1;N1,2;X:1c,2;XN:1c,2,3"))
keywords = flag.String("k", "", t.T("keywords e.g.: gettext;T:1;N:1,2;X:1c,2;XN:1c,2,3"))
fun = flag.String("f", "", t.T("function names of template"))
output = flag.String("o", "", t.T("output file, - is stdout"))
debug = flag.Bool("d", false, t.T("debug mode"))
Expand Down
4 changes: 3 additions & 1 deletion translator/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,9 @@ func (file *File) initHeader() {
kv := find[0]
k := strings.TrimSpace(kv[1])
v := strings.TrimSpace(kv[2])
headers[k] = v
if _, ok := headers[k]; !ok {
headers[k] = v
}
}
}
file.headers = headers
Expand Down
Loading