in-web: landing title joins the family form 'Sign in · in'; dead WelcomeTitle key removed
Browse files at this commitb1d090a2cd988993b13e8b45a279070d3d4343acParent: a84b9de4 changed files +34 -18
- crates/in-web/src/drive.rs +6 -4
- crates/in-web/src/i18n.rs +22 -7
- crates/in-web/src/layout.rs +2 -3
- crates/in-web/src/settings.rs +4 -4
crates/in-web/src/drive.rsmodified+6 -4
| @@ -685,7 +685,8 @@ async fn drive(cx: &Cx) -> Result<impl View> { | |||
| 685 | data-failed-label=(t(language, Key::UploadFailed)) | 685 | data-failed-label=(t(language, Key::UploadFailed)) |
| 686 | data-complete-label=(t(language, Key::UploadComplete)) | 686 | data-complete-label=(t(language, Key::UploadComplete)) |
| 687 | data-cancel-label=(t(language, Key::CancelUpload)) | 687 | data-cancel-label=(t(language, Key::CancelUpload)) |
| 688 | - data-canceled-label=(t(language, Key::UploadCanceled))> | 688 | + data-canceled-label=(t(language, Key::UploadCanceled)) |
| 689 | + data-files-label=(t(language, Key::FilesCountLabel))> | ||
| 689 | <input type="hidden" name="folder_id" value=(current_id.clone())> | 690 | <input type="hidden" name="folder_id" value=(current_id.clone())> |
| 690 | <input id="drive-upload-input" class="file-upload-input" type="file" name="file" multiple=""> | 691 | <input id="drive-upload-input" class="file-upload-input" type="file" name="file" multiple=""> |
| 691 | </form> | 692 | </form> |
| @@ -1035,7 +1036,7 @@ async fn upload_script<'a>(cx: &'a Cx) -> Result<impl View + 'a> { | |||
| 1035 | if (old) { old.remove(); } \ | 1036 | if (old) { old.remove(); } \ |
| 1036 | row.setAttribute('role', 'button'); \ | 1037 | row.setAttribute('role', 'button'); \ |
| 1037 | row.setAttribute('tabindex', '0'); \ | 1038 | row.setAttribute('tabindex', '0'); \ |
| 1038 | - row.setAttribute('title', box.getAttribute('data-dismiss-label') || 'dismiss'); \ | 1039 | + row.setAttribute('title', box.getAttribute('data-dismiss-label') || ''); \ |
| 1039 | row.addEventListener('click', function () { dropRow(u); }); \ | 1040 | row.addEventListener('click', function () { dropRow(u); }); \ |
| 1040 | row.addEventListener('keydown', function (ev) { \ | 1041 | row.addEventListener('keydown', function (ev) { \ |
| 1041 | if (ev.key === 'Enter' || ev.key === ' ') { ev.preventDefault(); dropRow(u); } \ | 1042 | if (ev.key === 'Enter' || ev.key === ' ') { ev.preventDefault(); dropRow(u); } \ |
| @@ -1279,9 +1280,10 @@ async fn upload_script<'a>(cx: &'a Cx) -> Result<impl View + 'a> { | |||
| 1279 | if (input) { input.disabled = true; window.__inOwn(input, [], ['disabled']); } \ | 1280 | if (input) { input.disabled = true; window.__inOwn(input, [], ['disabled']); } \ |
| 1280 | var small = files.filter(function (f) { return f.size < LIMIT; }); \ | 1281 | var small = files.filter(function (f) { return f.size < LIMIT; }); \ |
| 1281 | var big = files.filter(function (f) { return f.size >= LIMIT; }); \ | 1282 | var big = files.filter(function (f) { return f.size >= LIMIT; }); \ |
| 1282 | - var failLabel = form.getAttribute('data-failed-label') || 'upload failed'; \ | 1283 | + var failLabel = form.getAttribute('data-failed-label') || ''; \ |
| 1283 | var doneLabel = form.getAttribute('data-complete-label') || ''; \ | 1284 | var doneLabel = form.getAttribute('data-complete-label') || ''; \ |
| 1284 | var canceledLabel = form.getAttribute('data-canceled-label') || ''; \ | 1285 | var canceledLabel = form.getAttribute('data-canceled-label') || ''; \ |
| 1286 | + var filesLabel = form.getAttribute('data-files-label') || ''; \ | ||
| 1285 | var landing = window.location.href; \ | 1287 | var landing = window.location.href; \ |
| 1286 | function settle() { \ | 1288 | function settle() { \ |
| 1287 | input.value = ''; \ | 1289 | input.value = ''; \ |
| @@ -1292,7 +1294,7 @@ async fn upload_script<'a>(cx: &'a Cx) -> Result<impl View + 'a> { | |||
| 1292 | var rows = []; \ | 1294 | var rows = []; \ |
| 1293 | try { \ | 1295 | try { \ |
| 1294 | if (small.length) { \ | 1296 | if (small.length) { \ |
| 1295 | - var title = small.length === 1 ? small[0].name : (small.length + ' files'); \ | 1297 | + var title = small.length === 1 ? small[0].name : (small.length + ' ' + filesLabel); \ |
| 1296 | var ui = bar(title); \ | 1298 | var ui = bar(title); \ |
| 1297 | rows.push(ui); \ | 1299 | rows.push(ui); \ |
| 1298 | var url = await sendSmall(form.getAttribute('action'), folder, small, function (frac) { setProgress(ui, frac); }, ui); \ | 1300 | var url = await sendSmall(form.getAttribute('action'), folder, small, function (frac) { setProgress(ui, frac); }, ui); \ |
crates/in-web/src/i18n.rsmodified+22 -7
| @@ -86,7 +86,6 @@ pub enum Key { | |||
| 86 | BackToShared, | 86 | BackToShared, |
| 87 | BackToTrash, | 87 | BackToTrash, |
| 88 | // Landing. | 88 | // Landing. |
| 89 | - WelcomeTitle, | ||
| 90 | WelcomeBlurb, | 89 | WelcomeBlurb, |
| 91 | SignIn, | 90 | SignIn, |
| 92 | // Topbar. | 91 | // Topbar. |
| @@ -126,6 +125,7 @@ pub enum Key { | |||
| 126 | UploadCanceled, | 125 | UploadCanceled, |
| 127 | CancelUpload, | 126 | CancelUpload, |
| 128 | RetryUpload, | 127 | RetryUpload, |
| 128 | + FilesCountLabel, | ||
| 129 | // File view. | 129 | // File view. |
| 130 | FileDetails, | 130 | FileDetails, |
| 131 | PreviewUnavailable, | 131 | PreviewUnavailable, |
| @@ -175,6 +175,7 @@ pub enum Key { | |||
| 175 | ConnectionLastEvent, | 175 | ConnectionLastEvent, |
| 176 | ConnectionLastPass, | 176 | ConnectionLastPass, |
| 177 | Never, | 177 | Never, |
| 178 | + AgoSuffix, | ||
| 178 | DisplayName, | 179 | DisplayName, |
| 179 | EmailAddress, | 180 | EmailAddress, |
| 180 | QuotaUsage, | 181 | QuotaUsage, |
| @@ -194,6 +195,8 @@ pub enum Key { | |||
| 194 | NoLinks, | 195 | NoLinks, |
| 195 | ManageLinks, | 196 | ManageLinks, |
| 196 | UiLabel, | 197 | UiLabel, |
| 198 | + InstrumentOption, | ||
| 199 | + LedgerOption, | ||
| 197 | ThemeLabel, | 200 | ThemeLabel, |
| 198 | LightOption, | 201 | LightOption, |
| 199 | DarkOption, | 202 | DarkOption, |
| @@ -221,6 +224,8 @@ pub enum Key { | |||
| 221 | KindAll, | 224 | KindAll, |
| 222 | KindFolders, | 225 | KindFolders, |
| 223 | KindFiles, | 226 | KindFiles, |
| 227 | + KindFile, | ||
| 228 | + KindFolder, | ||
| 224 | DeletedLabel, | 229 | DeletedLabel, |
| 225 | // Per-entry share page (ShareBuild owns this block). | 230 | // Per-entry share page (ShareBuild owns this block). |
| 226 | CreateLink, | 231 | CreateLink, |
| @@ -284,7 +289,6 @@ pub fn t(lang: Lang, key: Key) -> &'static str { | |||
| 284 | BackToDrive => "Back to the drive", | 289 | BackToDrive => "Back to the drive", |
| 285 | BackToShared => "Back to shared", | 290 | BackToShared => "Back to shared", |
| 286 | BackToTrash => "Back to trash", | 291 | BackToTrash => "Back to trash", |
| 287 | - WelcomeTitle => "in: your files", | ||
| 288 | WelcomeBlurb => "Your folders and files, shared on your terms.", | 292 | WelcomeBlurb => "Your folders and files, shared on your terms.", |
| 289 | SignIn => "Sign in", | 293 | SignIn => "Sign in", |
| 290 | NavDrive => "Drive", | 294 | NavDrive => "Drive", |
| @@ -323,6 +327,7 @@ pub fn t(lang: Lang, key: Key) -> &'static str { | |||
| 323 | UploadCanceled => "Upload canceled.", | 327 | UploadCanceled => "Upload canceled.", |
| 324 | CancelUpload => "Cancel the upload", | 328 | CancelUpload => "Cancel the upload", |
| 325 | RetryUpload => "Try again", | 329 | RetryUpload => "Try again", |
| 330 | + FilesCountLabel => "files", | ||
| 326 | FileDetails => "File", | 331 | FileDetails => "File", |
| 327 | PreviewUnavailable => "No preview for this kind of file.", | 332 | PreviewUnavailable => "No preview for this kind of file.", |
| 328 | Play => "Play", | 333 | Play => "Play", |
| @@ -369,6 +374,7 @@ pub fn t(lang: Lang, key: Key) -> &'static str { | |||
| 369 | ConnectionLastEvent => "Last roster event", | 374 | ConnectionLastEvent => "Last roster event", |
| 370 | ConnectionLastPass => "Last full pass", | 375 | ConnectionLastPass => "Last full pass", |
| 371 | Never => "never", | 376 | Never => "never", |
| 377 | + AgoSuffix => "ago", | ||
| 372 | QuotaUsage => "Storage used", | 378 | QuotaUsage => "Storage used", |
| 373 | QuotaOf => "/", | 379 | QuotaOf => "/", |
| 374 | AdminPanel => "Everyone", | 380 | AdminPanel => "Everyone", |
| @@ -385,10 +391,12 @@ pub fn t(lang: Lang, key: Key) -> &'static str { | |||
| 385 | NoLinks => "No share links yet.", | 391 | NoLinks => "No share links yet.", |
| 386 | ManageLinks => "Share links", | 392 | ManageLinks => "Share links", |
| 387 | UiLabel => "Interface", | 393 | UiLabel => "Interface", |
| 388 | - ThemeLabel => "THEME", | 394 | + InstrumentOption => "Instrument", |
| 395 | + LedgerOption => "Ledger", | ||
| 396 | + ThemeLabel => "Theme", | ||
| 389 | LightOption => "Light", | 397 | LightOption => "Light", |
| 390 | DarkOption => "Dark", | 398 | DarkOption => "Dark", |
| 391 | - LanguageLabel => "LANGUAGE", | 399 | + LanguageLabel => "Language", |
| 392 | Saved => "Saved.", | 400 | Saved => "Saved.", |
| 393 | UploadedLabel => "Uploaded", | 401 | UploadedLabel => "Uploaded", |
| 394 | DownloadsLabel => "Downloads", | 402 | DownloadsLabel => "Downloads", |
| @@ -418,6 +426,8 @@ pub fn t(lang: Lang, key: Key) -> &'static str { | |||
| 418 | KindFolders => "Folders", | 426 | KindFolders => "Folders", |
| 419 | DeletedLabel => "Deleted", | 427 | DeletedLabel => "Deleted", |
| 420 | KindFiles => "Files", | 428 | KindFiles => "Files", |
| 429 | + KindFile => "File", | ||
| 430 | + KindFolder => "Folder", | ||
| 421 | CreateLink => "Create link", | 431 | CreateLink => "Create link", |
| 422 | ExpiresInDays => "Expires in days", | 432 | ExpiresInDays => "Expires in days", |
| 423 | NoShares => "Not shared with anyone yet.", | 433 | NoShares => "Not shared with anyone yet.", |
| @@ -469,7 +479,6 @@ pub fn t(lang: Lang, key: Key) -> &'static str { | |||
| 469 | BackToDrive => "Sürücüye dön", | 479 | BackToDrive => "Sürücüye dön", |
| 470 | BackToShared => "Paylaşılanlara dön", | 480 | BackToShared => "Paylaşılanlara dön", |
| 471 | BackToTrash => "Çöpe dön", | 481 | BackToTrash => "Çöpe dön", |
| 472 | - WelcomeTitle => "in: dosyaların", | ||
| 473 | WelcomeBlurb => "Klasörlerin ve dosyaların, senin kurallarınla.", | 482 | WelcomeBlurb => "Klasörlerin ve dosyaların, senin kurallarınla.", |
| 474 | SignIn => "Oturum aç", | 483 | SignIn => "Oturum aç", |
| 475 | NavDrive => "Sürücü", | 484 | NavDrive => "Sürücü", |
| @@ -508,6 +517,7 @@ pub fn t(lang: Lang, key: Key) -> &'static str { | |||
| 508 | UploadCanceled => "Yükleme iptal edildi.", | 517 | UploadCanceled => "Yükleme iptal edildi.", |
| 509 | CancelUpload => "Yüklemeyi iptal et", | 518 | CancelUpload => "Yüklemeyi iptal et", |
| 510 | RetryUpload => "Yeniden dene", | 519 | RetryUpload => "Yeniden dene", |
| 520 | + FilesCountLabel => "dosya", | ||
| 511 | FileDetails => "Dosya", | 521 | FileDetails => "Dosya", |
| 512 | PreviewUnavailable => "Bu tür dosyanın önizlemesi yok.", | 522 | PreviewUnavailable => "Bu tür dosyanın önizlemesi yok.", |
| 513 | RenameFile => "Dosyayı yeniden adlandır", | 523 | RenameFile => "Dosyayı yeniden adlandır", |
| @@ -556,6 +566,7 @@ pub fn t(lang: Lang, key: Key) -> &'static str { | |||
| 556 | ConnectionLastEvent => "Son dizin olayı", | 566 | ConnectionLastEvent => "Son dizin olayı", |
| 557 | ConnectionLastPass => "Son tam geçiş", | 567 | ConnectionLastPass => "Son tam geçiş", |
| 558 | Never => "hiç", | 568 | Never => "hiç", |
| 569 | + AgoSuffix => "önce", | ||
| 559 | AdminPanel => "Herkes", | 570 | AdminPanel => "Herkes", |
| 560 | SetQuota => "Kotayı ayarla", | 571 | SetQuota => "Kotayı ayarla", |
| 561 | QuotaBytes => "Depolama kotası", | 572 | QuotaBytes => "Depolama kotası", |
| @@ -572,10 +583,12 @@ pub fn t(lang: Lang, key: Key) -> &'static str { | |||
| 572 | NoLinks => "Henüz paylaşım bağlantısı yok.", | 583 | NoLinks => "Henüz paylaşım bağlantısı yok.", |
| 573 | ManageLinks => "Paylaşım bağlantıları", | 584 | ManageLinks => "Paylaşım bağlantıları", |
| 574 | UiLabel => "Arayüz", | 585 | UiLabel => "Arayüz", |
| 575 | - ThemeLabel => "TEMA", | 586 | + InstrumentOption => "Enstrüman", |
| 587 | + LedgerOption => "Defter", | ||
| 588 | + ThemeLabel => "Tema", | ||
| 576 | LightOption => "Açık", | 589 | LightOption => "Açık", |
| 577 | DarkOption => "Koyu", | 590 | DarkOption => "Koyu", |
| 578 | - LanguageLabel => "DİL", | 591 | + LanguageLabel => "Dil", |
| 579 | Saved => "Kaydedildi.", | 592 | Saved => "Kaydedildi.", |
| 580 | UploadedLabel => "Yüklendi", | 593 | UploadedLabel => "Yüklendi", |
| 581 | DownloadsLabel => "İndirme", | 594 | DownloadsLabel => "İndirme", |
| @@ -597,6 +610,8 @@ pub fn t(lang: Lang, key: Key) -> &'static str { | |||
| 597 | KindAll => "Tümü", | 610 | KindAll => "Tümü", |
| 598 | KindFolders => "Klasörler", | 611 | KindFolders => "Klasörler", |
| 599 | KindFiles => "Dosyalar", | 612 | KindFiles => "Dosyalar", |
| 613 | + KindFile => "Dosya", | ||
| 614 | + KindFolder => "Klasör", | ||
| 600 | DeletedLabel => "Silindi", | 615 | DeletedLabel => "Silindi", |
| 601 | CreateLink => "Bağlantı oluştur", | 616 | CreateLink => "Bağlantı oluştur", |
| 602 | Copied => "Kopyalandı", | 617 | Copied => "Kopyalandı", |
crates/in-web/src/layout.rsmodified+2 -3
| @@ -1067,7 +1067,7 @@ pub async fn status_script<'a>(cx: &'a Cx) -> Result<impl View + 'a> { | |||
| 1067 | function box() { return document.getElementById('in-status'); } \ | 1067 | function box() { return document.getElementById('in-status'); } \ |
| 1068 | function dismissLabel() { \ | 1068 | function dismissLabel() { \ |
| 1069 | var b = box(); \ | 1069 | var b = box(); \ |
| 1070 | - return (b && b.getAttribute('data-dismiss-label')) || 'dismiss'; \ | 1070 | + return (b && b.getAttribute('data-dismiss-label')) || ''; \ |
| 1071 | } \ | 1071 | } \ |
| 1072 | window.__inNotify = function (kind, text) { \ | 1072 | window.__inNotify = function (kind, text) { \ |
| 1073 | seq++; \ | 1073 | seq++; \ |
| @@ -1200,7 +1200,7 @@ pub(crate) async fn document_shell<'a>( | |||
| 1200 | /// catch-all 404 among it — reads as the app's bare name. | 1200 | /// catch-all 404 among it — reads as the app's bare name. |
| 1201 | fn title_key_of(path: &str) -> Option<Key> { | 1201 | fn title_key_of(path: &str) -> Option<Key> { |
| 1202 | match path { | 1202 | match path { |
| 1203 | - "/" => Some(Key::WelcomeTitle), | 1203 | + "/" => Some(Key::SignIn), |
| 1204 | p if p.starts_with("/drive") => Some(Key::NavDrive), | 1204 | p if p.starts_with("/drive") => Some(Key::NavDrive), |
| 1205 | p if p.starts_with("/shared") => Some(Key::NavShared), | 1205 | p if p.starts_with("/shared") => Some(Key::NavShared), |
| 1206 | p if p.starts_with("/trash") => Some(Key::NavTrash), | 1206 | p if p.starts_with("/trash") => Some(Key::NavTrash), |
| @@ -1217,7 +1217,6 @@ async fn root_layout(cx: &Cx, slot: topcoat::view::Child<'_>) -> Result<impl Vie | |||
| 1217 | let lang = crate::i18n::lang(cx).await; | 1217 | let lang = crate::i18n::lang(cx).await; |
| 1218 | let title = match title_key_of(uri(cx).path()) { | 1218 | let title = match title_key_of(uri(cx).path()) { |
| 1219 | None => "in".to_string(), | 1219 | None => "in".to_string(), |
| 1220 | - Some(Key::WelcomeTitle) => t(lang, Key::WelcomeTitle).to_string(), | ||
| 1221 | Some(key) => format!("{} · in", t(lang, key)), | 1220 | Some(key) => format!("{} · in", t(lang, key)), |
| 1222 | }; | 1221 | }; |
| 1223 | document_shell(cx, slot, title).await | 1222 | document_shell(cx, slot, title).await |
crates/in-web/src/settings.rsmodified+4 -4
| @@ -547,7 +547,7 @@ async fn settings(cx: &Cx) -> Result<impl View> { | |||
| 547 | if text.is_empty() { | 547 | if text.is_empty() { |
| 548 | t(language, Key::Never).to_string() | 548 | t(language, Key::Never).to_string() |
| 549 | } else { | 549 | } else { |
| 550 | - format!("{text} ago") | 550 | + format!("{text} {}", t(language, Key::AgoSuffix)) |
| 551 | } | 551 | } |
| 552 | }; | 552 | }; |
| 553 | let event_line = age_line(last_event); | 553 | let event_line = age_line(last_event); |
| @@ -688,8 +688,8 @@ async fn settings(cx: &Cx) -> Result<impl View> { | |||
| 688 | <label class="field"> | 688 | <label class="field"> |
| 689 | <span class="field-label">(t(language, Key::UiLabel))</span> | 689 | <span class="field-label">(t(language, Key::UiLabel))</span> |
| 690 | <select class="field-input" name="ui"> | 690 | <select class="field-input" name="ui"> |
| 691 | - <option value="instrument" selected=(fresh.ui == "instrument")>"Instrument"</option> | 691 | + <option value="instrument" selected=(fresh.ui == "instrument")>(t(language, Key::InstrumentOption))</option> |
| 692 | - <option value="ledger" selected=(fresh.ui == "ledger")>"Ledger"</option> | 692 | + <option value="ledger" selected=(fresh.ui == "ledger")>(t(language, Key::LedgerOption))</option> |
| 693 | </select> | 693 | </select> |
| 694 | </label> | 694 | </label> |
| 695 | <label class="field"> | 695 | <label class="field"> |
| @@ -764,7 +764,7 @@ async fn settings(cx: &Cx) -> Result<impl View> { | |||
| 764 | } | 764 | } |
| 765 | for (link, target_name, url) in &link_names { | 765 | for (link, target_name, url) in &link_names { |
| 766 | <div class="member-row"> | 766 | <div class="member-row"> |
| 767 | - <span class="member-name">(format!("{} · {}", link.kind.as_str(), target_name.clone()))</span> | 767 | + <span class="member-name">(format!("{} · {}", t(language, if link.kind == ShareKind::Folder { Key::KindFolder } else { Key::KindFile }), target_name.clone()))</span> |
| 768 | <span class="field-note">(expiry_line(language, link.expires_at))</span> | 768 | <span class="field-note">(expiry_line(language, link.expires_at))</span> |
| 769 | <div class="spacer"></div> | 769 | <div class="spacer"></div> |
| 770 | <span class="field-note">(if link.can_download { t(language, Key::CanDownload) } else { t(language, Key::ViewOnly) })</span> | 770 | <span class="field-note">(if link.can_download { t(language, Key::CanDownload) } else { t(language, Key::ViewOnly) })</span> |