Skip to content
This repository was archived by the owner on Jul 22, 2025. It is now read-only.

Commit 0f90497

Browse files
authored
FIX: correctly translate automation name (#1485)
* FIX: correctly translation automation name The key is persona, not name. * simplify
1 parent 2b9a4f9 commit 0f90497

File tree

2 files changed

+4
-12
lines changed

2 files changed

+4
-12
lines changed

assets/javascripts/discourse/components/ai-llms-list-editor.gjs

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -112,17 +112,9 @@ export default class AiLlmsListEditor extends Component {
112112
}
113113

114114
localizeUsage(usage) {
115-
if (usage.type === "ai_persona") {
116-
return i18n("discourse_ai.llms.usage.ai_persona", {
117-
persona: usage.name,
118-
});
119-
} else if (usage.type === "automation") {
120-
return i18n("discourse_ai.llms.usage.automation", {
121-
name: usage.name,
122-
});
123-
} else {
124-
return i18n("discourse_ai.llms.usage." + usage.type);
125-
}
115+
return i18n(`discourse_ai.llms.usage.${usage.type}`, {
116+
persona: usage.name,
117+
});
126118
}
127119

128120
<template>

config/locales/client.en.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ en:
568568
ai_summarization: "Summarize"
569569
ai_embeddings_semantic_search: "AI search"
570570
ai_spam: "Spam"
571-
automation: "Automation (%{name})"
571+
automation: "Automation (%{persona})"
572572
in_use_warning:
573573
one: "This model is currently used by %{settings}. If misconfigured, the feature won't work as expected."
574574
other: "This model is currently used by the following: %{settings}. If misconfigured, features won't work as expected. "

0 commit comments

Comments
 (0)