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-friend-settings-zh.changed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
A friend's Bot settings now read in the window's language: its Auto-send box and hint, the Remove this Bot link with its busy label and tooltip, and the inline remove question no longer draw bare English in a Chinese window ([#3114](https://github.com/ThinkFlowLab/FlyBot/issues/3114)).
11 changes: 11 additions & 0 deletions core/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,17 @@ var ZH = {
"That Bot was removed from that home.": "那个 Bot 已从对方那里移除。",
"Messages waiting for your approval": "等你批准的消息",
"Waiting for approval": "等待批准",
// #3114 cut 23: a friend's Bot settings card — its Auto-send box and hint, the Remove this Bot
// link with its busy label and tooltip, and the inline remove question that ends on the roster.
"Auto-send my Bots' replies to {who}": "我的 Bot 发给 {who} 的回复自动发送",
"Your Bots' replies to {who} go out without asking you first. What you type is not affected.": "你的 Bot 发给 {who} 的回复不再先问你。你输入的内容不受影响。",
"Remove this Bot": "移除这个 Bot",
"Removing…": "正在移除…",
"Remove this Bot from your list and from your groups. This does not unfriend the owner.": "把这个 Bot 从你的列表和群聊中移除。这不会解除与主人的好友关系。",
"Remove {bot} from your list? {note}": "把 {bot} 从你的列表中移除吗?{note}",
"{who} stays a friend: still shared through {bots}.": "{who} 仍是好友:仍通过 {bots} 共享。",
"Your own Bots stay shared. {who} can share it again.": "你自己的 Bot 仍然保持共享。{who} 可以再次分享它。",
"Don't ask each time.": "不要每次都问。",
// #3032: the four approval-card controls that were still drawn as bare English.
"Waiting for the owner's approval": "等待 owner 批准",
"Auto-send from now on": "以后自动发送",
Expand Down
11 changes: 11 additions & 0 deletions core/src/client/i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,17 @@ const ZH = {
'That Bot was removed from that home.': '那个 Bot 已从对方那里移除。',
'Messages waiting for your approval': '等你批准的消息',
'Waiting for approval': '等待批准',
// #3114 cut 23: a friend's Bot settings card — its Auto-send box and hint, the Remove this Bot
// link with its busy label and tooltip, and the inline remove question that ends on the roster.
"Auto-send my Bots' replies to {who}": '我的 Bot 发给 {who} 的回复自动发送',
"Your Bots' replies to {who} go out without asking you first. What you type is not affected.": '你的 Bot 发给 {who} 的回复不再先问你。你输入的内容不受影响。',
'Remove this Bot': '移除这个 Bot',
'Removing…': '正在移除…',
'Remove this Bot from your list and from your groups. This does not unfriend the owner.': '把这个 Bot 从你的列表和群聊中移除。这不会解除与主人的好友关系。',
'Remove {bot} from your list? {note}': '把 {bot} 从你的列表中移除吗?{note}',
'{who} stays a friend: still shared through {bots}.': '{who} 仍是好友:仍通过 {bots} 共享。',
'Your own Bots stay shared. {who} can share it again.': '你自己的 Bot 仍然保持共享。{who} 可以再次分享它。',
"Don't ask each time.": '不要每次都问。',
// #3032: the four approval-card controls that were still drawn as bare English.
"Waiting for the owner's approval": '等待 owner 批准',
'Auto-send from now on': '以后自动发送',
Expand Down
8 changes: 0 additions & 8 deletions core/test/i18n-missing-entries.baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
"plugins/social/client.js:Chat paused",
"plugins/social/client.js:Choose which of your Bots join.",
"plugins/social/client.js:Could not reach FlyBot. Check that it is still running.",
"plugins/social/client.js:Don't ask each time.#1",
"plugins/social/client.js:Don't ask each time.#2",
"plugins/social/client.js:Enter a 6-digit number.",
"plugins/social/client.js:FlyBot cannot use the camera. Allow the camera for this page, or type the 6-digit number instead.",
"plugins/social/client.js:In use in {} room{}: ",
Expand All @@ -25,10 +23,6 @@
"plugins/social/client.js:Point the camera at a FlyBot room code.",
"plugins/social/client.js:QR code for this room invite",
"plugins/social/client.js:Remove this Bot from Friends' Bots and from your groups. This does not unfriend the owner.",
"plugins/social/client.js:Remove this Bot from your list and from your groups. This does not unfriend the owner.",
"plugins/social/client.js:Remove this Bot#1",
"plugins/social/client.js:Remove this Bot#2",
"plugins/social/client.js:Removing…",
"plugins/social/client.js:Scan to open this room",
"plugins/social/client.js:Scanned a group link.",
"plugins/social/client.js:Scanned an invite link.",
Expand All @@ -53,10 +47,8 @@
"plugins/social/client.js:This room only: ",
"plugins/social/client.js:Too many tries for now. Wait a minute and try again.",
"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:Your own Bots stay shared. {} can share it again.",
"plugins/social/client.js:the group",
"plugins/social/client.js:the room",
"plugins/social/client.js:{} stays a friend: still shared through {}.",
"plugins/timeline/client.js:Communication map: who sent requests to whom",
"plugins/timeline/client.js:Copy report",
"plugins/timeline/client.js:Copy this window as a Markdown report",
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 @@ -2,16 +2,13 @@
"version": 1,
"entries": [
"plugins/social/client.js:Asked to join {}. It opens in your sidebar as soon as their FlyBot seats your Bots.",
"plugins/social/client.js:Auto-send my Bots' replies to {}",
"plugins/social/client.js:Auto-send {} → room",
"plugins/social/client.js:Auto-send {}'s room messages",
"plugins/social/client.js:Invite grants {} only.",
"plugins/social/client.js:Invite grants {} only. Revoke anytime in People with access.",
"plugins/social/client.js:Remove {} from your list? {}",
"plugins/social/client.js:Scanned {}.",
"plugins/social/client.js:Scanned {}. Pick a Bot to join.",
"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: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/timeline/client.js:Could not copy the report: {}",
"plugins/timeline/client.js:Last {}",
Expand Down
13 changes: 12 additions & 1 deletion patches/ds-bot/0001-core-fixes.patch
Original file line number Diff line number Diff line change
Expand Up @@ -895,7 +895,7 @@ diff --git a/src/client/i18n.js b/src/client/i18n.js
Content: '内容',
'Referenced {labels}': '引用了 {labels}',
', ': '、',
@@ -41,22 +41,147 @@ const ZH = {
@@ -41,22 +41,158 @@ const ZH = {
' and ': '、',
and: '和',
'{count} members': '{count} 位成员',
Expand Down Expand Up @@ -999,6 +999,17 @@ diff --git a/src/client/i18n.js b/src/client/i18n.js
+ 'That Bot was removed from that home.': '那个 Bot 已从对方那里移除。',
+ 'Messages waiting for your approval': '等你批准的消息',
+ 'Waiting for approval': '等待批准',
+ // #3114 cut 23: a friend's Bot settings card — its Auto-send box and hint, the Remove this Bot
+ // link with its busy label and tooltip, and the inline remove question that ends on the roster.
+ "Auto-send my Bots' replies to {who}": '我的 Bot 发给 {who} 的回复自动发送',
+ "Your Bots' replies to {who} go out without asking you first. What you type is not affected.": '你的 Bot 发给 {who} 的回复不再先问你。你输入的内容不受影响。',
+ 'Remove this Bot': '移除这个 Bot',
+ 'Removing…': '正在移除…',
+ 'Remove this Bot from your list and from your groups. This does not unfriend the owner.': '把这个 Bot 从你的列表和群聊中移除。这不会解除与主人的好友关系。',
+ 'Remove {bot} from your list? {note}': '把 {bot} 从你的列表中移除吗?{note}',
+ '{who} stays a friend: still shared through {bots}.': '{who} 仍是好友:仍通过 {bots} 共享。',
+ 'Your own Bots stay shared. {who} can share it again.': '你自己的 Bot 仍然保持共享。{who} 可以再次分享它。',
+ "Don't ask each time.": '不要每次都问。',
+ // #3032: the four approval-card controls that were still drawn as bare English.
+ "Waiting for the owner's approval": '等待 owner 批准',
+ 'Auto-send from now on': '以后自动发送',
Expand Down
13 changes: 12 additions & 1 deletion patches/ds-bot/0008-client-bundle.patch
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ diff --git a/client.js b/client.js
Content: "内容",
"Referenced {labels}": "引用了 {labels}",
", ": "、",
@@ -78,21 +78,146 @@ var ZH = {
@@ -78,21 +78,157 @@ var ZH = {
" and ": "、",
and: "和",
"{count} members": "{count} 位成员",
Expand Down Expand Up @@ -263,6 +263,17 @@ diff --git a/client.js b/client.js
+ "That Bot was removed from that home.": "那个 Bot 已从对方那里移除。",
+ "Messages waiting for your approval": "等你批准的消息",
+ "Waiting for approval": "等待批准",
+ // #3114 cut 23: a friend's Bot settings card — its Auto-send box and hint, the Remove this Bot
+ // link with its busy label and tooltip, and the inline remove question that ends on the roster.
+ "Auto-send my Bots' replies to {who}": "我的 Bot 发给 {who} 的回复自动发送",
+ "Your Bots' replies to {who} go out without asking you first. What you type is not affected.": "你的 Bot 发给 {who} 的回复不再先问你。你输入的内容不受影响。",
+ "Remove this Bot": "移除这个 Bot",
+ "Removing…": "正在移除…",
+ "Remove this Bot from your list and from your groups. This does not unfriend the owner.": "把这个 Bot 从你的列表和群聊中移除。这不会解除与主人的好友关系。",
+ "Remove {bot} from your list? {note}": "把 {bot} 从你的列表中移除吗?{note}",
+ "{who} stays a friend: still shared through {bots}.": "{who} 仍是好友:仍通过 {bots} 共享。",
+ "Your own Bots stay shared. {who} can share it again.": "你自己的 Bot 仍然保持共享。{who} 可以再次分享它。",
+ "Don't ask each time.": "不要每次都问。",
+ // #3032: the four approval-card controls that were still drawn as bare English.
+ "Waiting for the owner's approval": "等待 owner 批准",
+ "Auto-send from now on": "以后自动发送",
Expand Down
8 changes: 0 additions & 8 deletions patches/ds-bot/files/test/i18n-missing-entries.baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
"plugins/social/client.js:Chat paused",
"plugins/social/client.js:Choose which of your Bots join.",
"plugins/social/client.js:Could not reach FlyBot. Check that it is still running.",
"plugins/social/client.js:Don't ask each time.#1",
"plugins/social/client.js:Don't ask each time.#2",
"plugins/social/client.js:Enter a 6-digit number.",
"plugins/social/client.js:FlyBot cannot use the camera. Allow the camera for this page, or type the 6-digit number instead.",
"plugins/social/client.js:In use in {} room{}: ",
Expand All @@ -25,10 +23,6 @@
"plugins/social/client.js:Point the camera at a FlyBot room code.",
"plugins/social/client.js:QR code for this room invite",
"plugins/social/client.js:Remove this Bot from Friends' Bots and from your groups. This does not unfriend the owner.",
"plugins/social/client.js:Remove this Bot from your list and from your groups. This does not unfriend the owner.",
"plugins/social/client.js:Remove this Bot#1",
"plugins/social/client.js:Remove this Bot#2",
"plugins/social/client.js:Removing…",
"plugins/social/client.js:Scan to open this room",
"plugins/social/client.js:Scanned a group link.",
"plugins/social/client.js:Scanned an invite link.",
Expand All @@ -53,10 +47,8 @@
"plugins/social/client.js:This room only: ",
"plugins/social/client.js:Too many tries for now. Wait a minute and try again.",
"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:Your own Bots stay shared. {} can share it again.",
"plugins/social/client.js:the group",
"plugins/social/client.js:the room",
"plugins/social/client.js:{} stays a friend: still shared through {}.",
"plugins/timeline/client.js:Communication map: who sent requests to whom",
"plugins/timeline/client.js:Copy report",
"plugins/timeline/client.js:Copy this window as a Markdown report",
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 @@ -2,16 +2,13 @@
"version": 1,
"entries": [
"plugins/social/client.js:Asked to join {}. It opens in your sidebar as soon as their FlyBot seats your Bots.",
"plugins/social/client.js:Auto-send my Bots' replies to {}",
"plugins/social/client.js:Auto-send {} → room",
"plugins/social/client.js:Auto-send {}'s room messages",
"plugins/social/client.js:Invite grants {} only.",
"plugins/social/client.js:Invite grants {} only. Revoke anytime in People with access.",
"plugins/social/client.js:Remove {} from your list? {}",
"plugins/social/client.js:Scanned {}.",
"plugins/social/client.js:Scanned {}. Pick a Bot to join.",
"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: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/timeline/client.js:Could not copy the report: {}",
"plugins/timeline/client.js:Last {}",
Expand Down
26 changes: 13 additions & 13 deletions plugins/social/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ window.__ModuleLoader__.load({
const AUTO_SEND_NOTE = "Don't ask each time."

function FaceAutoSend({ on, busy, onChange, bot } = {}) {
return h('label', { className: 'fs-auto fs-face-auto', title: AUTO_SEND_NOTE, 'data-flybot': 'face-auto-bot' },
return h('label', { className: 'fs-auto fs-face-auto', title: tr(AUTO_SEND_NOTE), 'data-flybot': 'face-auto-bot' },
h('input', {
type: 'checkbox',
checked: on === true,
Expand Down Expand Up @@ -2890,7 +2890,7 @@ window.__ModuleLoader__.load({

function FriendBotRow({ bot, chat, renderBot, busy, onRemove }) {
const [menu, setMenu] = useState(false)
const label = busy ? 'Removing…' : 'Remove this Bot'
const label = busy ? tr('Removing…') : tr('Remove this Bot')
return h('div', {
className: 'fs-row-wrap',
'data-flybot': 'friend-bot',
Expand All @@ -2913,7 +2913,7 @@ window.__ModuleLoader__.load({
onClick: (event) => { event?.stopPropagation?.(); onRemove?.(bot) },
}, busy ? '…' : '×'),
menu ? h('div', { className: 'fs-menu', role: 'menu', 'data-flybot': 'friend-bot-menu' },
h('button', { type: 'button', role: 'menuitem', onClick: () => { setMenu(false); onRemove?.(bot) } }, 'Remove this Bot')) : null)
h('button', { type: 'button', role: 'menuitem', onClick: () => { setMenu(false); onRemove?.(bot) } }, tr('Remove this Bot'))) : null)
}

// Every home counts down to Bot Social's one deadline (#458): `offsetMs` is how far the server's
Expand Down Expand Up @@ -3757,7 +3757,7 @@ window.__ModuleLoader__.load({
} finally { setSaving(false) }
}
const named = remote.homeName || remote.owner || ''
const who = named || home || 'Your friend'
const who = named || home || tr('Your friend')
// #1001: a friend stays in the list while any of their Bots is still shared with any of mine, so
// removing this one leaves the friend behind with no reason given. Name the link that keeps them:
// the other Bots of the same friend the roster still lists. With none, there is nothing to name and
Expand All @@ -3767,8 +3767,8 @@ window.__ModuleLoader__.load({
.map(other => String(other.name ?? '').trim())
.filter(name => name !== '')
const keepLine = stillLinked.length > 0
? `${who} stays a friend: still shared through ${stillLinked.join(', ')}.`
: `Your own Bots stay shared. ${who} can share it again.`
? tr('{who} stays a friend: still shared through {bots}.', { who, bots: stillLinked.join(', ') })
: tr('Your own Bots stay shared. {who} can share it again.', { who })
// Asked inline, like Leave on a face room (#230), not with the browser's confirm box.
const removeBot = async () => {
setAsking(false)
Expand All @@ -3786,25 +3786,25 @@ window.__ModuleLoader__.load({
// Auto-send for all my Bots to this person (#417 says what it covers; one Bot's own is in its Sharing).
// The box holds the setting only; the destructive link sits apart, below it (#274).
h('div', { className: 'fs-card fs-friend-auto', 'data-flybot': 'friend-auto-box' },
h('label', { className: 'fs-auto', title: AUTO_SEND_NOTE, 'data-flybot': 'friend-auto-send' },
h('label', { className: 'fs-auto', title: tr(AUTO_SEND_NOTE), 'data-flybot': 'friend-auto-send' },
h('input', { type: 'checkbox', checked: auto === true, disabled: saving || !home, onChange: e => toggleAuto(e.target.checked) }),
`Auto-send my Bots' replies to ${who}`),
h('div', { className: 'fs-hint', 'data-flybot': 'friend-auto-hint' }, `Your Bots' replies to ${who} go out without asking you first. What you type is not affected.`)),
tr("Auto-send my Bots' replies to {who}", { who })),
h('div', { className: 'fs-hint', 'data-flybot': 'friend-auto-hint' }, tr("Your Bots' replies to {who} go out without asking you first. What you type is not affected.", { who }))),
h('div', { className: 'fs-friend-remove', 'data-flybot': 'friend-remove-row' }, asking
? h('span', { className: 'fs-leave-ask', 'data-flybot': 'remove-friend-bot-confirm' },
h('span', { className: 'fs-hint' }, `Remove ${botWithOwner(bot.name, named)} from your list? ${keepLine}`),
h('span', { className: 'fs-hint' }, tr('Remove {bot} from your list? {note}', { bot: botWithOwner(bot.name, named), note: keepLine })),
h('button', { type: 'button', className: 'fs-btn fs-btn-sm', 'data-flybot': 'remove-friend-bot-yes', onClick: () => { void removeBot() } }, tr('Remove')),
h('button', { type: 'button', className: 'fs-btn fs-btn-sm', 'data-flybot': 'remove-friend-bot-no', onClick: () => setAsking(false) }, tr('Keep')))
: h('button', {
type: 'button',
className: 'fs-link',
'data-flybot': 'remove-friend-bot',
title: 'Remove this Bot from your list and from your groups. This does not unfriend the owner.',
'aria-label': busy ? 'Removing…' : 'Remove this Bot',
title: tr('Remove this Bot from your list and from your groups. This does not unfriend the owner.'),
'aria-label': busy ? tr('Removing…') : tr('Remove this Bot'),
'aria-busy': busy || undefined,
disabled: !!busy,
onClick: () => setAsking(true),
}, busy ? 'Removing…' : 'Remove this Bot')),
}, busy ? tr('Removing…') : tr('Remove this Bot'))),
error ? h('div', { className: 'fs-status', 'data-tone': 'error', role: 'status' }, error) : null)
}

Expand Down
2 changes: 1 addition & 1 deletion plugins/social/test/add-friend-i18n.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ test('#3114 cut 22: the baselines lose these draws and the dictionary gains the
assert.deepEqual(still, [], `${file.replace('.baseline.json', '')} still pins ${still[0]}`)
}
// The three baselines shrink by exactly these draws and nothing else does: the ratchet's numbers.
assert.deepEqual([entriesOf('i18n-plugins.baseline.json').length, entriesOf('i18n-template-draws.baseline.json').length, entriesOf('i18n-missing-entries.baseline.json').length], [14, 21, 94])
assert.deepEqual([entriesOf('i18n-plugins.baseline.json').length, entriesOf('i18n-template-draws.baseline.json').length, entriesOf('i18n-missing-entries.baseline.json').length], [14, 18, 86])
// Every new key is the dictionary's, and each answers with Chinese.
for (const key of [
'Accept an invite', 'Invite a friend', 'Paste invite link or code',
Expand Down
Loading
Loading