A new style desktop shell for Windows 11: menu bar, Dock, Finder, Spotlight, Control Center and Liquid Glass, in native C++.
Rust
Localisation: remaining hard-coded strings, built-in app names, zh/en entries
Eternity07062818edc4a2e500
diff --git a/src/ajustes/paginas.cpp b/src/ajustes/paginas.cppindex 981411f..8772601 100644--- a/src/ajustes/paginas.cpp+++ b/src/ajustes/paginas.cpp@@ -1583,7 +1583,7 @@ static void SiriBuscaModelos(int prov) {std::wstring atual = Setting(L"siri_modelo", L"");if (_wtoi(Setting(L"siri_provedor", L"0").c_str()) == prov && std::find(l.begin(), l.end(), atual) == l.end()) SetSetting(L"siri_modelo", l[0]);g_siriErro.clear();- } else g_siriErro = erro;+ } else g_siriErro = Tr(erro); // "sem chave" / "sem conexão" (siri.h) no idioma do WacOSg_siriBuscando = 0;aj::Rebuild();});@@ -2095,7 +2095,7 @@ Page Telas() {if (rates.size() > 1) {std::vector<std::wstring> ol;int cr = sys::RefreshRate(), ci = 0;- for (int k = 0; k < (int)rates.size(); k++) { ol.push_back(std::to_wstring(rates[k]) + L" Hertz"); if (rates[k] == cr) ci = k; }+ for (int k = 0; k < (int)rates.size(); k++) { ol.push_back(std::to_wstring(rates[k]) + Tr(L" Hertz")); if (rates[k] == cr) ci = k; }p.groups.push_back(G({ Popup(L"Taxa de atualização", ol, [ci] { return ci; }, [rates](int k) { sys::SetRefreshRate(rates[k]); }) }));}p.groups.push_back(G({ Link(L"Escala", [] { OpenUri(L"ms-settings:display"); }, 0, 0, [] { return Fmt(L"%d%%", (int)std::lround(sys::ScaleFactor() * 100)); }) }));diff --git a/src/calculadora/main.cpp b/src/calculadora/main.cppindex 8e236bb..2007ca9 100644--- a/src/calculadora/main.cpp+++ b/src/calculadora/main.cpp@@ -131,7 +131,7 @@ const std::vector<Cat> CATS = {{ Tr(L"Pés Quadrados"), L"ft²", 0.09290304 }, { Tr(L"Centímetros Quadrados"), L"cm²", 1e-4 } } },{ Tr(L"Velocidade"), { { Tr(L"Quilômetros por Hora"), L"km/h", 1 / 3.6 }, { Tr(L"Metros por Segundo"), L"m/s", 1 }, { Tr(L"Milhas por Hora"), L"mph", 0.44704 },{ Tr(L"Nós"), L"kn", 1852.0 / 3600 } } },- { Tr(L"Tempo"), { { Tr(L"Segundos"), L"s", 1 }, { Tr(L"Minutos"), L"min", 60 }, { Tr(L"Horas"), L"h", 3600 }, { Tr(L"Dias"), L"d", 86400 }, { Tr(L"Semanas"), Tr(L"sem"), 604800 },+ { TrPick(L"Tempo", L"Time"), { { Tr(L"Segundos"), L"s", 1 }, { Tr(L"Minutos"), L"min", 60 }, { Tr(L"Horas"), L"h", 3600 }, { Tr(L"Dias"), L"d", 86400 }, { Tr(L"Semanas"), Tr(L"sem"), 604800 },{ Tr(L"Anos"), Tr(L"anos"), 31557600 } } },{ Tr(L"Dados"), { { Tr(L"Bytes"), L"B", 1 }, { Tr(L"Bits"), L"bit", 0.125 }, { Tr(L"Kilobytes"), L"KB", 1e3 }, { Tr(L"Megabytes"), L"MB", 1e6 }, { Tr(L"Gigabytes"), L"GB", 1e9 },{ Tr(L"Terabytes"), L"TB", 1e12 }, { Tr(L"Kibibytes"), L"KiB", 1024 }, { Tr(L"Mebibytes"), L"MiB", 1048576 }, { Tr(L"Gibibytes"), L"GiB", 1073741824 } } },diff --git a/src/calendario/main.cpp b/src/calendario/main.cppindex 1426071..965a1f0 100644--- a/src/calendario/main.cpp+++ b/src/calendario/main.cpp@@ -629,7 +629,7 @@ void EvMenu(int id, POINT scr) {for (int h = 7; h <= 21; h++) { wchar_t b[16]; swprintf_s(b, L"%d:00", h); AppendMenuW(tm, MF_STRING, 100 + h, b); }int mins[] = { 15, 30, 60, 90, 120, 180 };const wchar_t* dn[] = { L"15 min", L"30 min", L"1 h", L"1 h 30", L"2 h", L"3 h" };- for (int i = 0; i < 6; i++) AppendMenuW(dur, MF_STRING | (e->allDay ? MF_GRAYED : 0), 200 + i, dn[i]);+ for (int i = 0; i < 6; i++) AppendMenuW(dur, MF_STRING | (e->allDay ? MF_GRAYED : 0), 200 + i, Tr(dn[i]));for (int i = 0; i < 7; i++) AppendMenuW(col, MF_STRING | (e->color == i ? MF_CHECKED : 0), 300 + i, Tr(COLOR_NAMES[i]));HMENU cal = CreatePopupMenu();for (int i = 0; i < (int)g_cals.size(); i++) AppendMenuW(cal, MF_STRING | (e->cal == g_cals[i].id ? MF_CHECKED : 0), 500 + i, g_cals[i].name.c_str());diff --git a/src/clima/main.cpp b/src/clima/main.cppindex 1695102..0af177b 100644--- a/src/clima/main.cpp+++ b/src/clima/main.cpp@@ -294,8 +294,8 @@ void PaintGoldenWx() {} else Fill(r, dark ? Rgb(255, 255, 255, 0.08f) : Rgb(0, 0, 0, 0.05f), 14);if (i == g_sel) { br->SetColor(semaforo::Aqua() ? Rgb(0, 136, 255) : Rgb(10, 132, 255)); rt->DrawRoundedRectangle(D2D1::RoundedRect(D2D1::RectF(r.left + 1, r.top + 1, r.right - 1, r.bottom - 1), 13, 13), br, 2); }D2D1_COLOR_F tc = p.wx.ok ? white : text, tdim = p.wx.ok ? dim : gray;- Text(i == 0 ? std::wstring(Tr(L"Meu Local")) : p.name, g_tfSide, D2D1::RectF(r.left + 12, r.top + 8, r.right - 60, r.top + 30), tc);- if (i == 0) Text(p.name, g_tfSmall, D2D1::RectF(r.left + 12, r.top + 28, r.right - 60, r.top + 46), tdim);+ Text(i == 0 ? std::wstring(Tr(L"Meu Local")) : Tr(p.name), g_tfSide, D2D1::RectF(r.left + 12, r.top + 8, r.right - 60, r.top + 30), tc);+ if (i == 0) Text(Tr(p.name), g_tfSmall, D2D1::RectF(r.left + 12, r.top + 28, r.right - 60, r.top + 46), tdim);if (p.wx.ok) {Text(CondText(p.wx.code), g_tfSmall, D2D1::RectF(r.left + 12, r.bottom - 24, r.right - 60, r.bottom - 6), dim);wchar_t t[16]; swprintf_s(t, L"%d°", (int)std::lround(p.wx.temp));@@ -319,7 +319,7 @@ void PaintGoldenWx() {rt->PushAxisAlignedClip(D2D1::RectF(X0, 52, sz.width, sz.height), D2D1_ANTIALIAS_MODE_ALIASED);float oy = -g_gScroll;wchar_t t[64];- Text(g_sel == 0 ? std::wstring(Tr(L"Meu Local")) : pl.name, g_tfCityG, D2D1::RectF(X0, oy + 94, sz.width, oy + 120), white);+ Text(g_sel == 0 ? std::wstring(Tr(L"Meu Local")) : Tr(pl.name), g_tfCityG, D2D1::RectF(X0, oy + 94, sz.width, oy + 120), white);swprintf_s(t, L" %d°", (int)std::lround(w.temp));Text(t, g_tfTempG, D2D1::RectF(X0, oy + 118, sz.width, oy + 182), white);Text(CondText(w.code), g_tfCondG, D2D1::RectF(X0, oy + 177, sz.width, oy + 195), white);@@ -472,8 +472,8 @@ void Paint() {} else Fill(r, dark ? Rgb(58, 58, 60) : Rgb(255, 255, 255), 12);D2D1_COLOR_F tc = pl.wx.ok ? white : text;if (i == g_sel) { br->SetColor(Rgb(10, 132, 255)); rt->DrawRoundedRectangle(D2D1::RoundedRect(r, 12, 12), br, 2.5f); }- Text(i == 0 ? std::wstring(Tr(L"Meu Local")) : pl.name, g_tfSide, D2D1::RectF(r.left + 12, r.top + 8, r.right - 60, r.top + 30), tc);- if (i == 0) Text(pl.name, g_tfSmall, D2D1::RectF(r.left + 12, r.top + 28, r.right - 60, r.top + 46), pl.wx.ok ? dim : gray);+ Text(i == 0 ? std::wstring(Tr(L"Meu Local")) : Tr(pl.name), g_tfSide, D2D1::RectF(r.left + 12, r.top + 8, r.right - 60, r.top + 30), tc);+ if (i == 0) Text(Tr(pl.name), g_tfSmall, D2D1::RectF(r.left + 12, r.top + 28, r.right - 60, r.top + 46), pl.wx.ok ? dim : gray);if (pl.wx.ok) {Text(CondText(pl.wx.code), g_tfSmall, D2D1::RectF(r.left + 12, r.bottom - 24, r.right - 60, r.bottom - 6), dim);wchar_t t[16]; swprintf_s(t, L"%d°", (int)std::lround(pl.wx.temp));@@ -501,8 +501,8 @@ void Paint() {}if (!g_side) toggle(white);float cx = (SB + sz.width) / 2, W = sz.width - SB;- Text(g_sel == 0 ? std::wstring(Tr(L"Meu Local")) : pl.name, g_tfCity, D2D1::RectF(SB, 24, sz.width, 62), white);- if (g_sel == 0) Text(pl.name, g_tfSmallC, D2D1::RectF(SB, 58, sz.width, 76), dim);+ Text(g_sel == 0 ? std::wstring(Tr(L"Meu Local")) : Tr(pl.name), g_tfCity, D2D1::RectF(SB, 24, sz.width, 62), white);+ if (g_sel == 0) Text(Tr(pl.name), g_tfSmallC, D2D1::RectF(SB, 58, sz.width, 76), dim);wchar_t t[32]; swprintf_s(t, L" %d°", (int)std::lround(w.temp));Text(t, g_tfTemp, D2D1::RectF(SB, 70, sz.width, 170), white);Text(CondText(w.code), g_tfCond, D2D1::RectF(SB, 168, sz.width, 194), white);diff --git a/src/comum/idioma_en.inc b/src/comum/idioma_en.incindex ce988a4..d0da610 100644--- a/src/comum/idioma_en.inc+++ b/src/comum/idioma_en.inc@@ -1804,3 +1804,11 @@{ L"Ligue a edição do WacOS reescrita em Rust em Ajustes do Sistema > Experimental > BETA-TEST. Ela ainda está em teste e dá para voltar para esta edição a qualquer momento.", L"Turn on the edition of WacOS rewritten in Rust in System Settings > Experimental > BETA-TEST. It is still in testing, and you can switch back to this edition at any time." },{ L"Abrir Ajustes", L"Open Settings" },{ L"Agora não", L"Not Now" },+{ L"todos", L"everyone" },+{ L"usuários", L"users" },+{ L"administradores", L"administrators" },+{ L"sistema", L"system" },+{ L"usuários autenticados", L"authenticated users" },+{ L"sem chave", L"no key" },+{ L"sem conexão", L"no connection" },+{ L"Espaço", L"Space" },diff --git a/src/comum/idioma_zh.inc b/src/comum/idioma_zh.incindex 36388bf..85e2809 100644--- a/src/comum/idioma_zh.inc+++ b/src/comum/idioma_zh.inc@@ -1964,3 +1964,74 @@{ L"Zoom", L"缩放" },{ L"Web", L"网页" },{ L"Normal", L"常规" },+{ L"Finder|Finder", L"访达" },+{ L"Terminal|Terminal", L"终端" },+{ L"TextEdit|TextEdit", L"文本编辑" },+{ L"Tempo|Time", L"时间" },+{ L"Mouse", L"鼠标" },+{ L"Trackpad", L"触控板" },+{ L"64 bits", L"64 位" },+{ L"32 bits", L"32 位" },+{ L"todos", L"所有人" },+{ L"usuários", L"用户" },+{ L"administradores", L"管理员" },+{ L"sistema", L"系统" },+{ L"usuários autenticados", L"已验证的用户" },+{ L" Hertz", L" 赫兹" },+{ L" min", L" 分钟" },+{ L"−1 min", L"−1 分钟" },+{ L"+1 min", L"+1 分钟" },+{ L"Caps Lock", L"大写锁定" },+{ L"15 min", L"15 分钟" },+{ L"30 min", L"30 分钟" },+{ L"1 h", L"1 小时" },+{ L"1 h 30", L"1 小时 30 分钟" },+{ L"2 h", L"2 小时" },+{ L"3 h", L"3 小时" },+{ L"sem chave", L"没有密钥" },+{ L"sem conexão", L"无法连接" },+{ L"Espaço", L"空格" },+{ L", %+lld h 30", L",%+lld 小时 30 分钟" },+{ L", %+lld h", L",%+lld 小时" },+{ L"%d h", L"%d 小时" },+{ L"%d min", L"%d 分钟" },+{ L"%ls%lld:%02lld H", L"%ls%lld:%02lld 小时" },+{ L"%ls%lld H", L"%ls%lld 小时" },+{ L"Campinas", L"坎皮纳斯" },+{ L"Fortaleza", L"福塔莱萨" },+{ L"Salvador", L"萨尔瓦多" },+{ L"Palmas", L"帕尔马斯" },+{ L"Cuiabá", L"库亚巴" },+{ L"Caracas", L"加拉加斯" },+{ L"Ciudad de México", L"墨西哥城" },+{ L"New York", L"纽约" },+{ L"Phoenix", L"菲尼克斯" },+{ L"Anchorage", L"安克雷奇" },+{ L"Halifax", L"哈利法克斯" },+{ L"London", L"伦敦" },+{ L"Reykjavík", L"雷克雅未克" },+{ L"Berlin", L"柏林" },+{ L"Budapest", L"布达佩斯" },+{ L"Warszawa", L"华沙" },+{ L"Athens", L"雅典" },+{ L"Kyiv", L"基辅" },+{ L"Chișinău", L"基希讷乌" },+{ L"İstanbul", L"伊斯坦布尔" },+{ L"Moscow", L"莫斯科" },+{ L"Jerusalem", L"耶路撒冷" },+{ L"Johannesburg", L"约翰内斯堡" },+{ L"Lagos", L"拉各斯" },+{ L"Nairobi", L"内罗毕" },+{ L"Riyadh", L"利雅得" },+{ L"Tehran", L"德黑兰" },+{ L"Karachi", L"卡拉奇" },+{ L"Dhaka", L"达卡" },+{ L"Bangkok", L"曼谷" },+{ L"Singapore", L"新加坡" },+{ L"Beijing", L"北京" },+{ L"Taipei", L"台北" },+{ L"Seoul", L"首尔" },+{ L"Tokyo", L"东京" },+{ L"Perth", L"珀斯" },+{ L"Brisbane", L"布里斯班" },+{ L"Social", L"社交" },diff --git a/src/finder/info.cpp b/src/finder/info.cppindex eaf2e00..2b73fc3 100644--- a/src/finder/info.cpp+++ b/src/finder/info.cpp@@ -219,16 +219,15 @@ ID2D1Bitmap* ToBitmap(ID2D1RenderTarget* rt, const std::vector<BYTE>& px, UINT w// ---- permissões (DACL)std::wstring SidName(PSID sid) {+ // os grupos do sistema pelo SID (o nome que o Windows devolve muda com o idioma dele: "Users", "Usuários",+ // "Benutzer"...), no idioma do WacOS; antes saíam sempre em português+ if (IsWellKnownSid(sid, WinWorldSid)) return Tr(L"todos");+ if (IsWellKnownSid(sid, WinBuiltinUsersSid)) return Tr(L"usuários");+ if (IsWellKnownSid(sid, WinBuiltinAdministratorsSid)) return Tr(L"administradores");+ if (IsWellKnownSid(sid, WinLocalSystemSid)) return Tr(L"sistema");+ if (IsWellKnownSid(sid, WinAuthenticatedUserSid)) return Tr(L"usuários autenticados");wchar_t name[256], dom[256]; DWORD nn = 256, dn = 256; SID_NAME_USE use;- if (LookupAccountSidW(nullptr, sid, name, &nn, dom, &dn, &use)) {- std::wstring n = name;- if (n == L"Everyone" || n == L"Todos") return L"todos";- if (n == L"Users" || n == L"Usuários") return L"usuários";- if (n == L"Administrators" || n == L"Administradores") return L"administradores";- if (n == L"SYSTEM" || n == L"SISTEMA") return L"sistema";- if (n == L"Authenticated Users" || n == L"Usuários autenticados") return L"usuários autenticados";- return n;- }+ if (LookupAccountSidW(nullptr, sid, name, &nn, dom, &dn, &use)) return name;LPWSTR str = nullptr;std::wstring r = ConvertSidToStringSidW(sid, &str) ? str : Tr(L"(desconhecido)");if (str) LocalFree(str);diff --git a/src/relogio/main.cpp b/src/relogio/main.cppindex 8add67b..f275526 100644--- a/src/relogio/main.cpp+++ b/src/relogio/main.cpp@@ -267,7 +267,7 @@ void PaintWorldGolden(D2D1_SIZE_F sz, bool dark) {long long dh = (diffMin + (diffMin >= 0 ? 15 : -15)) / 30;std::wstring dayS = t.wDay == here.wDay ? Tr(L"Hoje") : (diffMin > 0 ? Tr(L"Amanhã") : Tr(L"Ontem"));wchar_t off[32] = L"";- if (dh % 2) swprintf_s(off, L", %+lld h 30", dh / 2); else if (dh) swprintf_s(off, L", %+lld h", dh / 2);+ if (dh % 2) swprintf_s(off, Tr(L", %+lld h 30"), dh / 2); else if (dh) swprintf_s(off, Tr(L", %+lld h"), dh / 2);Text(dayS + off, g_tfCardSub, D2D1::RectF(x0 + 6, cy0 + 154, x0 + 164, cy0 + 170), dark ? Rgb(152, 152, 157) : Rgb(134, 134, 139));{ // ⤒ nascer ⤓ pôr (sol pela metade com a seta), como na capturaSYSTEMTIME ut; GetSystemTime(&ut);@@ -369,8 +369,8 @@ void Paint() {std::wstring day = t.wDay == here.wDay ? Tr(L"Hoje") : (diffMin > 0 ? Tr(L"Amanhã") : Tr(L"Ontem"));wchar_t off[32];if (dh == 0) wcscpy_s(off, L"");- else if (dh % 2) swprintf_s(off, L", %+lld h 30", dh / 2);- else swprintf_s(off, L", %+lld h", dh / 2);+ else if (dh % 2) swprintf_s(off, Tr(L", %+lld h 30"), dh / 2);+ else swprintf_s(off, Tr(L", %+lld h"), dh / 2);D2D1_RECT_F row = D2D1::RectF(X, y, W, y + 74);Text(day + off, g_tfSub, D2D1::RectF(X, y + 10, W - 200, y + 30), gray);Text(CityName(i), g_tfRow, D2D1::RectF(X, y + 30, W - 200, y + 60), text);@@ -435,7 +435,7 @@ void Paint() {for (int i = 0; i < 7; i++) {D2D1_RECT_F r = D2D1::RectF(px + i * (pw + 3), y, px + i * (pw + 3) + pw, y + 34);bool on = g_tmMin == presets[i];- wchar_t b[16]; swprintf_s(b, presets[i] >= 60 ? L"%d h" : L"%d min", presets[i] >= 60 ? presets[i] / 60 : presets[i]);+ wchar_t b[16]; swprintf_s(b, presets[i] >= 60 ? Tr(L"%d h") : Tr(L"%d min"), presets[i] >= 60 ? presets[i] / 60 : presets[i]);Fill(r, on ? Rgb(255, 159, 10, 0.3f) : (dark ? Rgb(58, 58, 60) : Rgb(229, 229, 234)), 8);Text(b, g_tfBtn, r, on ? Rgb(255, 159, 10) : text);g_hits.push_back({ H_TM_PRESET, presets[i], r });diff --git a/src/shell/apps.cpp b/src/shell/apps.cppindex f4bb975..2eff531 100644--- a/src/shell/apps.cpp+++ b/src/shell/apps.cpp@@ -122,8 +122,9 @@ static std::wstring AumidOfWindow(HWND h) {}// Os nossos apps aparecem só com o nome do app (como no Mac), na língua escolhida, nunca "Sequoia ...".-// Vazio: não é um dos nossos.-static std::wstring OurName(const std::wstring& exe) {+// Vazio: não é um dos nossos. Todos os apps do pacote: antes só os 7 primeiros, e os outros (Relógio, Clima...)+// apareciam na barra de menus com a descrição em inglês do .exe em qualquer idioma. O Launchpad usa o mesmo.+std::wstring apps::OurName(const std::wstring& exe) {std::wstring f = Lower(exe.substr(exe.find_last_of(L'\\') + 1));struct N { const wchar_t* exe; const wchar_t* pt; const wchar_t* en; };static const N names[] = {@@ -134,10 +135,23 @@ static std::wstring OurName(const std::wstring& exe) {{ L"wacoscalculator.exe", L"Calculadora", L"Calculator" },{ L"wacosnotes.exe", L"Notas", L"Notes" },{ L"wacosscreenshot.exe", L"Captura de Tela", L"Screenshot" },+ { L"wacospreview.exe", L"Pré-Visualização", L"Preview" },+ { L"wacosreminders.exe", L"Lembretes", L"Reminders" },+ { L"wacoscalendar.exe", L"Calendário", L"Calendar" },+ { L"wacostextedit.exe", L"TextEdit", L"TextEdit" },+ { L"wacosclock.exe", L"Relógio", L"Clock" },+ { L"wacosweather.exe", L"Clima", L"Weather" },+ { L"wacoscontacts.exe", L"Contatos", L"Contacts" },+ { L"wacosphotos.exe", L"Fotos", L"Photos" },+ { L"wacostimemachine.exe", L"Time Machine", L"Time Machine" },+ { L"wacosmusic.exe", L"Música", L"Music" },+ { L"wacosquicktime.exe", L"QuickTime Player", L"QuickTime Player" },+ { L"wacosforcequit.exe", L"Forçar Encerrar Aplicativos", L"Force Quit Applications" },};for (auto& n : names) if (f == n.exe) return TrPick(n.pt, n.en);return L"";}+using apps::OurName;void apps::Relabel() {for (auto& a : list) {diff --git a/src/shell/central.cpp b/src/shell/central.cppindex 25c0f92..feb6ebd 100644--- a/src/shell/central.cpp+++ b/src/shell/central.cpp@@ -1018,7 +1018,7 @@ void Paint() {std::wstring airSub = st.airdrop == 2 ? Tr(L"Todos") : st.airdrop == 1 ? Tr(L"Só Meus Dispositivos") : Tr(L"Desativado");Row rows[3] = {{ H_WIFI_BTN, H_WIFI, L"wifi", 0xE701, L"Wi‑Fi", wifiSub, st.radio[0] == 1 },- { H_BT_BTN, H_BT, L"proprio.bluetooth", 0xE702, L"Bluetooth", btSub, st.radio[1] == 1 },+ { H_BT_BTN, H_BT, L"proprio.bluetooth", 0xE702, Tr(L"Bluetooth"), btSub, st.radio[1] == 1 },{ H_AIRDROP, H_AIRDROP, L"dot.radiowaves.left.and.right", 0xE72D, L"AirDrop", airSub, st.airdrop > 0 },};for (int i = 0; i < 3; i++) {@@ -1681,7 +1681,7 @@ void PaintTahoe() {g_hits.push_back({ id, c });};card(c1, L"circle.lefthalf.filled", 0xE793, Tr(L"Modo Escuro"), dark, H_DARK);- card(c2, L"sun.max", 0xE706, L"Night Shift", false, H_NIGHT);+ card(c2, L"sun.max", 0xE706, Tr(L"Night Shift"), false, H_NIGHT);y += 69;tail(Tr(L"Ajustes de Tela…"));break;@@ -1707,7 +1707,7 @@ void PaintTahoe() {r = D2D1::RectF(g_dragPt.x - hw, g_dragPt.y - hh, g_dragPt.x + hw, g_dragPt.y + hh);}if (id == L"wifi") capsule(r, H_WIFI_BTN, H_WIFI, sl.c->sym, sl.c->fb, L"Wi‑Fi", wifiSub, st.radio[0] == 1, blue);- else if (id == L"bluetooth") capsule(r, H_BT_BTN, H_BT, sl.c->sym, sl.c->fb, L"Bluetooth", btSub, st.radio[1] == 1, blue);+ else if (id == L"bluetooth") capsule(r, H_BT_BTN, H_BT, sl.c->sym, sl.c->fb, Tr(L"Bluetooth"), btSub, st.radio[1] == 1, blue);else if (id == L"airdrop") capsule(r, H_AIRDROP, H_AIRDROP, sl.c->sym, sl.c->fb, L"AirDrop", airSub, st.airdrop > 0, blue);else if (id == L"foco") capsule(r, H_FOCUS, H_FOCUS_TEXT, sl.c->sym, sl.c->fb, Tr(L"Foco"), L"", st.focus, D2D1::ColorF(0.37f, 0.36f, 0.90f, 1));else if (id == L"tocando") nowPlaying(r);diff --git a/src/shell/ilha.cpp b/src/shell/ilha.cppindex dbd5cab..3007ebd 100644--- a/src/shell/ilha.cpp+++ b/src/shell/ilha.cpp@@ -1377,7 +1377,7 @@ void DrawTimer(ID2D1DeviceContext* dc, ID2D1SolidColorBrush* br, D2D1_RECT_F b,float x = L + (i % 3) * (cw + gap), y = y0 + 6 + (i / 3) * (ch + gap);D2D1_RECT_F r = D2D1::RectF(x, y, x + cw, y + ch);Chip(dc, br, r, ChipR(ch), Hover(H_PRESET, mins[i]) ? (g_pressHit == H_PRESET ? 2.f : 1.f) : 0.f);- Text(dc, br, std::to_wstring(mins[i]) + L" min", g_tfChip, r, WHITE);+ Text(dc, br, std::to_wstring(mins[i]) + Tr(L" min"), g_tfChip, r, WHITE);AddHit(H_PRESET, r, mins[i]);}return;@@ -1410,7 +1410,7 @@ void DrawTimer(ID2D1DeviceContext* dc, ID2D1SolidColorBrush* br, D2D1_RECT_F b,D2D1_RECT_F rp = D2D1::RectF(x, by - 14, x + 28, by + 14), rs = D2D1::RectF(x + 36, by - 14, x + 64, by + 14), r1 = D2D1::RectF(x + 128, by - 13, x + 180, by + 13);D2D1_RECT_F rm = D2D1::RectF(x + 72, by - 13, x + 122, by + 13);Chip(dc, br, rm, ChipR(26), Hover(H_TMINUS) ? 1.f : 0.f);- Text(dc, br, L"−1 min", g_tfChip, rm, left > 61000 ? WHITE : GRAY);+ Text(dc, br, Tr(L"−1 min"), g_tfChip, rm, left > 61000 ? WHITE : GRAY);AddHit(H_TMINUS, rm);Chip(dc, br, rp, 14, Hover(H_TPAUSE) ? 1.f : 0.f);if (g_tPaused) Sym(dc, br, L"play.fill", Around(x + 15, by, 10, 11), ORANGE);@@ -1418,7 +1418,7 @@ void DrawTimer(ID2D1DeviceContext* dc, ID2D1SolidColorBrush* br, D2D1_RECT_F b,Chip(dc, br, rs, 14, Hover(H_TSTOP) ? 1.f : 0.f);Glyph(dc, br, 0xE711, g_tfIconS, rs, WHITE);Chip(dc, br, r1, ChipR(26), Hover(H_TPLUS) ? 1.f : 0.f);- Text(dc, br, L"+1 min", g_tfChip, r1, WHITE);+ Text(dc, br, Tr(L"+1 min"), g_tfChip, r1, WHITE);AddHit(H_TPAUSE, rp); AddHit(H_TSTOP, rs); AddHit(H_TPLUS, r1);}@@ -1585,7 +1585,7 @@ void DrawContent(ID2D1DeviceContext* dc, ID2D1SolidColorBrush* br, Mode m, doublDrawProgressT(dc, br, D2D1::RectF(std::max(rr - 120, wingL + 28), cy - 2, rr, cy + 2), g_bri);} else if (g_hud == HUD_CAPS) {Glyph(dc, br, 0xE765, g_tfIconS, D2D1::RectF(wingL, cy - 9, wingL + 22, cy + 9), g_caps ? GREEN : GRAY);- Text(dc, br, g_caps ? L"Caps Lock" : Tr(L"Caps Lock desligado"), g_tfWingR, D2D1::RectF(rr - 130, cy - 8, rr, cy + 8), g_caps ? GREEN : GRAY);+ Text(dc, br, g_caps ? Tr(L"Caps Lock") : Tr(L"Caps Lock desligado"), g_tfWingR, D2D1::RectF(rr - 130, cy - 8, rr, cy + 8), g_caps ? GREEN : GRAY);} else if (g_hud == HUD_SHOT) { // "Captura feita" (issue #8): a câmera e o texto, rapidinhoSym(dc, br, L"camera.fill", D2D1::RectF(wingL + 2, cy - 6, wingL + 18, cy + 6), WHITE);Text(dc, br, g_shotClip ? Tr(L"Captura copiada") : Tr(L"Captura feita"), g_tfWingR, D2D1::RectF(rr - 150, cy - 8, rr, cy + 8), WHITE);diff --git a/src/shell/launchpad.cpp b/src/shell/launchpad.cppindex 745638d..8519326 100644--- a/src/shell/launchpad.cpp+++ b/src/shell/launchpad.cpp@@ -219,7 +219,10 @@ void Loader() {for (auto& c : p) c = towlower(c);if (p.size() >= low.size() && !p.compare(p.size() - low.size(), low.size(), low)) { tem = true; break; }}- if (!tem) { LApp a; a.name = n[1]; a.parsing = exe; a.proprio = true; found.push_back(std::move(a)); }+ if (!tem) { // o nome no idioma do WacOS (antes ficava o inglês da tabela em qualquer idioma)+ LApp a; std::wstring nome = apps::OurName(exe);+ a.name = nome.empty() ? n[1] : nome; a.parsing = exe; a.proprio = true; found.push_back(std::move(a));+ }}}std::sort(found.begin(), found.end(), [](const LApp& a, const LApp& b) { return _wcsicmp(a.name.c_str(), b.name.c_str()) < 0; });@@ -306,13 +309,17 @@ int CategoryOf(const std::wstring& name) {return NCATS - 1; // Outros}+// a categoria de um app da lista: os nossos (proprio) têm o nome no idioma do WacOS, que as palavras acima não+// conhecem; o caminho do exe (WacOSCalculator, WacOSClock...) leva junto o nome em inglês+int CatOf(const LApp& a) { return CategoryOf(a.proprio ? a.name + L" " + a.parsing : a.name); }+void Filter() {g_view.clear();std::wstring q = g_query;for (auto& c : q) c = towlower(c);bool cats = liquid::On() && g_cat > 0;for (int i = 0; i < (int)g_all.size(); i++) {- if (cats && CategoryOf(g_all[i].name) != g_cat) continue;+ if (cats && CatOf(g_all[i]) != g_cat) continue;if (launchpad::Escondido(g_all[i].name, g_all[i].parsing)) continue; // tirado (modo tremendo, botão direito) ou do sistemaif (!q.empty()) {std::wstring n = g_all[i].name;@@ -470,7 +477,7 @@ std::vector<std::pair<std::wstring, std::vector<int>>> ApSections() {if (!sugg.empty()) out.push_back({ Tr(L"Sugestões"), sugg });for (int k = 1; k < NCATS; k++) {std::vector<int> v;- for (int i : g_view) if (CategoryOf(g_all[i].name) == k) v.push_back(i);+ for (int i : g_view) if (CatOf(g_all[i]) == k) v.push_back(i);if (!v.empty()) out.push_back({ Tr(CATS[k]), v });}return out;diff --git a/src/shell/menubar.cpp b/src/shell/menubar.cppindex 1bc1b6c..5df3ac8 100644--- a/src/shell/menubar.cpp+++ b/src/shell/menubar.cpp@@ -261,7 +261,7 @@ const KeyCmd g_keyCmds[] = {};ctxmenu::Item K(int id) {- for (auto& k : g_keyCmds) if (k.id == id) { ctxmenu::Item i; i.label = Tr(k.label); i.id = id; i.shortcut = k.shortcut; return i; }+ for (auto& k : g_keyCmds) if (k.id == id) { ctxmenu::Item i; i.label = Tr(k.label); i.id = id; i.shortcut = Tr(k.shortcut); return i; }return {};}ctxmenu::Item I(const std::wstring& label, int id, bool disabled = false, bool checked = false) {diff --git a/src/shell/shell.h b/src/shell/shell.hindex fe8dbd4..d3d5fcc 100644--- a/src/shell/shell.h+++ b/src/shell/shell.h@@ -165,6 +165,7 @@ extern std::vector<std::wstring> recent; // ids dos últimos apps fechados (atvoid Load(const std::wstring& finderExe);void Save();void Relabel(); // nomes dos nossos apps no idioma escolhido (Ajustes > Geral > Idioma)+std::wstring OurName(const std::wstring& exe); // nome de um dos nossos apps no idioma escolhido (caminho ou nome do .exe); vazio: não é nossobool Refresh(); // relê as janelas; true se algo mudoustd::wstring IdOfWindow(HWND h);App* FindById(const std::wstring& id);diff --git a/src/shell/widgets.cpp b/src/shell/widgets.cppindex b8fa549..a9c7a8f 100644--- a/src/shell/widgets.cpp+++ b/src/shell/widgets.cpp@@ -464,8 +464,8 @@ void WorldOne(ID2D1DeviceContext* dc, ID2D1SolidColorBrush* br, ID2D1StrokeStylestd::wstring dia = dayDiff > 0 ? Tr(L"Amanhã") : dayDiff < 0 ? Tr(L"Ontem") : Tr(L"Hoje");long long ad = diff < 0 ? -diff : diff;wchar_t b[24];- if (ad % 60) swprintf_s(b, L"%ls%lld:%02lld H", diff < 0 ? L"−" : L"+", ad / 60, ad % 60);- else swprintf_s(b, L"%ls%lld H", diff < 0 ? L"−" : L"+", ad / 60);+ if (ad % 60) swprintf_s(b, Tr(L"%ls%lld:%02lld H"), diff < 0 ? L"−" : L"+", ad / 60, ad % 60);+ else swprintf_s(b, Tr(L"%ls%lld H"), diff < 0 ? L"−" : L"+", ad / 60);if (junto) Txt(dc, br, dia + L", " + b, 10, DWRITE_FONT_WEIGHT_MEDIUM, DWRITE_TEXT_ALIGNMENT_CENTER, D2D1::RectF(cx - col / 2, y + 18, cx + col / 2, y + 33), sub);else {Txt(dc, br, dia, 10, DWRITE_FONT_WEIGHT_MEDIUM, DWRITE_TEXT_ALIGNMENT_CENTER, D2D1::RectF(cx - col / 2, y + 18, cx + col / 2, y + 33), sub);@@ -495,7 +495,7 @@ void PaintWorld(ID2D1DeviceContext* dc, ID2D1SolidColorBrush* br, ID2D1StrokeStyvoid PaintWeather(ID2D1DeviceContext* dc, ID2D1SolidColorBrush* br, float w, float h, bool dark) {Weather wx; { std::lock_guard<std::mutex> lk(g_mx); wx = g_wx; }if (!dark) Sky(dc, w, h, wx.ok ? wx.code : 0, wx.ok ? wx.day : true);- std::wstring city = City();+ std::wstring city = Tr(City()); // a cidade padrão (inglês, cidade_padrao.h) no idioma do WacOSwchar_t b[64];if (w < SMALL + 1) { // pequeno: a cidade, a temperatura grande e, embaixo, o ícone, a condição e a máxima/mínimadc->PushAxisAlignedClip(D2D1::RectF(0, 0, w - 12, h), D2D1_ANTIALIAS_MODE_ALIASED);diff --git a/src/timemachine/main.cpp b/src/timemachine/main.cppindex b6eca3c..9b5491a 100644--- a/src/timemachine/main.cpp+++ b/src/timemachine/main.cpp@@ -100,7 +100,7 @@ void Paint() {if (!g_icon) g_icon = LoadIcon();if (g_icon) rt->DrawBitmap(g_icon, D2D1::RectF(36, 40, 196, 200), 1, D2D1_BITMAP_INTERPOLATION_MODE_LINEAR);float X = 230, W = sz.width - 30;- Text(L"Time Machine", g_tfTitle, D2D1::RectF(X, 34, W, 70), text);+ Text(TrPick(L"Time Machine", L"Time Machine"), g_tfTitle, D2D1::RectF(X, 34, W, 70), text);if (!g_cfg) { Text(Tr(L"O Histórico de Arquivos do Windows não está disponível neste computador."), g_tfRow, D2D1::RectF(X, 80, W, 110), gray); EndPaint(); return; }if (!g_hasConfig) {Text(Tr(L"Os backups ainda não foram configurados."), g_tfRow, D2D1::RectF(X, 80, W, 110), gray);@@ -261,7 +261,7 @@ int WINAPI wWinMain(HINSTANCE hi, HINSTANCE, PWSTR, int show) {g_tfLabel = Fmt(13);g_tfBtn = Fmt(13, DWRITE_FONT_WEIGHT_MEDIUM, DWRITE_TEXT_ALIGNMENT_CENTER);g_tfSmall = Fmt(12);- if (!CreateMain(hi, L"TimeMachineJanela", L"Time Machine", Proc, 780, 470)) return 1;+ if (!CreateMain(hi, L"TimeMachineJanela", TrPick(L"Time Machine", L"Time Machine"), Proc, 780, 470)) return 1;SetTimer(wnd, 1, 10000, nullptr);ShowWindow(wnd, show);return Run();