Skip to content

Commit

Permalink
Fixing loc reference (#18406)
Browse files Browse the repository at this point in the history
* Fixing loc dependency

* updated loc bundle
  • Loading branch information
Benjin authored Nov 14, 2024
1 parent fa84a4d commit 56a1486
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 18 deletions.
12 changes: 6 additions & 6 deletions localization/l10n/bundle.l10n.json
Original file line number Diff line number Diff line change
Expand Up @@ -229,12 +229,6 @@
"Default": "Default",
"Delete saved connection": "Delete saved connection",
"Remove recent connection": "Remove recent connection",
"delete the saved connection: {0}?/{0} is the connection name": {
"message": "delete the saved connection: {0}?",
"comment": [
"{0} is the connection name"
]
},
"Query {0}: Query cost (relative to the script): {1}%/{0} is the query number{1} is the query cost": {
"message": "Query {0}: Query cost (relative to the script): {1}%",
"comment": [
Expand Down Expand Up @@ -755,6 +749,12 @@
"{1} is the subscription id"
]
},
"delete the saved connection: {0}?/{0} is the connection name": {
"message": "delete the saved connection: {0}?",
"comment": [
"{0} is the connection name"
]
},
"How likely it is that you would recommend the MSSQL extension to a friend or colleague?": "How likely it is that you would recommend the MSSQL extension to a friend or colleague?",
"What can we do to improve?": "What can we do to improve?",
"Take Survey": "Take Survey",
Expand Down
10 changes: 5 additions & 5 deletions src/connectionconfig/connectionDialogWebviewController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import {
} from "../reactviews/common/forms/form";
import {
ConnectionDialog as Loc,
Common as LocCommon,
refreshTokenLabel,
} from "../constants/locConstants";
import {
Expand Down Expand Up @@ -66,7 +67,6 @@ import {
IConnectionCredentialsQuickPickItem,
IConnectionProfile,
} from "../models/interfaces";
import { locConstants } from "../reactviews/common/locConstants";
import { IAccount, ITenant } from "../models/contracts/azure";

export class ConnectionDialogWebviewController extends ReactWebviewPanelController<
Expand Down Expand Up @@ -1174,17 +1174,17 @@ export class ConnectionDialogWebviewController extends ReactWebviewPanelControll
"deleteSavedConnection",
async (state, payload) => {
const confirm = await vscode.window.showQuickPick(
[locConstants.common.Delete, locConstants.common.Cancel],
[LocCommon.delete, LocCommon.cancel],
{
title: locConstants.common.AreYouSureYouWantTo(
locConstants.connectionDialog.deleteTheSavedConnection(
title: LocCommon.areYouSureYouWantTo(
Loc.deleteTheSavedConnection(
payload.connection.displayName,
),
),
},
);

if (confirm !== locConstants.common.Delete) {
if (confirm !== LocCommon.delete) {
return state;
}

Expand Down
16 changes: 16 additions & 0 deletions src/constants/locConstants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -694,6 +694,13 @@ export class ConnectionDialog {
],
});
}
public static deleteTheSavedConnection = (connectionName: string) => {
return l10n.t({
message: "delete the saved connection: {0}?",
args: [connectionName],
comment: ["{0} is the connection name"],
});
};
}

export class UserSurvey {
Expand Down Expand Up @@ -736,6 +743,15 @@ export class Common {
public static remindMeLater = l10n.t("Remind Me Later");
public static dontShowAgain = l10n.t("Don't Show Again");
public static learnMore = l10n.t("Learn More");
public static delete = l10n.t("Delete");
public static cancel = l10n.t("Cancel");
public static areYouSure = l10n.t("Are you sure?");
public static areYouSureYouWantTo = (action: string) =>
l10n.t({
message: "Are you sure you want to {0}?",
args: [action],
comment: ["{0} is the action being confirmed"],
});
}

export class Webview {
Expand Down
7 changes: 0 additions & 7 deletions src/reactviews/common/locConstants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,13 +210,6 @@ export class LocConstants {
default: l10n.t("Default"),
deleteSavedConnection: l10n.t("Delete saved connection"),
removeRecentConnection: l10n.t("Remove recent connection"),
deleteTheSavedConnection: (connectionName: string) => {
return l10n.t({
message: "delete the saved connection: {0}?",
args: [connectionName],
comment: ["{0} is the connection name"],
});
},
};
}

Expand Down

0 comments on commit 56a1486

Please sign in to comment.