Skip to content

Your Android phone and your Windows PC, working as one. Local-first, end-to-end encrypted, no account.

Timeline: translate where each entry came from or went

Beeba4de4cd6138
diff --git a/desktop/app/i18n/nectarlink_zh_CN.ts b/desktop/app/i18n/nectarlink_zh_CN.ts
index 14abf60..efffa92 100644
--- a/desktop/app/i18n/nectarlink_zh_CN.ts
+++ b/desktop/app/i18n/nectarlink_zh_CN.ts
@@ -4165,6 +4165,7 @@
</message>
<message>
<location filename="../qml/MirrorWindow.qml" line="376"/>
+ <location filename="../qml/MirrorWindow.qml" line="403"/>
<source>Play the phone&apos;s sound here</source>
<translation>在本机播放手机声音</translation>
</message>
@@ -4174,77 +4175,77 @@
<translation>在本机静音手机声音</translation>
</message>
<message>
- <location filename="../qml/MirrorWindow.qml" line="386"/>
+ <location filename="../qml/MirrorWindow.qml" line="412"/>
<source>Release to send files to %1</source>
<translation>松开即可发送文件到 %1</translation>
</message>
<message>
- <location filename="../qml/MirrorWindow.qml" line="386"/>
+ <location filename="../qml/MirrorWindow.qml" line="412"/>
<source>phone</source>
<translation>手机</translation>
</message>
<message>
- <location filename="../qml/MirrorWindow.qml" line="454"/>
+ <location filename="../qml/MirrorWindow.qml" line="480"/>
<source>To control the phone, turn on Control from your PC in NectarLink&apos;s settings on the phone.</source>
<translation>要控制手机,请在手机上的 NectarLink 设置中开启“从电脑控制”。</translation>
</message>
<message>
- <location filename="../qml/MirrorWindow.qml" line="463"/>
+ <location filename="../qml/MirrorWindow.qml" line="489"/>
<source>Notify phone</source>
<translation>通知手机</translation>
</message>
<message>
- <location filename="../qml/MirrorWindow.qml" line="474"/>
+ <location filename="../qml/MirrorWindow.qml" line="500"/>
<source>Hide</source>
<translation>隐藏</translation>
</message>
<message>
- <location filename="../qml/MirrorWindow.qml" line="512"/>
+ <location filename="../qml/MirrorWindow.qml" line="538"/>
<source>Opening %1</source>
<translation>正在打开 %1</translation>
</message>
<message>
- <location filename="../qml/MirrorWindow.qml" line="512"/>
+ <location filename="../qml/MirrorWindow.qml" line="538"/>
<source>Allow it on your phone</source>
<translation>请在手机上允许</translation>
</message>
<message>
- <location filename="../qml/MirrorWindow.qml" line="513"/>
+ <location filename="../qml/MirrorWindow.qml" line="539"/>
<source>%1 closed</source>
<translation>%1 已关闭</translation>
</message>
<message>
- <location filename="../qml/MirrorWindow.qml" line="513"/>
+ <location filename="../qml/MirrorWindow.qml" line="539"/>
<source>Mirroring stopped</source>
<translation>投屏已停止</translation>
</message>
<message>
- <location filename="../qml/MirrorWindow.qml" line="514"/>
+ <location filename="../qml/MirrorWindow.qml" line="540"/>
<source>Starting…</source>
<translation>正在启动…</translation>
</message>
<message>
- <location filename="../qml/MirrorWindow.qml" line="523"/>
+ <location filename="../qml/MirrorWindow.qml" line="549"/>
<source>Tap the notification on %1, then choose to share the entire screen.</source>
<translation>点击 %1 上的通知,然后选择共享整个屏幕。</translation>
</message>
<message>
- <location filename="../qml/MirrorWindow.qml" line="525"/>
+ <location filename="../qml/MirrorWindow.qml" line="551"/>
<source>The app closed on %1.</source>
<translation>%1 上的应用已关闭。</translation>
</message>
<message>
- <location filename="../qml/MirrorWindow.qml" line="526"/>
+ <location filename="../qml/MirrorWindow.qml" line="552"/>
<source>The phone stopped sharing its screen.</source>
<translation>手机已停止共享屏幕。</translation>
</message>
<message>
- <location filename="../qml/MirrorWindow.qml" line="533"/>
+ <location filename="../qml/MirrorWindow.qml" line="559"/>
<source>Open again</source>
<translation>重新打开</translation>
</message>
<message>
- <location filename="../qml/MirrorWindow.qml" line="533"/>
+ <location filename="../qml/MirrorWindow.qml" line="559"/>
<source>Try again</source>
<translation>重试</translation>
</message>
@@ -6918,79 +6919,119 @@
</message>
<message>
<location filename="rust_strings.h" line="326"/>
+ <source>From %1</source>
+ <translation>来自 %1</translation>
+ </message>
+ <message>
+ <location filename="rust_strings.h" line="327"/>
<source>In progress</source>
<translation>进行中</translation>
</message>
<message>
- <location filename="rust_strings.h" line="327"/>
+ <location filename="rust_strings.h" line="328"/>
<source>No phone is paired yet.</source>
<translation>尚未配对手机。</translation>
</message>
<message>
- <location filename="rust_strings.h" line="328"/>
+ <location filename="rust_strings.h" line="329"/>
+ <source>Opened from %1</source>
+ <translation>从 %1 打开</translation>
+ </message>
+ <message>
+ <location filename="rust_strings.h" line="330"/>
+ <source>Opened on %1</source>
+ <translation>在 %1 上打开</translation>
+ </message>
+ <message>
+ <location filename="rust_strings.h" line="331"/>
<source>Phone microphone</source>
<translation>手机麦克风</translation>
</message>
<message>
- <location filename="rust_strings.h" line="329"/>
+ <location filename="rust_strings.h" line="332"/>
<source>Phone webcam</source>
<translation>手机摄像头</translation>
</message>
<message>
- <location filename="rust_strings.h" line="330"/>
+ <location filename="rust_strings.h" line="333"/>
+ <source>Recorded on %1</source>
+ <translation>在 %1 上录制</translation>
+ </message>
+ <message>
+ <location filename="rust_strings.h" line="334"/>
+ <source>Saved from %1</source>
+ <translation>从 %1 保存</translation>
+ </message>
+ <message>
+ <location filename="rust_strings.h" line="335"/>
<source>Screen mirroring</source>
<translation>屏幕镜像</translation>
</message>
<message>
- <location filename="rust_strings.h" line="331"/>
+ <location filename="rust_strings.h" line="336"/>
<source>Sending to %1…</source>
<translation>正在发送到 %1…</translation>
</message>
<message>
- <location filename="rust_strings.h" line="332"/>
+ <location filename="rust_strings.h" line="337"/>
<source>Sent clip to %1.</source>
<translation>已将剪贴内容发送到 %1。</translation>
</message>
<message>
- <location filename="rust_strings.h" line="333"/>
+ <location filename="rust_strings.h" line="338"/>
+ <source>Sent to %1</source>
+ <translation>已发送到 %1</translation>
+ </message>
+ <message>
+ <location filename="rust_strings.h" line="339"/>
<source>That clip is no longer in clipboard history.</source>
<translation>该剪贴内容已不在剪贴板历史中。</translation>
</message>
<message>
- <location filename="rust_strings.h" line="334"/>
+ <location filename="rust_strings.h" line="340"/>
<source>That entry couldn&apos;t be removed. Try again.</source>
<translation>无法删除该条目,请重试。</translation>
</message>
<message>
- <location filename="rust_strings.h" line="335"/>
+ <location filename="rust_strings.h" line="341"/>
<source>That file was moved or deleted.</source>
<translation>该文件已被移动或删除。</translation>
</message>
<message>
- <location filename="rust_strings.h" line="336"/>
+ <location filename="rust_strings.h" line="342"/>
<source>That isn&apos;t a web link.</source>
<translation>这不是网页链接。</translation>
</message>
<message>
- <location filename="rust_strings.h" line="337"/>
+ <location filename="rust_strings.h" line="343"/>
<source>That photo was moved or deleted.</source>
<translation>该照片已被移动或删除。</translation>
</message>
<message>
- <location filename="rust_strings.h" line="338"/>
+ <location filename="rust_strings.h" line="344"/>
<source>The Timeline couldn&apos;t be cleared. Try again.</source>
<translation>无法清除时间线,请重试。</translation>
</message>
<message>
- <location filename="rust_strings.h" line="339"/>
+ <location filename="rust_strings.h" line="345"/>
<source>The photo couldn&apos;t be copied to the clipboard.</source>
<translation>无法将照片复制到剪贴板。</translation>
</message>
<message>
- <location filename="rust_strings.h" line="340"/>
+ <location filename="rust_strings.h" line="346"/>
<source>Voice recording</source>
<translation>录音</translation>
</message>
+ <message>
+ <location filename="rust_strings.h" line="347"/>
+ <source>With %1</source>
+ <translation>与 %1</translation>
+ </message>
+ <message>
+ <location filename="rust_strings.h" line="348"/>
+ <source>device</source>
+ <translation>设备</translation>
+ </message>
</context>
<context>
<name>TimelinePage</name>
@@ -7279,37 +7320,37 @@
<context>
<name>Transfers</name>
<message>
- <location filename="rust_strings.h" line="341"/>
+ <location filename="rust_strings.h" line="349"/>
<source>Accept in NectarLink to save to Downloads\Nectarlink</source>
<translation>在 NectarLink 中接受即可保存到 Downloads\Nectarlink</translation>
</message>
<message>
- <location filename="rust_strings.h" line="342"/>
+ <location filename="rust_strings.h" line="350"/>
<source>Files are turned off for that device.</source>
<translation>已为该设备关闭文件。</translation>
</message>
<message>
- <location filename="rust_strings.h" line="343"/>
+ <location filename="rust_strings.h" line="351"/>
<source>From %1, opened from Downloads\Nectarlink</source>
<translation>来自 %1,已从 Downloads\Nectarlink 打开</translation>
</message>
<message>
- <location filename="rust_strings.h" line="344"/>
+ <location filename="rust_strings.h" line="352"/>
<source>From %1, saved in Downloads\Nectarlink</source>
<translation>来自 %1,已保存到 Downloads\Nectarlink</translation>
</message>
<message>
- <location filename="rust_strings.h" line="345"/>
+ <location filename="rust_strings.h" line="353"/>
<source>Nearby device</source>
<translation>附近的设备</translation>
</message>
<message>
- <location filename="rust_strings.h" line="346"/>
+ <location filename="rust_strings.h" line="354"/>
<source>That&apos;s too many files to send at once.</source>
<translation>文件太多,无法一次发送。</translation>
</message>
<message>
- <location filename="rust_strings.h" line="347"/>
+ <location filename="rust_strings.h" line="355"/>
<source>There&apos;s nothing to send in there.</source>
<translation>那里没有可发送的内容。</translation>
</message>
@@ -7317,67 +7358,67 @@
<context>
<name>Updater</name>
<message>
- <location filename="rust_strings.h" line="348"/>
+ <location filename="rust_strings.h" line="356"/>
<source>Couldn&apos;t check for updates. Check your internet connection.</source>
<translation>无法检查更新。请检查网络连接。</translation>
</message>
<message>
- <location filename="rust_strings.h" line="349"/>
+ <location filename="rust_strings.h" line="357"/>
<source>NectarLink %1 is available</source>
<translation>NectarLink %1 已发布</translation>
</message>
<message>
- <location filename="rust_strings.h" line="350"/>
+ <location filename="rust_strings.h" line="358"/>
<source>NectarLink %1 is available.</source>
<translation>NectarLink %1 已发布。</translation>
</message>
<message>
- <location filename="rust_strings.h" line="351"/>
+ <location filename="rust_strings.h" line="359"/>
<source>NectarLink is still on the version you had. Try again from Settings.</source>
<translation>NectarLink 仍是原来的版本。请在设置中重试。</translation>
</message>
<message>
- <location filename="rust_strings.h" line="352"/>
+ <location filename="rust_strings.h" line="360"/>
<source>NectarLink is up to date.</source>
<translation>NectarLink 已是最新版本。</translation>
</message>
<message>
- <location filename="rust_strings.h" line="353"/>
+ <location filename="rust_strings.h" line="361"/>
<source>NectarLink is updated to %1</source>
<translation>NectarLink 已更新到 %1</translation>
</message>
<message>
- <location filename="rust_strings.h" line="354"/>
+ <location filename="rust_strings.h" line="362"/>
<source>The download was damaged, so it wasn&apos;t installed. Try again.</source>
<translation>下载的文件已损坏,因此未安装。请重试。</translation>
</message>
<message>
- <location filename="rust_strings.h" line="355"/>
+ <location filename="rust_strings.h" line="363"/>
<source>The update couldn&apos;t be downloaded. Check your internet connection and try again.</source>
<translation>无法下载更新。请检查网络连接后重试。</translation>
</message>
<message>
- <location filename="rust_strings.h" line="356"/>
+ <location filename="rust_strings.h" line="364"/>
<source>The update couldn&apos;t be saved. Check that there&apos;s free space and try again.</source>
<translation>无法保存更新。请确认有足够的空间后重试。</translation>
</message>
<message>
- <location filename="rust_strings.h" line="357"/>
+ <location filename="rust_strings.h" line="365"/>
<source>The update couldn&apos;t be started. Try again.</source>
<translation>无法启动更新。请重试。</translation>
</message>
<message>
- <location filename="rust_strings.h" line="358"/>
+ <location filename="rust_strings.h" line="366"/>
<source>The update didn&apos;t install</source>
<translation>更新未安装</translation>
</message>
<message>
- <location filename="rust_strings.h" line="359"/>
+ <location filename="rust_strings.h" line="367"/>
<source>Update now, or later from Settings.</source>
<translation>立即更新,或稍后在设置中更新。</translation>
</message>
<message>
- <location filename="rust_strings.h" line="360"/>
+ <location filename="rust_strings.h" line="368"/>
<source>Your phone reconnects on its own.</source>
<translation>手机会自动重新连接。</translation>
</message>
@@ -7577,12 +7618,12 @@
<context>
<name>Webcam</name>
<message>
- <location filename="rust_strings.h" line="361"/>
+ <location filename="rust_strings.h" line="369"/>
<source>Starting camera on %1…</source>
<translation>正在启动 %1 上的相机…</translation>
</message>
<message>
- <location filename="rust_strings.h" line="362"/>
+ <location filename="rust_strings.h" line="370"/>
<source>Streaming %1 × %2 · %3 fps from %4</source>
<translation>正在从 %4 传输 %1 × %2 · %3 fps</translation>
</message>
@@ -7613,17 +7654,17 @@
<context>
<name>Widget</name>
<message>
- <location filename="rust_strings.h" line="363"/>
+ <location filename="rust_strings.h" line="371"/>
<source>No phone connected</source>
<translation>未连接手机</translation>
</message>
<message>
- <location filename="rust_strings.h" line="364"/>
+ <location filename="rust_strings.h" line="372"/>
<source>No recent clipboard items</source>
<translation>没有最近的剪贴板内容</translation>
</message>
<message>
- <location filename="rust_strings.h" line="365"/>
+ <location filename="rust_strings.h" line="373"/>
<source>Not available</source>
<translation>不可用</translation>
</message>
diff --git a/desktop/app/i18n/rust_strings.h b/desktop/app/i18n/rust_strings.h
index e687479..c643f4c 100644
--- a/desktop/app/i18n/rust_strings.h
+++ b/desktop/app/i18n/rust_strings.h
@@ -323,13 +323,19 @@ static const char *const nectarlink_rust_strings[] = {
QT_TRANSLATE_NOOP("Timeline", "Copied image"), // desktop/app/src/bridge/timeline.rs
QT_TRANSLATE_NOOP("Timeline", "Copied link to clipboard."), // desktop/app/src/bridge/timeline.rs
QT_TRANSLATE_NOOP("Timeline", "Copied to clipboard."), // desktop/app/src/bridge/timeline.rs
+ QT_TRANSLATE_NOOP("Timeline", "From %1"), // desktop/app/src/bridge/timeline.rs
QT_TRANSLATE_NOOP("Timeline", "In progress"), // desktop/app/src/bridge/timeline.rs
QT_TRANSLATE_NOOP("Timeline", "No phone is paired yet."), // desktop/app/src/bridge/timeline.rs
+ QT_TRANSLATE_NOOP("Timeline", "Opened from %1"), // desktop/app/src/bridge/timeline.rs
+ QT_TRANSLATE_NOOP("Timeline", "Opened on %1"), // desktop/app/src/bridge/timeline.rs
QT_TRANSLATE_NOOP("Timeline", "Phone microphone"), // desktop/app/src/i18n.rs
QT_TRANSLATE_NOOP("Timeline", "Phone webcam"), // desktop/app/src/i18n.rs
+ QT_TRANSLATE_NOOP("Timeline", "Recorded on %1"), // desktop/app/src/bridge/timeline.rs
+ QT_TRANSLATE_NOOP("Timeline", "Saved from %1"), // desktop/app/src/bridge/timeline.rs
QT_TRANSLATE_NOOP("Timeline", "Screen mirroring"), // desktop/app/src/i18n.rs
QT_TRANSLATE_NOOP("Timeline", "Sending to %1…"), // desktop/app/src/bridge/timeline.rs
QT_TRANSLATE_NOOP("Timeline", "Sent clip to %1."), // desktop/app/src/bridge/timeline.rs
+ QT_TRANSLATE_NOOP("Timeline", "Sent to %1"), // desktop/app/src/bridge/timeline.rs
QT_TRANSLATE_NOOP("Timeline", "That clip is no longer in clipboard history."), // desktop/app/src/bridge/timeline.rs
QT_TRANSLATE_NOOP("Timeline", "That entry couldn't be removed. Try again."), // desktop/app/src/bridge/timeline.rs
QT_TRANSLATE_NOOP("Timeline", "That file was moved or deleted."), // desktop/app/src/bridge/timeline.rs
@@ -338,6 +344,8 @@ static const char *const nectarlink_rust_strings[] = {
QT_TRANSLATE_NOOP("Timeline", "The Timeline couldn't be cleared. Try again."), // desktop/app/src/bridge/timeline.rs
QT_TRANSLATE_NOOP("Timeline", "The photo couldn't be copied to the clipboard."), // desktop/app/src/bridge/timeline.rs
QT_TRANSLATE_NOOP("Timeline", "Voice recording"), // desktop/app/src/bridge/timeline.rs
+ QT_TRANSLATE_NOOP("Timeline", "With %1"), // desktop/app/src/bridge/timeline.rs
+ QT_TRANSLATE_NOOP("Timeline", "device"), // desktop/app/src/bridge/timeline.rs
QT_TRANSLATE_NOOP("Transfers", "Accept in NectarLink to save to Downloads\\Nectarlink"), // desktop/app/src/transfers.rs
QT_TRANSLATE_NOOP("Transfers", "Files are turned off for that device."), // desktop/app/src/transfers.rs
QT_TRANSLATE_NOOP("Transfers", "From %1, opened from Downloads\\Nectarlink"), // desktop/app/src/transfers.rs
diff --git a/desktop/app/src/bridge/timeline.rs b/desktop/app/src/bridge/timeline.rs
index c296fbd..e9201fd 100644
--- a/desktop/app/src/bridge/timeline.rs
+++ b/desktop/app/src/bridge/timeline.rs
@@ -579,17 +579,17 @@ fn describe_entry(
entry: &TimelineEntry,
device_name: &str,
) -> (String, String, String, String, u32, bool, bool, bool, bool) {
- let dir_verb = match (entry.kind, entry.incoming) {
- (TimelineKind::Link, true) => "Opened from",
- (TimelineKind::Link, false) => "Opened on",
- (TimelineKind::Photo, _) => "Saved from",
- (TimelineKind::Recording, _) => "Recorded on",
- (TimelineKind::Session, _) => "With",
- (_, true) => "From",
- (_, false) => "Sent to",
+ let dev = if device_name.is_empty() { tr!("Timeline", "device") } else { device_name.to_owned() };
+ // Whole phrases, so a language can put the name where it goes.
+ let who = match (entry.kind, entry.incoming) {
+ (TimelineKind::Link, true) => tr!("Timeline", "Opened from %1", dev),
+ (TimelineKind::Link, false) => tr!("Timeline", "Opened on %1", dev),
+ (TimelineKind::Photo, _) => tr!("Timeline", "Saved from %1", dev),
+ (TimelineKind::Recording, _) => tr!("Timeline", "Recorded on %1", dev),
+ (TimelineKind::Session, _) => tr!("Timeline", "With %1", dev),
+ (_, true) => tr!("Timeline", "From %1", dev),
+ (_, false) => tr!("Timeline", "Sent to %1", dev),
};
- let dev = if device_name.is_empty() { "device" } else { device_name };
- let who = format!("{dir_verb} {dev}");
match entry.kind {
TimelineKind::File | TimelineKind::Photo | TimelineKind::Recording => {