Skip to content
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
1 change: 1 addition & 0 deletions changelog.d/3114-social-share-cards-zh.changed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The Social panel's share-request and invite-accepted cards — their sentence, hint line, buttons, and the **Open …'s Sharing** title — now follow the window's language, so a Chinese window no longer draws English there; a window without a translator still reads today's English ([#3114](https://github.com/ThinkFlowLab/FlyBot/issues/3114)).
9 changes: 9 additions & 0 deletions core/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,15 @@ var ZH = {
"Open settings to set up a custom model": "打开设置配置自定义模型",
"FlyBot": "FlyBot",
"FlyBot core": "FlyBot 核心",
// Social's two notice cards (#3114): the share request and the accepted invite read in the
// window's language. `Dismiss` and `your Bot` already carry their Chinese above.
"A friend": "一位好友",
"{name} accepted your invite. They can message {bot}. You cannot message them until they share a Bot with you.": "{name} 接受了你的邀请,可以给 {bot} 发消息。在对方分享一个 Bot 给你之前,你还不能给对方发消息。",
"You asked them to share a Bot.": "你已经请对方分享一个 Bot。",
"Ask them to share a Bot": "请对方分享一个 Bot",
"{name} tried to start a chat with {bot}. {bot} is not shared with them.": "{name} 想和 {bot} 开始聊天,但 {bot} 没有分享给对方。",
"Open {bot}'s Sharing": "打开 {bot} 的分享",
"Share {bot}…": "分享 {bot}…",
// Header
"Message {name}": "给 {name} 发消息",
Message: "发消息",
Expand Down
12 changes: 12 additions & 0 deletions core/src/client/i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,18 @@ const ZH = {
'FlyBot': 'FlyBot',
'FlyBot core': 'FlyBot 核心',

// Social's two notice cards (#3114): the share request and the accepted invite read in the
// window's language. `Dismiss` and `your Bot` already carry their Chinese above.
'A friend': '一位好友',
'{name} accepted your invite. They can message {bot}. You cannot message them until they share a Bot with you.':
'{name} 接受了你的邀请,可以给 {bot} 发消息。在对方分享一个 Bot 给你之前,你还不能给对方发消息。',
'You asked them to share a Bot.': '你已经请对方分享一个 Bot。',
'Ask them to share a Bot': '请对方分享一个 Bot',
'{name} tried to start a chat with {bot}. {bot} is not shared with them.':
'{name} 想和 {bot} 开始聊天,但 {bot} 没有分享给对方。',
"Open {bot}'s Sharing": '打开 {bot} 的分享',
'Share {bot}…': '分享 {bot}…',

// Header
'Message {name}': '给 {name} 发消息',
Message: '发消息',
Expand Down
3 changes: 0 additions & 3 deletions core/test/i18n-missing-entries.baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"plugins/social/client.js:Accept an invite",
"plugins/social/client.js:Anyone with the link can join while the room is open.",
"plugins/social/client.js:Anyone with the number can still join.",
"plugins/social/client.js:Ask them to share a Bot",
"plugins/social/client.js:Auto-send",
"plugins/social/client.js:Auto-send off",
"plugins/social/client.js:Auto-send on",
Expand Down Expand Up @@ -101,15 +100,13 @@
"plugins/social/client.js:Who has joined#1",
"plugins/social/client.js:Who has joined#2",
"plugins/social/client.js:You already joined with that link using other Bots. Leave the group first to join with different ones.",
"plugins/social/client.js:You asked them to share a Bot.",
"plugins/social/client.js:Your friend gets this Bot only.",
"plugins/social/client.js:Your own Bots stay shared. {} can share it again.",
"plugins/social/client.js:mine#1",
"plugins/social/client.js:mine#2",
"plugins/social/client.js:the group",
"plugins/social/client.js:the room",
"plugins/social/client.js:{} (you)",
"plugins/social/client.js:{} accepted your invite. They can message {}. You cannot message them until they share a Bot with you.",
"plugins/social/client.js:{} is now a friend.",
"plugins/social/client.js:{} shared {} with you.{}",
"plugins/social/client.js:{} stays a friend: still shared through {}.",
Expand Down
2 changes: 0 additions & 2 deletions core/test/i18n-plugins.baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
"plugins/social/client.js:Copied#2",
"plugins/social/client.js:Copy",
"plugins/social/client.js:Copy link",
"plugins/social/client.js:Dismiss#1",
"plugins/social/client.js:Dismiss#2",
"plugins/social/client.js:New link",
"plugins/social/client.js:Your Bot Social handle",
"plugins/social/client.js:Your Bots",
Expand Down
3 changes: 0 additions & 3 deletions core/test/i18n-template-draws.baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
"plugins/social/client.js:Invite grants {} only. Revoke anytime in People with access.",
"plugins/social/client.js:Invite link for {}",
"plugins/social/client.js:One click shares {} with someone you already know. No invite link. They can decline; you can Revoke in People with access.",
"plugins/social/client.js:Open {}'s Sharing",
"plugins/social/client.js:QR code for room number {}",
"plugins/social/client.js:Remove {} from your list? {}",
"plugins/social/client.js:Revoke {}#1",
Expand All @@ -20,13 +19,11 @@
"plugins/social/client.js:Scanned {}.",
"plugins/social/client.js:Scanned {}. Pick a Bot to join.",
"plugins/social/client.js:Share {} with {}",
"plugins/social/client.js:Share {}…",
"plugins/social/client.js:Waiting for {} to let you in. If the group does not appear, press Join group to ask again.",
"plugins/social/client.js:You are {}",
"plugins/social/client.js:Your Bots' replies to {} go out without asking you first. What you type is not affected.",
"plugins/social/client.js:{} Send your message again: it starts a new chat.",
"plugins/social/client.js:{} failed: {}",
"plugins/social/client.js:{} tried to start a chat with {}. {} is not shared with them.",
"plugins/social/client.js:{}'s replies to {} go out without asking you first.#1",
"plugins/social/client.js:{}'s replies to {} go out without asking you first.#2",
"plugins/timeline/client.js:Could not copy the report: {}",
Expand Down
14 changes: 13 additions & 1 deletion patches/ds-bot/0001-core-fixes.patch
Original file line number Diff line number Diff line change
Expand Up @@ -1055,7 +1055,7 @@ diff --git a/src/client/i18n.js b/src/client/i18n.js
Connected: '已连接',
Disconnect: '断开',
Connect: '连接',
@@ -105,17 +105,64 @@ const ZH = {
@@ -105,17 +105,76 @@ const ZH = {
'GitHub addresses must start with https://': 'GitHub 地址必须以 https:// 开头',
'This DSH cannot load connectors': '这个 DSH 不能加载连接器',
'No such connector': '没有这个连接器',
Expand Down Expand Up @@ -1121,6 +1121,18 @@ diff --git a/src/client/i18n.js b/src/client/i18n.js
- 'DS Bot': 'DS Bot',
+ 'FlyBot': 'FlyBot',
+ 'FlyBot core': 'FlyBot 核心',
+
+ // Social's two notice cards (#3114): the share request and the accepted invite read in the
+ // window's language. `Dismiss` and `your Bot` already carry their Chinese above.
+ 'A friend': '一位好友',
+ '{name} accepted your invite. They can message {bot}. You cannot message them until they share a Bot with you.':
+ '{name} 接受了你的邀请,可以给 {bot} 发消息。在对方分享一个 Bot 给你之前,你还不能给对方发消息。',
+ 'You asked them to share a Bot.': '你已经请对方分享一个 Bot。',
+ 'Ask them to share a Bot': '请对方分享一个 Bot',
+ '{name} tried to start a chat with {bot}. {bot} is not shared with them.':
+ '{name} 想和 {bot} 开始聊天,但 {bot} 没有分享给对方。',
+ "Open {bot}'s Sharing": '打开 {bot} 的分享',
+ 'Share {bot}…': '分享 {bot}…',

// Header
'Message {name}': '给 {name} 发消息',
Expand Down
11 changes: 10 additions & 1 deletion patches/ds-bot/0008-client-bundle.patch
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ diff --git a/client.js b/client.js
Connected: "已连接",
Disconnect: "断开",
Connect: "连接",
@@ -141,17 +141,64 @@ var ZH = {
@@ -141,17 +141,73 @@ var ZH = {
"GitHub addresses must start with https://": "GitHub 地址必须以 https:// 开头",
"This DSH cannot load connectors": "这个 DSH 不能加载连接器",
"No such connector": "没有这个连接器",
Expand Down Expand Up @@ -385,6 +385,15 @@ diff --git a/client.js b/client.js
- "DS Bot": "DS Bot",
+ "FlyBot": "FlyBot",
+ "FlyBot core": "FlyBot 核心",
+ // Social's two notice cards (#3114): the share request and the accepted invite read in the
+ // window's language. `Dismiss` and `your Bot` already carry their Chinese above.
+ "A friend": "一位好友",
+ "{name} accepted your invite. They can message {bot}. You cannot message them until they share a Bot with you.": "{name} 接受了你的邀请,可以给 {bot} 发消息。在对方分享一个 Bot 给你之前,你还不能给对方发消息。",
+ "You asked them to share a Bot.": "你已经请对方分享一个 Bot。",
+ "Ask them to share a Bot": "请对方分享一个 Bot",
+ "{name} tried to start a chat with {bot}. {bot} is not shared with them.": "{name} 想和 {bot} 开始聊天,但 {bot} 没有分享给对方。",
+ "Open {bot}'s Sharing": "打开 {bot} 的分享",
+ "Share {bot}…": "分享 {bot}…",
// Header
"Message {name}": "给 {name} 发消息",
Message: "发消息",
Expand Down
3 changes: 0 additions & 3 deletions patches/ds-bot/files/test/i18n-missing-entries.baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"plugins/social/client.js:Accept an invite",
"plugins/social/client.js:Anyone with the link can join while the room is open.",
"plugins/social/client.js:Anyone with the number can still join.",
"plugins/social/client.js:Ask them to share a Bot",
"plugins/social/client.js:Auto-send",
"plugins/social/client.js:Auto-send off",
"plugins/social/client.js:Auto-send on",
Expand Down Expand Up @@ -101,15 +100,13 @@
"plugins/social/client.js:Who has joined#1",
"plugins/social/client.js:Who has joined#2",
"plugins/social/client.js:You already joined with that link using other Bots. Leave the group first to join with different ones.",
"plugins/social/client.js:You asked them to share a Bot.",
"plugins/social/client.js:Your friend gets this Bot only.",
"plugins/social/client.js:Your own Bots stay shared. {} can share it again.",
"plugins/social/client.js:mine#1",
"plugins/social/client.js:mine#2",
"plugins/social/client.js:the group",
"plugins/social/client.js:the room",
"plugins/social/client.js:{} (you)",
"plugins/social/client.js:{} accepted your invite. They can message {}. You cannot message them until they share a Bot with you.",
"plugins/social/client.js:{} is now a friend.",
"plugins/social/client.js:{} shared {} with you.{}",
"plugins/social/client.js:{} stays a friend: still shared through {}.",
Expand Down
2 changes: 0 additions & 2 deletions patches/ds-bot/files/test/i18n-plugins.baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
"plugins/social/client.js:Copied#2",
"plugins/social/client.js:Copy",
"plugins/social/client.js:Copy link",
"plugins/social/client.js:Dismiss#1",
"plugins/social/client.js:Dismiss#2",
"plugins/social/client.js:New link",
"plugins/social/client.js:Your Bot Social handle",
"plugins/social/client.js:Your Bots",
Expand Down
3 changes: 0 additions & 3 deletions patches/ds-bot/files/test/i18n-template-draws.baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
"plugins/social/client.js:Invite grants {} only. Revoke anytime in People with access.",
"plugins/social/client.js:Invite link for {}",
"plugins/social/client.js:One click shares {} with someone you already know. No invite link. They can decline; you can Revoke in People with access.",
"plugins/social/client.js:Open {}'s Sharing",
"plugins/social/client.js:QR code for room number {}",
"plugins/social/client.js:Remove {} from your list? {}",
"plugins/social/client.js:Revoke {}#1",
Expand All @@ -20,13 +19,11 @@
"plugins/social/client.js:Scanned {}.",
"plugins/social/client.js:Scanned {}. Pick a Bot to join.",
"plugins/social/client.js:Share {} with {}",
"plugins/social/client.js:Share {}…",
"plugins/social/client.js:Waiting for {} to let you in. If the group does not appear, press Join group to ask again.",
"plugins/social/client.js:You are {}",
"plugins/social/client.js:Your Bots' replies to {} go out without asking you first. What you type is not affected.",
"plugins/social/client.js:{} Send your message again: it starts a new chat.",
"plugins/social/client.js:{} failed: {}",
"plugins/social/client.js:{} tried to start a chat with {}. {} is not shared with them.",
"plugins/social/client.js:{}'s replies to {} go out without asking you first.#1",
"plugins/social/client.js:{}'s replies to {} go out without asking you first.#2",
"plugins/timeline/client.js:Could not copy the report: {}",
Expand Down
22 changes: 11 additions & 11 deletions plugins/social/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -3312,26 +3312,26 @@ window.__ModuleLoader__.load({
// Someone accepted an invite to one of my Bots (#1054). One-way stays; this card is the inviter's
// feedback and the one step that asks them to share a Bot back. Asking does not grant anything.
function acceptNoticeSentence(item) {
const who = item?.owner ? `${item.name} (${item.owner})` : (item?.name || 'A friend')
const bot = item?.botName || 'your Bot'
return `${who} accepted your invite. They can message ${bot}. You cannot message them until they share a Bot with you.`
const who = item?.owner ? `${item.name} (${item.owner})` : (item?.name || tr('A friend'))
const bot = item?.botName || tr('your Bot')
return tr('{name} accepted your invite. They can message {bot}. You cannot message them until they share a Bot with you.', { name: who, bot })
}
function AcceptNotices({ items, onAsk, onDismiss, locked = false } = {}) {
if (!Array.isArray(items) || items.length === 0) return null
return h('div', { className: 'fs-share-requests', 'data-flybot': 'accept-notices' },
items.map((item) => h('div', { key: item.id, className: 'fs-card fs-share-request', role: 'status', 'data-flybot': 'accept-notice' },
h('div', { className: 'fs-hint', 'data-flybot': 'accept-notice-text' }, acceptNoticeSentence(item)),
item.asked ? h('div', { className: 'fs-hint', 'data-flybot': 'accept-notice-asked' }, 'You asked them to share a Bot.') : null,
item.asked ? h('div', { className: 'fs-hint', 'data-flybot': 'accept-notice-asked' }, tr('You asked them to share a Bot.')) : null,
// #2219: asking and dismissing are writes; a read-only window still reads the notice.
locked ? null : h('div', { className: 'fs-line' },
h('button', { type: 'button', className: 'fs-btn fs-btn-sm', 'data-flybot': 'accept-notice-dismiss', onClick: () => onDismiss?.(item) }, 'Dismiss'),
h('button', { type: 'button', className: 'fs-btn fs-btn-sm', 'data-flybot': 'accept-notice-dismiss', onClick: () => onDismiss?.(item) }, tr('Dismiss')),
h('button', {
type: 'button',
className: 'fs-btn fs-btn-sm fs-btn-primary',
'data-flybot': 'accept-notice-ask',
disabled: item.asked === true,
onClick: () => { if (!item.asked) onAsk?.(item) },
}, 'Ask them to share a Bot')))))
}, tr('Ask them to share a Bot'))))))
}

// "Share this Bot?" (#336): a friend's Bot tried to start a chat with one of my Bots that is not
Expand All @@ -3342,20 +3342,20 @@ window.__ModuleLoader__.load({
return h('div', { className: 'fs-share-requests', 'data-flybot': 'share-requests' },
items.map((item) => {
const who = item.owner ? `${item.name} (${item.owner})` : item.name
const bot = item.botName || 'your Bot'
const bot = item.botName || tr('your Bot')
return h('div', { key: item.id, className: 'fs-card fs-share-request', role: 'status', 'data-flybot': 'share-request' },
h('div', { className: 'fs-hint', 'data-flybot': 'share-request-text' }, `${who} tried to start a chat with ${bot}. ${bot} is not shared with them.`),
h('div', { className: 'fs-hint', 'data-flybot': 'share-request-text' }, tr('{name} tried to start a chat with {bot}. {bot} is not shared with them.', { name: who, bot })),
h('div', { className: 'fs-line' },
// #2219: dismissing is a write; opening the Sharing page is navigation and stays.
locked ? null : h('button', { type: 'button', className: 'fs-btn fs-btn-sm', 'data-flybot': 'share-request-dismiss', onClick: () => onDismiss?.(item) }, 'Dismiss'),
locked ? null : h('button', { type: 'button', className: 'fs-btn fs-btn-sm', 'data-flybot': 'share-request-dismiss', onClick: () => onDismiss?.(item) }, tr('Dismiss')),
h('button', {
type: 'button',
className: 'fs-btn fs-btn-sm fs-btn-primary',
'data-flybot': 'share-request-open',
title: `Open ${bot}'s Sharing`,
title: tr("Open {bot}'s Sharing", { bot }),
disabled: typeof actions?.openSettings !== 'function',
onClick: () => actions.openSettings('bots', item.botId),
}, `Share ${bot}…`)))
}, tr('Share {bot}…', { bot }))))
}))
}

Expand Down
Loading
Loading