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

fix container name i18n #452

Merged
merged 2 commits into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ require (
github.com/pquerna/otp v1.4.0
github.com/qor/oss v0.0.0-20240729105053-88484a799a79
github.com/qor5/web/v3 v3.0.6-0.20240808073627-bd2003d12e2c
github.com/qor5/x/v3 v3.0.7-0.20240808085055-02376b65a3f9
github.com/qor5/x/v3 v3.0.7-0.20240808103450-13664afa0ba5
github.com/samber/lo v1.46.0
github.com/shurcooL/sanitized_anchor_name v1.0.0
github.com/spf13/cast v1.6.0
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,8 @@ github.com/qor5/x/v3 v3.0.7-0.20240808022508-35f1ab5b53fe h1:kZSRwsseo3Jwlk3Z/27
github.com/qor5/x/v3 v3.0.7-0.20240808022508-35f1ab5b53fe/go.mod h1:p8LBZGmJ9pozop2jMACV5tN/1gkpAskteOhlwcfFxpw=
github.com/qor5/x/v3 v3.0.7-0.20240808085055-02376b65a3f9 h1:fuCaJ519NO5SL2LryGKNcYmgbrbiPxLMkun976s95d0=
github.com/qor5/x/v3 v3.0.7-0.20240808085055-02376b65a3f9/go.mod h1:p8LBZGmJ9pozop2jMACV5tN/1gkpAskteOhlwcfFxpw=
github.com/qor5/x/v3 v3.0.7-0.20240808103450-13664afa0ba5 h1:GIIq/qk4VzVYHQMDJ++lHwa6L6y1O2yCWzXUX/p6CQw=
github.com/qor5/x/v3 v3.0.7-0.20240808103450-13664afa0ba5/go.mod h1:p8LBZGmJ9pozop2jMACV5tN/1gkpAskteOhlwcfFxpw=
github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8=
Expand Down
7 changes: 5 additions & 2 deletions pagebuilder/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,10 @@ func (b *ModelBuilder) renderContainersList(ctx *web.EventContext) (component h.
}
var listItems []h.HTMLComponent
for _, builder := range group {
containerName := i18n.T(ctx.R, presets.ModelsI18nModuleKey, builder.name)
containerName := builder.name
if b.builder.ps.GetI18n() != nil {
containerName = i18n.T(ctx.R, presets.ModelsI18nModuleKey, builder.name)
}
addContainerEvent := web.Plaid().EventFunc(AddContainerEvent).
MergeQuery(true).
Query(paramModelName, builder.name).
Expand Down Expand Up @@ -716,7 +719,7 @@ func (b *ModelBuilder) addContainerToPage(ctx *web.EventContext, pageID int, con
}
modelID = reflectutils.MustGet(model, "ID").(uint)
displayName := modelName
if b.builder.l10n != nil {
if b.builder.ps.GetI18n() != nil {
displayName = i18n.T(ctx.R, presets.ModelsI18nModuleKey, modelName)
}
container := Container{
Expand Down
Loading