-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
cleanup locale function usage #27227
Conversation
@delvh I don't know if it really has any impact on speed..... |
I mean… It is a fact that this PR will speed up template processing, even if only marginally 😁 |
Why with patience? |
That is a task that can be automated if |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it doesn't affect performance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to narrow the data passed into sub-templates.
If it doesn't get backported, some fixes in the future might become non-auto-backportable. |
Backport #27227 by @denyskon Throughout the Gitea codebase, you can meet some weird constructions to make `locale.Tr` work in subtemplates. Since we now have `ctx.Locale.Tr` which solves that problem, clean up various templates which pass `locale` through `dict` or use some weird constructions like `$.root.locale` Going on, it would be great to replace every case of `$.locale.Tr` and `.locale.Tr` with `ctx.Locale.Tr`, but that needs to be done with patience. Co-authored-by: Denys Konovalov <kontakt@denyskon.de>
* giteaofficial/main: Add missing public user visibility in user details page (go-gitea#27246) Use mask-based fade-out effect for `.new-menu` (go-gitea#27181) [skip ci] Updated translations via Crowdin Fix z-index on markdown completion (go-gitea#27237) Update database-preparation and add note re: MariaDB (go-gitea#27232) cleanup locale function usage (go-gitea#27227) Fix EOL handling in web editor (go-gitea#27141) Fix PushEvent NullPointerException jenkinsci/github-plugin (go-gitea#27203) fix issues on action runners page (go-gitea#27226) Fix Fomantic UI dropdown icon bug when there is a search input in menu (go-gitea#27225) Update go-enry to 2.8.5 (go-gitea#27215) Update nodejs installation method in release container (go-gitea#27207) Quote table `release` in sql queries (go-gitea#27205) Fix push mirror, wrong timestamp format (go-gitea#27153) Allow copying issue comment link on archived repos and when not logged in (go-gitea#27193) fix: text decorator on issue sidebar menu label (go-gitea#27206) Update JS and Poetry dependencies and eslint (go-gitea#27200) Remove some dead code (go-gitea#27196) # Conflicts: # templates/repo/issue/view_content/context_menu.tmpl
Throughout the Gitea codebase, you can meet some weird constructions to make
locale.Tr
work in subtemplates.Since we now have
ctx.Locale.Tr
which solves that problem, clean up various templates which passlocale
throughdict
or use some weird constructions like$.root.locale
Going on, it would be great to replace every case of
$.locale.Tr
and.locale.Tr
withctx.Locale.Tr
, but that needs to be done with patience.