Skip to content

Commit f9695b7

Browse files
committed
feat(custom-action): use i18n for family name
Add support for internationalization in `CustomActionBaseIntention` by leveraging `AutoDevBundle` for the family name. This change ensures that the "Custom Intention" family name is now localized, enhancing the user experience for non-English users.
1 parent 2e2e91b commit f9695b7

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/main/kotlin/cc/unitmesh/devti/custom/CustomActionBaseIntention.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package cc.unitmesh.devti.custom
22

3+
import cc.unitmesh.devti.AutoDevBundle
34
import cc.unitmesh.devti.custom.action.CustomIntentionConfig
45
import cc.unitmesh.devti.custom.action.CustomIntentionPrompt
56
import cc.unitmesh.devti.custom.variable.*
@@ -22,7 +23,7 @@ class CustomActionBaseIntention(private val intentionConfig: CustomIntentionConf
2223

2324
private val logger = logger<CustomActionBaseIntention>()
2425

25-
override fun getFamilyName(): String = "Custom Intention"
26+
override fun getFamilyName(): String = AutoDevBundle.message("autodev.custom.intentions.family")
2627
override fun priority(): Int {
2728
return intentionConfig.priority
2829
}

src/main/resources/messages/AutoDevBundle.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ intentions.request.background.process.title=Your LLM is processing your request
3434

3535
autodev.custom.response.format.placeholder=Use json path, for example: `$.choices[0].delta.content`
3636
autodev.custom.prompt.placeholder=Custom your prompt here
37+
autodev.custom.intentions.family=Custom Intention
3738

3839
tooltip.thanks=Thanks for like, but we don't support this
3940
label.submit.issue=Want new feature?

0 commit comments

Comments
 (0)