Skip to content

Cannot access custom locale keys in 1.21 #28081

Closed
@danparisd

Description

@danparisd

Description

We use a custom en-US locale file, which has a custom section at the bottom and has a few sub items that are custom. Like this:

[wa]
footer_agreement = you agree

In 1.20 we accessed those values in our custom templates via {{.locale.Tr "wa.footer_agreement"}} for example. This worked fine in 1.20. In testing 1.21 these values are blank.

I tried changing to {{ctx.locale.Tr "wa.footer_agreement"}} but this doesn't work. I've looked at all the locale related commits in 1.21 that I could find and nothing is sticking out to me as being the cause here.

Gitea is definitely picking up our custom locale file because we have customized some of the gitea provided keys and our values are being displayed for those.

Please advise. I'm happy to troubleshoot or look at the code if someone can point me in the right direction.

Gitea Version

1.21

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

running in Docker rootless. Building a custom image with the customizations loaded in the build.

Database

MySQL/MariaDB

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions