Skip to content

Commit 3ca015c

Browse files
authored
Adopt l10n for simple-browser (microsoft#165529)
For microsoft#164438
1 parent 10dc1a3 commit 3ca015c

File tree

4 files changed

+10
-21
lines changed

4 files changed

+10
-21
lines changed

extensions/simple-browser/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,7 @@
6767
"watch-web": "npx webpack-cli --config extension-browser.webpack.config --mode none --watch --info-verbosity verbose"
6868
},
6969
"dependencies": {
70-
"@vscode/extension-telemetry": "0.6.2",
71-
"vscode-nls": "^5.2.0"
70+
"@vscode/extension-telemetry": "0.6.2"
7271
},
7372
"devDependencies": {
7473
"@types/vscode-webview": "^1.57.0",

extensions/simple-browser/src/extension.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
*--------------------------------------------------------------------------------------------*/
55

66
import * as vscode from 'vscode';
7-
import * as nls from 'vscode-nls';
87
import { SimpleBrowserManager } from './simpleBrowserManager';
98
import { SimpleBrowserView } from './simpleBrowserView';
109

@@ -13,8 +12,6 @@ declare class URL {
1312
hostname: string;
1413
}
1514

16-
const localize = nls.loadMessageBundle();
17-
1815
const openApiCommand = 'simpleBrowser.api.open';
1916
const showCommand = 'simpleBrowser.show';
2017

@@ -48,8 +45,8 @@ export function activate(context: vscode.ExtensionContext) {
4845
context.subscriptions.push(vscode.commands.registerCommand(showCommand, async (url?: string) => {
4946
if (!url) {
5047
url = await vscode.window.showInputBox({
51-
placeHolder: localize('simpleBrowser.show.placeholder', "https://example.com"),
52-
prompt: localize('simpleBrowser.show.prompt', "Enter url to visit")
48+
placeHolder: vscode.l10n.t("https://example.com"),
49+
prompt: vscode.l10n.t("Enter url to visit")
5350
});
5451
}
5552

@@ -84,7 +81,7 @@ export function activate(context: vscode.ExtensionContext) {
8481
}
8582
}, {
8683
schemes: ['http', 'https'],
87-
label: localize('openTitle', "Open in simple browser"),
84+
label: vscode.l10n.t("Open in simple browser"),
8885
}));
8986
}
9087

extensions/simple-browser/src/simpleBrowserView.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@
44
*--------------------------------------------------------------------------------------------*/
55

66
import * as vscode from 'vscode';
7-
import * as nls from 'vscode-nls';
87
import { Disposable } from './dispose';
98

10-
const localize = nls.loadMessageBundle();
119

1210
export interface ShowOptions {
1311
readonly preserveFocus?: boolean;
@@ -17,7 +15,7 @@ export interface ShowOptions {
1715
export class SimpleBrowserView extends Disposable {
1816

1917
public static readonly viewType = 'simpleBrowser.view';
20-
private static readonly title = localize('view.title', "Simple Browser");
18+
private static readonly title = vscode.l10n.t("Simple Browser");
2119

2220
private readonly _webviewPanel: vscode.WebviewPanel;
2321

@@ -134,28 +132,28 @@ export class SimpleBrowserView extends Disposable {
134132
<header class="header">
135133
<nav class="controls">
136134
<button
137-
title="${localize('control.back.title', "Back")}"
135+
title="${vscode.l10n.t("Back")}"
138136
class="back-button icon"><i class="codicon codicon-arrow-left"></i></button>
139137
140138
<button
141-
title="${localize('control.forward.title', "Forward")}"
139+
title="${vscode.l10n.t("Forward")}"
142140
class="forward-button icon"><i class="codicon codicon-arrow-right"></i></button>
143141
144142
<button
145-
title="${localize('control.reload.title', "Reload")}"
143+
title="${vscode.l10n.t("Reload")}"
146144
class="reload-button icon"><i class="codicon codicon-refresh"></i></button>
147145
</nav>
148146
149147
<input class="url-input" type="text">
150148
151149
<nav class="controls">
152150
<button
153-
title="${localize('control.openExternal.title', "Open in browser")}"
151+
title="${vscode.l10n.t("Open in browser")}"
154152
class="open-external-button icon"><i class="codicon codicon-link-external"></i></button>
155153
</nav>
156154
</header>
157155
<div class="content">
158-
<div class="iframe-focused-alert">${localize('view.iframe-focused', "Focus Lock")}</div>
156+
<div class="iframe-focused-alert">${vscode.l10n.t("Focus Lock")}</div>
159157
<iframe sandbox="allow-scripts allow-forms allow-same-origin"></iframe>
160158
</div>
161159

extensions/simple-browser/yarn.lock

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,3 @@ vscode-codicons@^0.0.14:
5555
version "0.0.14"
5656
resolved "https://registry.yarnpkg.com/vscode-codicons/-/vscode-codicons-0.0.14.tgz#e0d05418e2e195564ff6f6a2199d70415911c18f"
5757
integrity sha512-6CEH5KT9ct5WMw7n5dlX7rB8ya4CUI2FSq1Wk36XaW+c5RglFtAanUV0T+gvZVVFhl/WxfjTvFHq06Hz9c1SLA==
58-
59-
vscode-nls@^5.2.0:
60-
version "5.2.0"
61-
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-5.2.0.tgz#3cb6893dd9bd695244d8a024bdf746eea665cc3f"
62-
integrity sha512-RAaHx7B14ZU04EU31pT+rKz2/zSl7xMsfIZuo8pd+KZO6PXtQmpevpq3vxvWNcrGbdmhM/rr5Uw5Mz+NBfhVng==

0 commit comments

Comments
 (0)