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
refactor: accurate translation caching #18595
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ankush
force-pushed
the
refactor/translation_caching
branch
from
October 27, 2022 09:40
295a62b
to
bc65753
Compare
ankush
commented
Oct 27, 2022
|
||
# Backward compatibility | ||
get_full_dict = get_all_translations | ||
load_lang = get_translations_from_apps |
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.
These were horrible names for what they were doing. No other choice 🤞
ankush
force-pushed
the
refactor/translation_caching
branch
from
October 27, 2022 09:43
bc65753
to
83f8e3b
Compare
- use generator - use sane name for cache key - avoid manual handling of frappe.local state just use cache() interface
ankush
force-pushed
the
refactor/translation_caching
branch
from
October 27, 2022 10:29
83f8e3b
to
b13cb7a
Compare
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## develop #18595 +/- ##
===========================================
- Coverage 63.16% 63.06% -0.10%
===========================================
Files 747 747
Lines 67248 67557 +309
Branches 5995 5995
===========================================
+ Hits 42477 42605 +128
- Misses 21312 21493 +181
Partials 3459 3459
Flags with carried forward coverage won't be shown. Click here to find out more. |
mergify bot
pushed a commit
that referenced
this pull request
Oct 27, 2022
* refactor: rename poorly named functions * refactor: getting translation from apps - use generator - use sane name for cache key - avoid manual handling of frappe.local state just use cache() interface (cherry picked from commit 3ddac5f) # Conflicts: # frappe/tests/utils.py
ankush
added a commit
that referenced
this pull request
Oct 27, 2022
* refactor: accurate translation caching (#18595) * refactor: rename poorly named functions * refactor: getting translation from apps - use generator - use sane name for cache key - avoid manual handling of frappe.local state just use cache() interface (cherry picked from commit 3ddac5f) # Conflicts: # frappe/tests/utils.py * chore: conflicts Co-authored-by: Ankush Menat <ankush@frappe.io> Co-authored-by: Ankush Menat <ankushmenat@gmail.com>
ankush
added a commit
that referenced
this pull request
Oct 28, 2022
* refactor: rename poorly named functions * refactor: getting translation from apps - use generator - use sane name for cache key - avoid manual handling of frappe.local state just use cache() interface (cherry picked from commit 3ddac5f) # Conflicts: # frappe/__init__.py # frappe/core/doctype/translation/test_translation.py # frappe/tests/utils.py # frappe/translate.py
ankush
added a commit
that referenced
this pull request
Oct 28, 2022
* refactor: accurate translation caching (#18595) * refactor: rename poorly named functions * refactor: getting translation from apps - use generator - use sane name for cache key - avoid manual handling of frappe.local state just use cache() interface (cherry picked from commit 3ddac5f) # Conflicts: # frappe/__init__.py # frappe/core/doctype/translation/test_translation.py # frappe/tests/utils.py # frappe/translate.py * chore: conflicts * fix: dont translate error log title * fix: import frappe.build Co-authored-by: Ankush Menat <ankush@frappe.io> Co-authored-by: Ankush Menat <ankushmenat@gmail.com>
ankush
added a commit
that referenced
this pull request
Nov 3, 2022
ankush
added a commit
that referenced
this pull request
Nov 3, 2022
ankush
added a commit
that referenced
this pull request
Nov 3, 2022
stephenBDT
pushed a commit
to alias/frappe
that referenced
this pull request
Nov 7, 2022
…e#18599) * refactor: accurate translation caching (frappe#18595) * refactor: rename poorly named functions * refactor: getting translation from apps - use generator - use sane name for cache key - avoid manual handling of frappe.local state just use cache() interface (cherry picked from commit 3ddac5f) # Conflicts: # frappe/tests/utils.py * chore: conflicts Co-authored-by: Ankush Menat <ankush@frappe.io> Co-authored-by: Ankush Menat <ankushmenat@gmail.com>
frappe-pr-bot
pushed a commit
that referenced
this pull request
Nov 8, 2022
## [13.43.2](v13.43.1...v13.43.2) (2022-11-08) ### Bug Fixes * don't translate default argument ([#18760](#18760)) ([8038ed7](8038ed7)) * module 'frappe' has no attribute 'build' ([#18761](#18761)) ([a867d56](a867d56)) * not able to click checkbox in file grid view ([ad85843](ad85843)) * send all messages on boot instead of scanning ([#18764](#18764)) ([640724d](640724d)) * show 0 for empty currency, float, & duration fields in list view ([2290fb8](2290fb8)) * translations (backport [#18765](#18765)) ([#18781](#18781)) ([ca631ba](ca631ba)) ### Performance Improvements * ensure cache works for `non_standard_user_types` when empty ([#18744](#18744)) ([708ee35](708ee35)) ### Reverts * Revert "refactor: accurate translation caching (backport #18595) (#18598)" (#18741) ([e4d12f0](e4d12f0)), closes [#18595](#18595) [#18598](#18598) [#18741](#18741)
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Translation asset caching in redis is kinda hacky with following bad patterns:
generator
frappe.local
even though frappe.cache() does it alreadyChanges:
_