i18n(desktop): localize the strings the bot rail still hardcoded

Both roster filter menus, the avatar picker's tabs. Renamed group.newDesc to
group.manageDesc since it describes managing an existing group, not making
one.

The getPluginCtx()?.i18n.t() sites only guarded the context, not i18n on it
— a plugin context without the bundle threw mid-render and painted an empty
rail. Guarded both.
This commit is contained in:
Brooklyn Nicholson
2026-08-27 21:46:54 -05:00
parent 716564531b
commit fa236b31ff
4 changed files with 55 additions and 23 deletions
@@ -121,14 +121,13 @@ export function AvatarPicker({ shape, color, image, onShape, onColor, onImage, g
return (
<div className="grid justify-items-center gap-3">
{/* Tab pills: Bot | Generate | Upload | Pet */}
<SegmentedControl
onChange={goTab}
options={[
{ id: 'bot', label: 'Bot' },
{ id: 'generate', label: 'Generate' },
{ id: 'bot', label: b.avatar.tabBot },
{ id: 'generate', label: b.avatar.tabGenerate },
{ id: 'upload', label: b.avatar.upload },
{ id: 'pet', label: 'Pet' }
{ id: 'pet', label: b.avatar.tabPet }
]}
value={tab}
/>
@@ -165,7 +164,12 @@ export function AvatarPicker({ shape, color, image, onShape, onColor, onImage, g
title={k || 'Auto — the name decides'}
>
{k ? (
<BotFace color={avatarColor(color, pickerName)} name={pickerName} shape={blobShapeString(seedPart, k)} size={32} />
<BotFace
color={avatarColor(color, pickerName)}
name={pickerName}
shape={blobShapeString(seedPart, k)}
size={32}
/>
) : (
<span className="text-[0.6rem] text-(--ui-text-tertiary)">Auto</span>
)}
@@ -188,9 +192,7 @@ export function AvatarPicker({ shape, color, image, onShape, onColor, onImage, g
<Button
onClick={() => onShape(blobShapeString(locked ? '' : pickerName, kind))}
size="sm"
title={
locked ? b.avatar.unlockFollowsName : 'Keep this exact face even if the name changes'
}
title={locked ? b.avatar.unlockFollowsName : 'Keep this exact face even if the name changes'}
type="button"
variant="ghost"
>
@@ -270,9 +272,7 @@ export function AvatarPicker({ shape, color, image, onShape, onColor, onImage, g
{genBusy ? 'Generating…' : 'Generate'}
</Button>
{describe.trim() ? null : (
<div className="text-center text-[0.65rem] text-(--ui-text-quaternary)">
{b.bot.descriptionHint}
</div>
<div className="text-center text-[0.65rem] text-(--ui-text-quaternary)">{b.bot.descriptionHint}</div>
)}
</div>
) : (
@@ -518,7 +518,7 @@ export async function prepareBotSource(bot: RosterRow) {
if (route && typeof host.requestProfile !== 'function') {
throw new Error(
getPluginCtx()?.i18n.t('bot.remoteConnectionsUnsupported') ??
getPluginCtx()?.i18n?.t('bot.remoteConnectionsUnsupported') ??
'Update Hermes Desktop to chat with bots on other connections.'
)
}
+33 -4
View File
@@ -41,7 +41,20 @@ type BotsMessages = {
pinned: string
needsAttention: string
needsInput: string
/** The kind filter's three options, in menu order. */
botsAndGroups: string
botsOnly: string
groupsOnly: string
/** The activity filter's four options, in menu order. */
anyActivity: string
activeNow: string
recentlyActive: string
older: string
/** How a row's owning gateway is doing — see `botSourceStatus`. */
gatewayRemoved: string
onDemand: string
ready: string
statusUnknown: string
unavailable: string
retryNow: string
rosterUnavailable: (reason: string) => string
@@ -74,7 +87,11 @@ type BotsMessages = {
blobFromName: string
unlockFollowsName: string
randomize: string
/** The picker's four tabs, in order. */
tabBot: string
tabGenerate: string
upload: string
tabPet: string
removeImage: string
removeBackToShape: string
describePlaceholder: string
@@ -90,7 +107,7 @@ type BotsMessages = {
/** Group chats: the room, its composer, threads and activity feed. */
group: {
newTitle: string
newDesc: string
manageDesc: string
manageTitle: string
settingsTitle: string
settingsDesc: string
@@ -149,7 +166,17 @@ const en: BotsMessages = {
pinned: 'Pinned',
needsAttention: 'needs attention',
needsInput: 'Needs your input',
botsAndGroups: 'Bots and group chats',
botsOnly: 'Bots only',
groupsOnly: 'Group chats only',
anyActivity: 'Any activity',
activeNow: 'Active now',
recentlyActive: 'Recently active',
older: 'Older',
gatewayRemoved: 'Gateway removed',
onDemand: 'On demand',
ready: 'Ready',
statusUnknown: 'Status unknown',
unavailable: 'Unavailable',
retryNow: 'Retry now',
rosterUnavailable: reason =>
@@ -181,12 +208,14 @@ const en: BotsMessages = {
blobFromName: 'Blob face — drawn from the bot’s name',
unlockFollowsName: 'Unlock — the face follows the bot’s name again',
randomize: 'Randomize',
tabBot: 'Bot',
tabGenerate: 'Generate',
upload: 'Upload',
tabPet: 'Pet',
removeImage: 'Remove image — use shape',
removeBackToShape: 'Remove — back to shape avatar',
describePlaceholder: 'Describe your avatar…',
describeHint:
'Leave blank to auto-generate from name/title/description + agent-messaging roster.',
describeHint: 'Leave blank to auto-generate from name/title/description + agent-messaging roster.',
matchTheName: 'Match the name',
pickPet: 'Pick a pet as this bot’s profile picture.',
petLoadFailed: 'Could not load that pet — try another.',
@@ -197,7 +226,7 @@ const en: BotsMessages = {
},
group: {
newTitle: 'New Group Chat',
newDesc: 'A bot can join multiple group chats. Memberships sync to every machine.',
manageDesc: 'A bot can join multiple group chats. Memberships sync to every machine.',
manageTitle: 'Manage groups',
settingsTitle: 'Group settings',
settingsDesc: 'Rename the group or set a room picture. Members and history are kept.',
@@ -680,9 +680,9 @@ export function BotsPane() {
<DropdownMenuContent align="end">
{(
[
['all', 'Bots and group chats'],
['bots', 'Bots only'],
['groups', 'Group chats only']
['all', b.roster.botsAndGroups],
['bots', b.roster.botsOnly],
['groups', b.roster.groupsOnly]
] as [RosterKindFilter, string][]
).map(([value, label]) => (
<DropdownMenuItem key={`kind:${value}`} onSelect={() => setRowKindFilter(value)}>
@@ -693,10 +693,10 @@ export function BotsPane() {
<DropdownMenuSeparator />
{(
[
['all', 'Any activity'],
['all', b.roster.anyActivity],
['active', b.roster.activeNow],
['recent', 'Recently active'],
['older', 'Older']
['recent', b.roster.recentlyActive],
['older', b.roster.older]
] as [RosterActivityFilter, string][]
).map(([value, label]) => (
<DropdownMenuItem key={`activity:${value}`} onSelect={() => setActivityFilter(value)}>
@@ -923,7 +923,10 @@ export function BotsPane() {
doneLabel="Deleted"
onClose={() => setDeletingGroup(null)}
onConfirm={async () => {
if (!deletingGroup) {return}
if (!deletingGroup) {
return
}
await disbandGroupChat(deletingGroup.name, deletingGroup.members)
host.notify({
kind: 'success',