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

feat: get_ctx_translation #76

Merged
merged 3 commits into from
Oct 24, 2021

Conversation

fahimalizain
Copy link
Member

  • Docfield Translation based on contexts moved here from renovation_core_graphql
  • translate_values method usually used in api-responses updated to make use of get_doc_field_translation
from renovation_core.utils.translate import *
d = frappe.get_single("Store Info")

print(translate_value(d, "ar").store_title)
# MyStore-Ar (resolved from ctx => *:Store Info:Store Info:store_title)

print(translate_value(d, "ar").about_us)
# MyStore-AboutUS-Ar (resolved from ctx => *:Store Info: Store Info:about_us)

Should we backport this to version-12 / master ?

renovation_core/utils/translate.py Outdated Show resolved Hide resolved
renovation_core/utils/translate.py Outdated Show resolved Hide resolved
@e-lobo
Copy link
Member

e-lobo commented Oct 16, 2021

  • Docfield Translation based on contexts moved here from renovation_core_graphql
  • translate_values method usually used in api-responses updated to make use of get_doc_field_translation
from renovation_core.utils.translate import *
d = frappe.get_single("Store Info")

print(translate_value(d, "ar").store_title)
# MyStore-Ar (resolved from ctx => *:Store Info:Store Info:store_title)

print(translate_value(d, "ar").about_us)
# MyStore-AboutUS-Ar (resolved from ctx => *:Store Info: Store Info:about_us)

Should we backport this to version-12 / master ?

yes.. actually pr should be made to master and merged to version-13 but @assemmarwan do confirm

@assemmarwan
Copy link
Member

assemmarwan commented Oct 16, 2021

  • Docfield Translation based on contexts moved here from renovation_core_graphql
  • translate_values method usually used in api-responses updated to make use of get_doc_field_translation
from renovation_core.utils.translate import *
d = frappe.get_single("Store Info")

print(translate_value(d, "ar").store_title)
# MyStore-Ar (resolved from ctx => *:Store Info:Store Info:store_title)

print(translate_value(d, "ar").about_us)
# MyStore-AboutUS-Ar (resolved from ctx => *:Store Info: Store Info:about_us)

Should we backport this to version-12 / master ?

yes.. actually pr should be made to master and merged to version-13 but @assemmarwan do confirm

Yep. First to master then to version-13

@fahimalizain fahimalizain changed the title feat: get_doc_field_translation feat: get_ctx_translation Oct 24, 2021
@fahimalizain fahimalizain changed the base branch from version-13 to master October 24, 2021 04:17
@fahimalizain
Copy link
Member Author

@assemmarwan @e-lobo changed base branch to master

@fahimalizain fahimalizain requested a review from e-lobo October 24, 2021 04:20
@e-lobo e-lobo requested a review from assemmarwan October 24, 2021 11:11
@assemmarwan assemmarwan merged commit 0fc52fa into leam-tech:master Oct 24, 2021
@fahimalizain fahimalizain deleted the tr-df-revisited-1 branch February 10, 2022 10:10
@fahimalizain fahimalizain restored the tr-df-revisited-1 branch February 10, 2022 10:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants