Skip to content

Cannot access custom locale keys in 1.21 #28081

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

Closed
danparisd opened this issue Nov 15, 2023 · 3 comments
Closed

Cannot access custom locale keys in 1.21 #28081

danparisd opened this issue Nov 15, 2023 · 3 comments

Comments

@danparisd
Copy link

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

@wxiaoguang
Copy link
Contributor

@danparisd
Copy link
Author

Oh wow, I didn't notice the capitalization change. I got it working.

This should be listed as a breaking change in the blog post.

@danparisd
Copy link
Author

I made a PR for the blog

https://gitea.com/gitea/blog/pulls/320

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants