Skip to content
This repository was archived by the owner on Jul 22, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 3 additions & 11 deletions assets/javascripts/discourse/components/ai-llms-list-editor.gjs
Original file line number Diff line number Diff line change
Expand Up @@ -112,17 +112,9 @@ export default class AiLlmsListEditor extends Component {
}

localizeUsage(usage) {
if (usage.type === "ai_persona") {
return i18n("discourse_ai.llms.usage.ai_persona", {
persona: usage.name,
});
} else if (usage.type === "automation") {
return i18n("discourse_ai.llms.usage.automation", {
name: usage.name,
});
} else {
return i18n("discourse_ai.llms.usage." + usage.type);
}
Comment on lines -115 to -125
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we needed all this complexity here, I get that we think name is more accurate than persona for automation, but this forces us to always have a special case for it (and created this bug, as we forgot the special case at another place). Maybe we could also think of a more generic name, like: identifier.

return i18n(`discourse_ai.llms.usage.${usage.type}`, {
persona: usage.name,
});
}

<template>
Expand Down
2 changes: 1 addition & 1 deletion config/locales/client.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ en:
ai_summarization: "Summarize"
ai_embeddings_semantic_search: "AI search"
ai_spam: "Spam"
automation: "Automation (%{name})"
automation: "Automation (%{persona})"
in_use_warning:
one: "This model is currently used by %{settings}. If misconfigured, the feature won't work as expected."
other: "This model is currently used by the following: %{settings}. If misconfigured, features won't work as expected. "
Expand Down
Loading