Skip to content

Commit

Permalink
feat: make strings in code-lens translatable
Browse files Browse the repository at this point in the history
  • Loading branch information
MaikoTan committed Nov 29, 2023
1 parent 5e1cf51 commit 590bb36
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/timeline/code-lens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ import { exec } from 'child_process'
import { promisify } from 'util'

import * as vscode from 'vscode'
import * as nls from 'vscode-nls'

const localize = nls.loadMessageBundle()

export class TimelineCodeLensProvider implements vscode.CodeLensProvider {
// eslint-disable-next-line @typescript-eslint/naming-convention
Expand All @@ -27,15 +30,15 @@ export class TimelineCodeLensProvider implements vscode.CodeLensProvider {
new vscode.CodeLens(range, {
command: 'cactbot.timeline.runGenerateScript',
title: 'run make_timeline',
tooltip: 'Run `make_timeline` command in terminal',
tooltip: localize('codeLens.makeTimeline.run', 'Run `make_timeline` command'),
arguments: args,
}),
)
codeLenses.push(
new vscode.CodeLens(range, {
command: 'cactbot.timeline.runGenerateScriptWithoutExecution',
title: 'send make_timeline',
tooltip: 'Send `make_timeline` command to terminal without execution',
tooltip: localize('codeLens.makeTimeline.send', 'Send `make_timeline` command to terminal without execution'),
arguments: args,
}),
)
Expand Down Expand Up @@ -81,7 +84,7 @@ export async function runMakeTimeline(args: IArguments[], run = true): Promise<v
vscode.window.showErrorMessage((e as Error).message)
// show error in output panel
const output = vscode.window.createOutputChannel('Cactbot Timeline')
output.appendLine('Errors occurred while running make_timeline:')
output.appendLine(localize('codeLens.makeTimeline.error', 'Errors occurred while running make_timeline:'))
output.appendLine((e as Error).message)
output.appendLine('')
}
Expand Down

0 comments on commit 590bb36

Please sign in to comment.