chore: Localization of several charts and elements (#22150)

Co-authored-by: ashumeiko <ashumeiko@ashumeiko.com>
This commit is contained in:
Artem Shumeiko
2023-01-11 19:42:54 +03:00
committed by GitHub
parent 44c9cf4de5
commit f3696ceef3
98 changed files with 748 additions and 663 deletions

View File

@@ -17,6 +17,8 @@
import logging
from typing import Any, Dict
from flask_babel import lazy_gettext as _
from superset.charts.commands.exceptions import (
ChartDataCacheLoadError,
ChartDataQueryFailedError,
@@ -49,7 +51,9 @@ class ChartDataCommand(BaseCommand):
# TODO: QueryContext should support SIP-40 style errors
for query in payload["queries"]:
if query.get("error"):
raise ChartDataQueryFailedError(f"Error: {query['error']}")
raise ChartDataQueryFailedError(
_("Error: %(error)s", error=query["error"])
)
return_value = {
"query_context": self._query_context,