Merge pull request #21639 from shariquerik/translated-autocomplete-options

This commit is contained in:
Shariq Ansari 2023-07-12 10:49:10 +05:30 committed by GitHub
commit 4bb85c70fd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View file

@ -53,6 +53,8 @@ def get_csv_bytes(data: list[list], csv_params: dict) -> bytes:
def provide_binary_file(filename: str, extension: str, content: bytes) -> None:
"""Provide a binary file to the client."""
from frappe import _
frappe.response["type"] = "binary"
frappe.response["filecontent"] = content
frappe.response["filename"] = f"{filename}.{extension}"
frappe.response["filename"] = f"{_(filename)}.{extension}"

View file

@ -177,7 +177,7 @@ frappe.ui.form.ControlAutocomplete = class ControlAutoComplete extends frappe.ui
options = options.map((o) => {
if (typeof o !== "string") {
o.label = cstr(o.label);
o.label = __(cstr(o.label));
o.value = cstr(o.value);
}
return o;