Skip to content

Commit

Permalink
feat(custom-action): use i18n for family name
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
phodal committed Mar 6, 2024
1 parent 2e2e91b commit f9695b7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
@@ -1,5 +1,6 @@
package cc.unitmesh.devti.custom

import cc.unitmesh.devti.AutoDevBundle
import cc.unitmesh.devti.custom.action.CustomIntentionConfig
import cc.unitmesh.devti.custom.action.CustomIntentionPrompt
import cc.unitmesh.devti.custom.variable.*
Expand All @@ -22,7 +23,7 @@ class CustomActionBaseIntention(private val intentionConfig: CustomIntentionConf

private val logger = logger<CustomActionBaseIntention>()

override fun getFamilyName(): String = "Custom Intention"
override fun getFamilyName(): String = AutoDevBundle.message("autodev.custom.intentions.family")
override fun priority(): Int {
return intentionConfig.priority
}
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/messages/AutoDevBundle.properties
Expand Up @@ -34,6 +34,7 @@ intentions.request.background.process.title=Your LLM is processing your request

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

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

0 comments on commit f9695b7

Please sign in to comment.