PasteFerry (隔空贴): clipboard and file sync across macOS, Windows and Linux. Direct-first, end-to-end encrypted. Optional official access: no server to host. Independent self-hosting remains available.
Dart airdrop-alternativeclipboardclipboard-sharingclipboard-synccopy-pastecross-platformend-to-end-encryptionfile-syncfile-transferfluttergolanglinuxmacosnat-traversalp2pself-hostedtailscaleuniversal-clipboardwebrtcwindows
feat(ui): say when received file names were changed for Windows
baiyuzef89a95565d51
diff --git a/ui/lib/l10n/app_en.arb b/ui/lib/l10n/app_en.arbindex 5605ffe..8ea5ea1 100644--- a/ui/lib/l10n/app_en.arb+++ b/ui/lib/l10n/app_en.arb@@ -1272,5 +1272,13 @@},"saveDirNotFound": "This folder doesn’t exist.","saveDirNotWritable": "PasteFerry can’t save files in this folder.",- "saveDirPermission": "PasteFerry isn’t allowed to use this folder. Allow it in System Settings → Privacy & Security → Files and Folders."+ "saveDirPermission": "PasteFerry isn’t allowed to use this folder. Allow it in System Settings → Privacy & Security → Files and Folders.",+ "transferRenamed": "{count, plural, =1{1 file name had characters Windows doesn’t allow; they were replaced with similar full-width characters} other{{count} file names had characters Windows doesn’t allow; they were replaced with similar full-width characters}}",+ "@transferRenamed": {+ "placeholders": {+ "count": {+ "type": "int"+ }+ }+ }}diff --git a/ui/lib/l10n/app_ja.arb b/ui/lib/l10n/app_ja.arbindex a68c1f5..8c07087 100644--- a/ui/lib/l10n/app_ja.arb+++ b/ui/lib/l10n/app_ja.arb@@ -490,5 +490,6 @@"receiveFootnote": "ペアリングしたデバイスだけが{device}にファイルを送れます。転送中、{device}は自動でスリープしません。","saveDirNotFound": "このフォルダは存在しません。","saveDirNotWritable": "PasteFerry はこのフォルダにファイルを保存できません。",- "saveDirPermission": "PasteFerry にこのフォルダの使用が許可されていません。「システム設定 → プライバシーとセキュリティ → ファイルとフォルダ」で許可してください。"+ "saveDirPermission": "PasteFerry にこのフォルダの使用が許可されていません。「システム設定 → プライバシーとセキュリティ → ファイルとフォルダ」で許可してください。",+ "transferRenamed": "{count} 個のファイル名に Windows で使えない文字があったため、似た全角文字に置き換えました"}diff --git a/ui/lib/l10n/app_localizations.dart b/ui/lib/l10n/app_localizations.dartindex 5a1768a..3d2612a 100644--- a/ui/lib/l10n/app_localizations.dart+++ b/ui/lib/l10n/app_localizations.dart@@ -3055,6 +3055,12 @@ abstract class AppLocalizations {/// In en, this message translates to:/// **'PasteFerry isn’t allowed to use this folder. Allow it in System Settings → Privacy & Security → Files and Folders.'**String get saveDirPermission;++ /// No description provided for @transferRenamed.+ ///+ /// In en, this message translates to:+ /// **'{count, plural, =1{1 file name had characters Windows doesn’t allow; they were replaced with similar full-width characters} other{{count} file names had characters Windows doesn’t allow; they were replaced with similar full-width characters}}'**+ String transferRenamed(int count);}class _AppLocalizationsDelegatediff --git a/ui/lib/l10n/app_localizations_en.dart b/ui/lib/l10n/app_localizations_en.dartindex 6dfc180..e67116d 100644--- a/ui/lib/l10n/app_localizations_en.dart+++ b/ui/lib/l10n/app_localizations_en.dart@@ -1867,4 +1867,17 @@ class AppLocalizationsEn extends AppLocalizations {@overrideString get saveDirPermission =>'PasteFerry isn’t allowed to use this folder. Allow it in System Settings → Privacy & Security → Files and Folders.';++ @override+ String transferRenamed(int count) {+ String _temp0 = intl.Intl.pluralLogic(+ count,+ locale: localeName,+ other:+ '$count file names had characters Windows doesn’t allow; they were replaced with similar full-width characters',+ one:+ '1 file name had characters Windows doesn’t allow; they were replaced with similar full-width characters',+ );+ return '$_temp0';+ }}diff --git a/ui/lib/l10n/app_localizations_ja.dart b/ui/lib/l10n/app_localizations_ja.dartindex 1db4084..6a7d1b6 100644--- a/ui/lib/l10n/app_localizations_ja.dart+++ b/ui/lib/l10n/app_localizations_ja.dart@@ -1720,4 +1720,9 @@ class AppLocalizationsJa extends AppLocalizations {@overrideString get saveDirPermission =>'PasteFerry にこのフォルダの使用が許可されていません。「システム設定 → プライバシーとセキュリティ → ファイルとフォルダ」で許可してください。';++ @override+ String transferRenamed(int count) {+ return '$count 個のファイル名に Windows で使えない文字があったため、似た全角文字に置き換えました';+ }}diff --git a/ui/lib/l10n/app_localizations_zh.dart b/ui/lib/l10n/app_localizations_zh.dartindex b2ae825..ba0ce69 100644--- a/ui/lib/l10n/app_localizations_zh.dart+++ b/ui/lib/l10n/app_localizations_zh.dart@@ -1701,6 +1701,11 @@ class AppLocalizationsZh extends AppLocalizations {@overrideString get saveDirPermission =>'隔空贴还没有使用这个文件夹的权限。请在「系统设置 → 隐私与安全性 → 文件与文件夹」里允许。';++ @override+ String transferRenamed(int count) {+ return '$count 个文件名含 Windows 不支持的字符,已换成相近的全角字符';+ }}/// The translations for Chinese, as used in Hong Kong, using the Han script (`zh_Hant_HK`).@@ -3400,6 +3405,11 @@ class AppLocalizationsZhHantHk extends AppLocalizationsZh {@overrideString get saveDirPermission =>'隔空貼還沒有使用這個資料夾的權限。請在「系統設定 → 私隱與保安 → 檔案和資料夾」中允許。';++ @override+ String transferRenamed(int count) {+ return '$count 個檔名含 Windows 不支援的字元,已換成相近的全形字元';+ }}/// The translations for Chinese, as used in Taiwan, using the Han script (`zh_Hant_TW`).@@ -5099,4 +5109,9 @@ class AppLocalizationsZhHantTw extends AppLocalizationsZh {@overrideString get saveDirPermission =>'隔空貼還沒有使用這個資料夾的權限。請在「系統設定 → 隱私權與安全性 → 檔案與資料夾」中允許。';++ @override+ String transferRenamed(int count) {+ return '$count 個檔名含 Windows 不支援的字元,已換成相近的全形字元';+ }}diff --git a/ui/lib/l10n/app_zh.arb b/ui/lib/l10n/app_zh.arbindex bda4241..3a53777 100644--- a/ui/lib/l10n/app_zh.arb+++ b/ui/lib/l10n/app_zh.arb@@ -490,5 +490,6 @@"receiveFootnote": "只有已配对的设备能给{device}发文件。传输期间{device}不会自动睡眠。","saveDirNotFound": "这个文件夹不存在。","saveDirNotWritable": "隔空贴不能把文件存到这个文件夹。",- "saveDirPermission": "隔空贴还没有使用这个文件夹的权限。请在「系统设置 → 隐私与安全性 → 文件与文件夹」里允许。"+ "saveDirPermission": "隔空贴还没有使用这个文件夹的权限。请在「系统设置 → 隐私与安全性 → 文件与文件夹」里允许。",+ "transferRenamed": "{count} 个文件名含 Windows 不支持的字符,已换成相近的全角字符"}diff --git a/ui/lib/l10n/app_zh_Hant_HK.arb b/ui/lib/l10n/app_zh_Hant_HK.arbindex 190ae5c..d99c6b9 100644--- a/ui/lib/l10n/app_zh_Hant_HK.arb+++ b/ui/lib/l10n/app_zh_Hant_HK.arb@@ -490,5 +490,6 @@"receiveFootnote": "只有已配對的裝置能傳檔案給{device}。傳輸期間{device}不會自動睡眠。","saveDirNotFound": "這個資料夾不存在。","saveDirNotWritable": "隔空貼無法把檔案存到這個資料夾。",- "saveDirPermission": "隔空貼還沒有使用這個資料夾的權限。請在「系統設定 → 私隱與保安 → 檔案和資料夾」中允許。"+ "saveDirPermission": "隔空貼還沒有使用這個資料夾的權限。請在「系統設定 → 私隱與保安 → 檔案和資料夾」中允許。",+ "transferRenamed": "{count} 個檔名含 Windows 不支援的字元,已換成相近的全形字元"}diff --git a/ui/lib/l10n/app_zh_Hant_TW.arb b/ui/lib/l10n/app_zh_Hant_TW.arbindex 1270032..b18e475 100644--- a/ui/lib/l10n/app_zh_Hant_TW.arb+++ b/ui/lib/l10n/app_zh_Hant_TW.arb@@ -490,5 +490,6 @@"receiveFootnote": "只有已配對的裝置能傳檔案給{device}。傳輸期間{device}不會自動睡眠。","saveDirNotFound": "這個資料夾不存在。","saveDirNotWritable": "隔空貼無法把檔案存到這個資料夾。",- "saveDirPermission": "隔空貼還沒有使用這個資料夾的權限。請在「系統設定 → 隱私權與安全性 → 檔案與資料夾」中允許。"+ "saveDirPermission": "隔空貼還沒有使用這個資料夾的權限。請在「系統設定 → 隱私權與安全性 → 檔案與資料夾」中允許。",+ "transferRenamed": "{count} 個檔名含 Windows 不支援的字元,已換成相近的全形字元"}diff --git a/ui/lib/pages/send_page.dart b/ui/lib/pages/send_page.dartindex fc7b0e6..c8f7bfa 100644--- a/ui/lib/pages/send_page.dart+++ b/ui/lib/pages/send_page.dart@@ -655,6 +655,9 @@ class _TransferRowState extends State<_TransferRow> {maxLines: 2,overflow: TextOverflow.ellipsis,),+ // Windows 上改过的文件名:只换了名字里不允许的字符,内容不变+ if (!_out && t.status == 'done' && t.renamedFiles > 0)+ Text(l.transferRenamed(t.renamedFiles.toInt()), style: context.text.bodySmall),if (active) ...[const SizedBox(height: 4),LinearProgressIndicator(diff --git a/ui/test/send_page_test.dart b/ui/test/send_page_test.dartindex 5020f70..7a9d08b 100644--- a/ui/test/send_page_test.dart+++ b/ui/test/send_page_test.dart@@ -40,7 +40,8 @@ AppState _demo(String language, {bool withActive = true}) => AppState()Transfer(id: 'r2', direction: _in, deviceId: 'air', deviceName: 'MacBook Air', status: 'done',items: [ClipItem(name: '合同扫描件.pdf'), ClipItem(name: 'notes.txt'), ClipItem(name: 'a.png')],paths: ['/tmp/合同扫描件.pdf', '/tmp/notes.txt', '/tmp/a.png'], present: [true, true, true],- totalBytes: Int64(18 << 20), fileCount: Int64(3), createdAtUnix: _now(120), finishedAtUnix: _now(100), seen: true),+ totalBytes: Int64(18 << 20), fileCount: Int64(3), createdAtUnix: _now(120), finishedAtUnix: _now(100), seen: true,+ renamedFiles: Int64(2)),Transfer(id: 'r3', direction: _in, deviceId: 'win', deviceName: 'Windows 台式机', status: 'done',items: [ClipItem(name: 'PasteFerry.dmg')], paths: ['/tmp/PasteFerry.dmg'], present: [false],totalBytes: Int64(812 << 20), fileCount: Int64(1), createdAtUnix: _now(90000), finishedAtUnix: _now(90000), seen: true),@@ -89,6 +90,7 @@ void main() {final list = find.byType(Scrollable).last;expect(find.textContaining('IMG_2041.HEIC'), findsOneWidget);await tester.scrollUntilVisible(find.textContaining(l.transferItems('合同扫描件.pdf', 3, 2)), 60, scrollable: list);+ await tester.scrollUntilVisible(find.text(l.transferRenamed(2)), 60, scrollable: list);await tester.scrollUntilVisible(find.textContaining(l.transferMissing), 60, scrollable: list);// 发出的await tester.tap(find.text(l.transfersSent));