Skip to content

Commit 6f61f81

Browse files
committed
feat(sketch): add localized lint error messages
Added localization support for lint error messages in the Sketch feature. Updated both `AutoDevBundle_zh.properties` and `AutoDevBundle_en.properties` with new keys `sketch.lint.error.tooltip` and `sketch.lint.error` to display error counts and tooltips. Modified `SketchCodeInspection.kt` to use these localized messages dynamically.
1 parent 79a5fc1 commit 6f61f81

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

core/src/main/kotlin/cc/unitmesh/devti/sketch/lint/SketchCodeInspection.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package cc.unitmesh.devti.sketch.lint
22

3+
import cc.unitmesh.devti.AutoDevBundle
34
import com.intellij.analysis.AnalysisScope
45
import com.intellij.codeInsight.daemon.impl.DaemonProgressIndicator
56
import com.intellij.codeInspection.InspectionEngine
@@ -63,16 +64,15 @@ object SketchCodeInspection {
6364
val scrollPane = JBScrollPane(table).apply {
6465
preferredSize = Dimension(480, 400)
6566
}
66-
val errorLabel = JBLabel("Found Lint issue: ${errors.size}").apply {
67+
val errorLabel = JBLabel(AutoDevBundle.message("sketch.lint.error", errors.size)).apply {
6768
border = BorderFactory.createEmptyBorder(5, 5, 5, 5)
6869
}
6970
errorLabel.addMouseListener(object : MouseAdapter() {
7071
override fun mouseClicked(e: MouseEvent?) {
7172
createPopup(scrollPane, table, errors).showInCenterOf(panel)
7273
}
73-
7474
override fun mouseEntered(e: MouseEvent) {
75-
errorLabel.toolTipText = "Click to view all errors"
75+
errorLabel.toolTipText = AutoDevBundle.message("sketch.lint.error.tooltip")
7676
}
7777
})
7878

core/src/main/resources/messages/AutoDevBundle_en.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,3 +214,5 @@ sketch.patch.action.rollback.tooltip=Rollback the change
214214
prompts.autodev.inlineChat=According user selection to ask user question
215215
prompts.autodev.sketch=Sketch
216216
sketch.composer.mode=Composer Mode
217+
sketch.lint.error.tooltip=Click to view all errors
218+
sketch.lint.error=Found Lint issue: {0}

core/src/main/resources/messages/AutoDevBundle_zh.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,3 +213,5 @@ sketch.patch.action.rollback.tooltip=Rollback the change
213213
prompts.autodev.inlineChat=According user selection to ask user question
214214
prompts.autodev.sketch=Sketch
215215
sketch.composer.mode=Composer Mode(自动模式)
216+
sketch.lint.error.tooltip=查看 Lint/Inspection 错误
217+
sketch.lint.error=发现 {0} 个 Lint/Inspection 错误

0 commit comments

Comments
 (0)