From b1d090a2cd988993b13e8b45a279070d3d4343ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Fri, 11 Sep 2026 07:22:56 +0300 Subject: [PATCH] =?UTF-8?q?in-web:=20landing=20title=20joins=20the=20famil?= =?UTF-8?q?y=20form=20'Sign=20in=20=C2=B7=20in';=20dead=20WelcomeTitle=20k?= =?UTF-8?q?ey=20removed?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/in-web/src/drive.rs | 10 ++++++---- crates/in-web/src/i18n.rs | 29 ++++++++++++++++++++++------- crates/in-web/src/layout.rs | 5 ++--- crates/in-web/src/settings.rs | 8 ++++---- 4 files changed, 34 insertions(+), 18 deletions(-) diff --git a/crates/in-web/src/drive.rs b/crates/in-web/src/drive.rs index 6c59ba5..42ce9d8 100644 --- a/crates/in-web/src/drive.rs +++ b/crates/in-web/src/drive.rs @@ -685,7 +685,8 @@ async fn drive(cx: &Cx) -> Result { data-failed-label=(t(language, Key::UploadFailed)) data-complete-label=(t(language, Key::UploadComplete)) data-cancel-label=(t(language, Key::CancelUpload)) - data-canceled-label=(t(language, Key::UploadCanceled))> + data-canceled-label=(t(language, Key::UploadCanceled)) + data-files-label=(t(language, Key::FilesCountLabel))> @@ -1035,7 +1036,7 @@ async fn upload_script<'a>(cx: &'a Cx) -> Result { if (old) { old.remove(); } \ row.setAttribute('role', 'button'); \ row.setAttribute('tabindex', '0'); \ - row.setAttribute('title', box.getAttribute('data-dismiss-label') || 'dismiss'); \ + row.setAttribute('title', box.getAttribute('data-dismiss-label') || ''); \ row.addEventListener('click', function () { dropRow(u); }); \ row.addEventListener('keydown', function (ev) { \ if (ev.key === 'Enter' || ev.key === ' ') { ev.preventDefault(); dropRow(u); } \ @@ -1279,9 +1280,10 @@ async fn upload_script<'a>(cx: &'a Cx) -> Result { if (input) { input.disabled = true; window.__inOwn(input, [], ['disabled']); } \ var small = files.filter(function (f) { return f.size < LIMIT; }); \ var big = files.filter(function (f) { return f.size >= LIMIT; }); \ - var failLabel = form.getAttribute('data-failed-label') || 'upload failed'; \ + var failLabel = form.getAttribute('data-failed-label') || ''; \ var doneLabel = form.getAttribute('data-complete-label') || ''; \ var canceledLabel = form.getAttribute('data-canceled-label') || ''; \ + var filesLabel = form.getAttribute('data-files-label') || ''; \ var landing = window.location.href; \ function settle() { \ input.value = ''; \ @@ -1292,7 +1294,7 @@ async fn upload_script<'a>(cx: &'a Cx) -> Result { var rows = []; \ try { \ if (small.length) { \ - var title = small.length === 1 ? small[0].name : (small.length + ' files'); \ + var title = small.length === 1 ? small[0].name : (small.length + ' ' + filesLabel); \ var ui = bar(title); \ rows.push(ui); \ var url = await sendSmall(form.getAttribute('action'), folder, small, function (frac) { setProgress(ui, frac); }, ui); \ diff --git a/crates/in-web/src/i18n.rs b/crates/in-web/src/i18n.rs index dc8a63c..2b7dd06 100644 --- a/crates/in-web/src/i18n.rs +++ b/crates/in-web/src/i18n.rs @@ -86,7 +86,6 @@ pub enum Key { BackToShared, BackToTrash, // Landing. - WelcomeTitle, WelcomeBlurb, SignIn, // Topbar. @@ -126,6 +125,7 @@ pub enum Key { UploadCanceled, CancelUpload, RetryUpload, + FilesCountLabel, // File view. FileDetails, PreviewUnavailable, @@ -175,6 +175,7 @@ pub enum Key { ConnectionLastEvent, ConnectionLastPass, Never, + AgoSuffix, DisplayName, EmailAddress, QuotaUsage, @@ -194,6 +195,8 @@ pub enum Key { NoLinks, ManageLinks, UiLabel, + InstrumentOption, + LedgerOption, ThemeLabel, LightOption, DarkOption, @@ -221,6 +224,8 @@ pub enum Key { KindAll, KindFolders, KindFiles, + KindFile, + KindFolder, DeletedLabel, // Per-entry share page (ShareBuild owns this block). CreateLink, @@ -284,7 +289,6 @@ pub fn t(lang: Lang, key: Key) -> &'static str { BackToDrive => "Back to the drive", BackToShared => "Back to shared", BackToTrash => "Back to trash", - WelcomeTitle => "in: your files", WelcomeBlurb => "Your folders and files, shared on your terms.", SignIn => "Sign in", NavDrive => "Drive", @@ -323,6 +327,7 @@ pub fn t(lang: Lang, key: Key) -> &'static str { UploadCanceled => "Upload canceled.", CancelUpload => "Cancel the upload", RetryUpload => "Try again", + FilesCountLabel => "files", FileDetails => "File", PreviewUnavailable => "No preview for this kind of file.", Play => "Play", @@ -369,6 +374,7 @@ pub fn t(lang: Lang, key: Key) -> &'static str { ConnectionLastEvent => "Last roster event", ConnectionLastPass => "Last full pass", Never => "never", + AgoSuffix => "ago", QuotaUsage => "Storage used", QuotaOf => "/", AdminPanel => "Everyone", @@ -385,10 +391,12 @@ pub fn t(lang: Lang, key: Key) -> &'static str { NoLinks => "No share links yet.", ManageLinks => "Share links", UiLabel => "Interface", - ThemeLabel => "THEME", + InstrumentOption => "Instrument", + LedgerOption => "Ledger", + ThemeLabel => "Theme", LightOption => "Light", DarkOption => "Dark", - LanguageLabel => "LANGUAGE", + LanguageLabel => "Language", Saved => "Saved.", UploadedLabel => "Uploaded", DownloadsLabel => "Downloads", @@ -418,6 +426,8 @@ pub fn t(lang: Lang, key: Key) -> &'static str { KindFolders => "Folders", DeletedLabel => "Deleted", KindFiles => "Files", + KindFile => "File", + KindFolder => "Folder", CreateLink => "Create link", ExpiresInDays => "Expires in days", NoShares => "Not shared with anyone yet.", @@ -469,7 +479,6 @@ pub fn t(lang: Lang, key: Key) -> &'static str { BackToDrive => "Sürücüye dön", BackToShared => "Paylaşılanlara dön", BackToTrash => "Çöpe dön", - WelcomeTitle => "in: dosyaların", WelcomeBlurb => "Klasörlerin ve dosyaların, senin kurallarınla.", SignIn => "Oturum aç", NavDrive => "Sürücü", @@ -508,6 +517,7 @@ pub fn t(lang: Lang, key: Key) -> &'static str { UploadCanceled => "Yükleme iptal edildi.", CancelUpload => "Yüklemeyi iptal et", RetryUpload => "Yeniden dene", + FilesCountLabel => "dosya", FileDetails => "Dosya", PreviewUnavailable => "Bu tür dosyanın önizlemesi yok.", RenameFile => "Dosyayı yeniden adlandır", @@ -556,6 +566,7 @@ pub fn t(lang: Lang, key: Key) -> &'static str { ConnectionLastEvent => "Son dizin olayı", ConnectionLastPass => "Son tam geçiş", Never => "hiç", + AgoSuffix => "önce", AdminPanel => "Herkes", SetQuota => "Kotayı ayarla", QuotaBytes => "Depolama kotası", @@ -572,10 +583,12 @@ pub fn t(lang: Lang, key: Key) -> &'static str { NoLinks => "Henüz paylaşım bağlantısı yok.", ManageLinks => "Paylaşım bağlantıları", UiLabel => "Arayüz", - ThemeLabel => "TEMA", + InstrumentOption => "Enstrüman", + LedgerOption => "Defter", + ThemeLabel => "Tema", LightOption => "Açık", DarkOption => "Koyu", - LanguageLabel => "DİL", + LanguageLabel => "Dil", Saved => "Kaydedildi.", UploadedLabel => "Yüklendi", DownloadsLabel => "İndirme", @@ -597,6 +610,8 @@ pub fn t(lang: Lang, key: Key) -> &'static str { KindAll => "Tümü", KindFolders => "Klasörler", KindFiles => "Dosyalar", + KindFile => "Dosya", + KindFolder => "Klasör", DeletedLabel => "Silindi", CreateLink => "Bağlantı oluştur", Copied => "Kopyalandı", diff --git a/crates/in-web/src/layout.rs b/crates/in-web/src/layout.rs index a5350ed..12e604a 100644 --- a/crates/in-web/src/layout.rs +++ b/crates/in-web/src/layout.rs @@ -1067,7 +1067,7 @@ pub async fn status_script<'a>(cx: &'a Cx) -> Result { function box() { return document.getElementById('in-status'); } \ function dismissLabel() { \ var b = box(); \ - return (b && b.getAttribute('data-dismiss-label')) || 'dismiss'; \ + return (b && b.getAttribute('data-dismiss-label')) || ''; \ } \ window.__inNotify = function (kind, text) { \ seq++; \ @@ -1200,7 +1200,7 @@ pub(crate) async fn document_shell<'a>( /// catch-all 404 among it — reads as the app's bare name. fn title_key_of(path: &str) -> Option { match path { - "/" => Some(Key::WelcomeTitle), + "/" => Some(Key::SignIn), p if p.starts_with("/drive") => Some(Key::NavDrive), p if p.starts_with("/shared") => Some(Key::NavShared), p if p.starts_with("/trash") => Some(Key::NavTrash), @@ -1217,7 +1217,6 @@ async fn root_layout(cx: &Cx, slot: topcoat::view::Child<'_>) -> Result "in".to_string(), - Some(Key::WelcomeTitle) => t(lang, Key::WelcomeTitle).to_string(), Some(key) => format!("{} · in", t(lang, key)), }; document_shell(cx, slot, title).await diff --git a/crates/in-web/src/settings.rs b/crates/in-web/src/settings.rs index 0cdfaf2..cd12fa5 100644 --- a/crates/in-web/src/settings.rs +++ b/crates/in-web/src/settings.rs @@ -547,7 +547,7 @@ async fn settings(cx: &Cx) -> Result { if text.is_empty() { t(language, Key::Never).to_string() } else { - format!("{text} ago") + format!("{text} {}", t(language, Key::AgoSuffix)) } }; let event_line = age_line(last_event); @@ -688,8 +688,8 @@ async fn settings(cx: &Cx) -> Result {