Skip to content
This repository was archived by the owner on May 15, 2026. It is now read-only.

Commit 6fbf91b

Browse files
committed
Localize router removal messaging
1 parent f681e03 commit 6fbf91b

22 files changed

Lines changed: 145 additions & 43 deletions

src/activate/__tests__/handleUri.spec.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
vi.mock("vscode", () => ({
2+
window: {
3+
showInformationMessage: vi.fn(),
4+
},
5+
}))
6+
7+
import * as vscode from "vscode"
8+
19
import { handleUri } from "../handleUri"
210

311
const mockVisibleProvider = {
@@ -24,5 +32,8 @@ describe("handleUri", () => {
2432

2533
expect(mockVisibleProvider.handleOpenRouterCallback).not.toHaveBeenCalled()
2634
expect(mockVisibleProvider.handleRequestyCallback).not.toHaveBeenCalled()
35+
expect(vscode.window.showInformationMessage).toHaveBeenCalledWith(
36+
"Roo Code Cloud sign-in is currently unavailable. Configure another provider to continue.",
37+
)
2738
})
2839
})

src/activate/handleUri.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import * as vscode from "vscode"
22

3+
import { getRouterUnavailableSignInMessage } from "../core/config/routerRemoval"
34
import { ClineProvider } from "../core/webview/ClineProvider"
45

56
export const handleUri = async (uri: vscode.Uri) => {
@@ -28,7 +29,7 @@ export const handleUri = async (uri: vscode.Uri) => {
2829
break
2930
}
3031
case "/auth/clerk/callback": {
31-
// Legacy Roo Cloud auth callbacks are ignored during compatibility mode.
32+
vscode.window.showInformationMessage(getRouterUnavailableSignInMessage())
3233
break
3334
}
3435
default:

src/core/config/routerRemoval.ts

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,28 @@
1+
import { t } from "../../i18n"
2+
13
export const LEGACY_ROO_PROVIDER = "roo"
24

3-
export const ROUTER_REMOVAL_MESSAGE =
5+
const ROUTER_REMOVAL_I18N_KEY = "common:errors.roo.routerRemoved"
6+
const ROUTER_REMOVAL_DEFAULT_MESSAGE =
47
"Roo Code Router has been removed. Please select and configure a different provider."
58

9+
const ROUTER_SIGN_IN_UNAVAILABLE_I18N_KEY = "common:info.roo.signInUnavailable"
10+
const ROUTER_SIGN_IN_UNAVAILABLE_DEFAULT_MESSAGE =
11+
"Roo Code Cloud sign-in is currently unavailable. Configure another provider to continue."
12+
13+
function getLocalizedMessage(key: string, defaultValue: string) {
14+
const translated = t(key, { defaultValue })
15+
return translated === key ? defaultValue : translated
16+
}
17+
18+
export const getRouterRemovalMessage = () =>
19+
getLocalizedMessage(ROUTER_REMOVAL_I18N_KEY, ROUTER_REMOVAL_DEFAULT_MESSAGE)
20+
21+
export const getRouterUnavailableSignInMessage = () =>
22+
getLocalizedMessage(ROUTER_SIGN_IN_UNAVAILABLE_I18N_KEY, ROUTER_SIGN_IN_UNAVAILABLE_DEFAULT_MESSAGE)
23+
24+
export const ROUTER_REMOVAL_MESSAGE = getRouterRemovalMessage()
25+
626
export const ROUTER_REMOVAL_IMPORT_WARNING =
727
"Roo Code Router was removed. The imported profile was downgraded and needs to be reconfigured."
828

src/core/webview/webviewMessageHandler.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ import { MessageEnhancer } from "./messageEnhancer"
4747

4848
import { CodeIndexManager } from "../../services/code-index/manager"
4949
import { checkExistKey } from "../../shared/checkExistApiConfig"
50-
import { ROUTER_REMOVAL_MESSAGE } from "../config/routerRemoval"
50+
import { getRouterRemovalMessage, getRouterUnavailableSignInMessage } from "../config/routerRemoval"
5151
import { experimentDefault } from "../../shared/experiments"
5252
import { Terminal } from "../../integrations/terminal/Terminal"
5353
import { openFile } from "../../integrations/misc/open-file"
@@ -107,9 +107,7 @@ export const webviewMessageHandler = async (
107107
const isCloudServiceAvailable = () => CloudService.hasInstance()
108108

109109
const showCloudUnavailableMessage = () => {
110-
vscode.window.showInformationMessage(
111-
"Roo Code Cloud sign-in is currently unavailable. Configure another provider to continue.",
112-
)
110+
vscode.window.showInformationMessage(getRouterUnavailableSignInMessage())
113111
}
114112

115113
const getCurrentMode = async (): Promise<string> => {
@@ -1097,7 +1095,7 @@ export const webviewMessageHandler = async (
10971095
provider.postMessageToWebview({
10981096
type: "singleRouterModelFetchResponse",
10991097
success: false,
1100-
error: ROUTER_REMOVAL_MESSAGE,
1098+
error: getRouterRemovalMessage(),
11011099
values: { provider: "roo" },
11021100
})
11031101
break

src/i18n/locales/ca/common.json

Lines changed: 6 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/i18n/locales/de/common.json

Lines changed: 6 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/i18n/locales/en/common.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,8 @@
112112
"thinking_complete_recitation": "(Thinking complete, but output was blocked due to recitation check.)"
113113
},
114114
"roo": {
115-
"authenticationRequired": "Roo provider requires cloud authentication. Please sign in to Roo Code Cloud."
115+
"authenticationRequired": "Roo provider requires cloud authentication. Please sign in to Roo Code Cloud.",
116+
"routerRemoved": "Roo Code Router has been removed. Please select and configure a different provider."
116117
},
117118
"openAiCodex": {
118119
"notAuthenticated": "Not authenticated with OpenAI Codex. Please sign in using the OpenAI Codex OAuth flow.",
@@ -161,7 +162,10 @@
161162
"image_copied_to_clipboard": "Image data URI copied to clipboard",
162163
"image_saved": "Image saved to {{path}}",
163164
"mode_exported": "Mode '{{mode}}' exported successfully",
164-
"mode_imported": "Mode imported successfully"
165+
"mode_imported": "Mode imported successfully",
166+
"roo": {
167+
"signInUnavailable": "Roo Code Cloud sign-in is currently unavailable. Configure another provider to continue."
168+
}
165169
},
166170
"answers": {
167171
"yes": "Yes",

src/i18n/locales/es/common.json

Lines changed: 6 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/i18n/locales/fr/common.json

Lines changed: 6 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/i18n/locales/hi/common.json

Lines changed: 6 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)