fix(ui): localize hardcoded strings
This commit is contained in:
1 parent
8e04889745
commit
ed1db7db6b
17 files changed
+383
-153
No files matched your search
@@ -709,7 +709,7 @@ export const useQueryStore = defineStore("query", () => {
|
||||
timeoutSecs: queryTimeoutSecs,
|
||||
};
|
||||
const frontendTimeoutSecs = Math.max(queryTimeoutSecs * 2, 60);
|
||||
const timeoutError = new Error(`查询超时 (${frontendTimeoutSecs}s),请检查数据库连接是否正常`);
|
||||
const timeoutError = new Error(t("editor.queryTimeoutError", { seconds: frontendTimeoutSecs }));
|
||||
const results = await Promise.race([
|
||||
api.executeMulti(tab.connectionId, tab.database, sqlToExecute, tab.schema, executionId, executionOptions),
|
||||
new Promise<never>((_, reject) => setTimeout(() => reject(timeoutError), frontendTimeoutSecs * 1000)),
|
||||
@@ -924,11 +924,11 @@ export const useQueryStore = defineStore("query", () => {
|
||||
function notifyConnectionMayBeLost() {
|
||||
const stuck = tabs.value.filter((t) => t.isExecuting);
|
||||
if (stuck.length > 0) {
|
||||
stuck.forEach((t) => {
|
||||
t.isExecuting = false;
|
||||
t.isCancelling = false;
|
||||
t.executionId = undefined;
|
||||
t.result = toErrorResult(new Error("连接可能已断开,请刷新数据重试"));
|
||||
stuck.forEach((tab) => {
|
||||
tab.isExecuting = false;
|
||||
tab.isCancelling = false;
|
||||
tab.executionId = undefined;
|
||||
tab.result = toErrorResult(new Error(t("editor.connectionMayBeLost")));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user