chore(i18n): finish translating code comments and scripts to English
CI / Format and clippy (push) Successful in 1m13s
CI / Dependency audit (push) Successful in 13s
CI / Tests (Linux) (push) Successful in 1m35s
Release / Create release (push) Successful in 7s
CI / Check desktop app (Linux) (push) Successful in 3m19s
Release / CLI (linux-aarch64) (push) Successful in 1m3s
Release / CLI (linux-x86_64) (push) Successful in 1m28s
Release / Desktop app (linux-aarch64) (push) Successful in 7m16s
Release / Desktop app (linux-x86_64) (push) Successful in 10m17s
Release / Desktop app (windows) (push) Successful in 4m54s

Completes the English-only standardization for code, comments, scripts
and CI templates (UI/CLI-facing strings stay bilingual pt-BR/en,
untouched). Covers the remaining crates/, apps/gui/ui/ and
apps/gui/src-tauri/ comments, .gitea/ workflow and template comments,
.githooks/ hooks, and the scripts/ source comments for the files
already renamed in a prior commit (check.sh, generate-logo.py,
install-hooks.sh).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VAyr8d7HuAdUGB6aA5xmDD
This commit is contained in:
Lucas RayanandClaude Sonnet 5 committed 2026-10-30 20:44:39 -03:00
1 parent bf059fd0bc
commit 55e19a8e5b
59 files changed
+935 -879

No files matched your search

+12 -12
View File
@@ -1,7 +1,7 @@
//! Descoberta de interfaces de rede e identificação das que são Wi-Fi.
//! Network interface enumeration and 802.11 wireless phy identification.
//!
//! Não depende de `iw`: lê direto de `/sys/class/net`, do mesmo jeito que o
//! próprio `iw`/`ip` fazem por baixo.
//! Reads directly from `/sys/class/net` on Linux, falling back to `iw` for
//! detailed interface mode inspection when available.
use crate::error::{Result, SabiaError};
use std::fs;
@@ -11,7 +11,7 @@ use std::path::{Path, PathBuf};
pub struct Interface {
pub name: String,
pub mac: String,
/// Caminho do phy (ex.: `phy0`), presente só em interfaces 802.11.
/// Wireless `wiphy` name (e.g. `"phy0"`), present only on 802.11 interfaces.
pub phy: Option<String>,
pub mode: Mode,
pub up: bool,
@@ -28,7 +28,7 @@ fn net_root() -> &'static Path {
Path::new("/sys/class/net")
}
/// Lista todas as interfaces de rede, Wi-Fi ou não (chamador filtra por `phy`).
/// Lists all network interfaces on the system (wireless interfaces have `phy.is_some()`).
pub fn list_all() -> Result<Vec<Interface>> {
let mut out = Vec::new();
for entry in fs::read_dir(net_root())? {
@@ -43,7 +43,7 @@ pub fn list_all() -> Result<Vec<Interface>> {
Ok(out)
}
/// Lista apenas interfaces com um `phy80211` (ou seja, rádios Wi-Fi).
/// Lists only 802.11 wireless interfaces (`phy80211` present).
pub fn list_wireless() -> Result<Vec<Interface>> {
Ok(list_all()?
.into_iter()
@@ -79,8 +79,8 @@ fn read_interface(name: &str) -> Result<Interface> {
.ok()
.and_then(|p| p.file_name().map(|f| f.to_string_lossy().into_owned()))
.or_else(|| {
// em alguns kernels phy80211 é um diretório real, não symlink;
// o nome do phy então vem do subdiretório "phyNN" dentro dele.
// On some kernels `phy80211` is a directory rather than a symlink;
// read the `"phyNN"` subdirectory inside it.
fs::read_dir(&phy80211)
.ok()
.and_then(|mut rd| rd.next())
@@ -106,10 +106,10 @@ fn read_interface(name: &str) -> Result<Interface> {
})
}
/// Lê o modo (`managed`/`monitor`) via `/sys/class/net/<if>/type` + `uevent`
/// não é suficiente (type é sempre ARPHRD_ETHER para Wi-Fi); a forma estável
/// sem libnl é delegar a leitura real ao `iw dev <if> info` quando disponível,
/// mantendo aqui um melhor-esforço local para não depender de root.
/// Reads the interface operating mode (`managed`/`monitor`) via `/sys/class/net/<if>/type`
/// and `iw dev <if> info` when available.
///
///
fn read_wireless_mode(name: &str) -> Mode {
match crate::netlink::iw_dev_type(name) {
Some(Mode::Monitor) => Mode::Monitor,