Skip to content

Commit

Permalink
Locale support
Browse files Browse the repository at this point in the history
Signed-off-by: worksofliam <[email protected]>
  • Loading branch information
worksofliam committed Sep 2, 2024
1 parent b02e1d9 commit 4d82b0b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
12 changes: 9 additions & 3 deletions src/languages/colour.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { ExtensionContext, Range, window, workspace, WorkspaceEdit } from "vscode";
import { instance } from "../instantiate";
import { t } from "../locale";

const NEW_LINE_NUMBERS = [10, 13];

Expand Down Expand Up @@ -44,14 +45,19 @@ async function shouldInitiateCleanup() {
if (config?.autoFixInvalidCharacters) {
return true;
}

const always = t(`Always`);
const no = t(`No`);

const chosen = await window.showInformationMessage(`This member contains invalid characters. Would you like to clean it up?`, `Yes`, `Always`, `No`);
const chosen = await window.showInformationMessage(
t(`seuColours.warning`),
t(`Yes`), always, no);

if (chosen === `No`) {
if (chosen === no) {
return false;
}

if (chosen === `Always` && config) {
if (chosen === always && config) {
config.autoFixInvalidCharacters = true;
await instance.setConfig(config);
}
Expand Down
4 changes: 3 additions & 1 deletion src/locale/ids/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,8 @@
"USER_DIRECTORY": "User directory",
"username": "Username",
"Yes": "Yes",
"Always": "Always",
"debug.service.config.incomplete": "Incomplete configuration",
"debug.service.config.incomplete.detail": "Certificate needs to be regenerated"
"debug.service.config.incomplete.detail": "Certificate needs to be regenerated",
"seuColours.warning": "This member contains invalid characters. Would you like to clean it up?"
}

0 comments on commit 4d82b0b

Please sign in to comment.