chore(i18n): finish translating code comments and scripts to English
CI / Format and clippy (push) Successful in 1m57s
CI / Dependency audit (push) Successful in 13s
CI / Check desktop app (Linux) (push) Successful in 3m54s
CI / Tests (Linux) (push) Failing after 7m25s
Release / Create release (push) Successful in 6s
Release / CLI (linux-aarch64) (push) Successful in 1m48s
Release / CLI (linux-x86_64) (push) Successful in 2m39s
Release / Desktop app (linux-aarch64) (push) Successful in 10m9s
Release / Desktop app (linux-x86_64) (push) Successful in 12m20s
Release / Desktop app (windows) (push) Successful in 7m32s
Release / Build latest.json (push) Successful in 5s

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:43:02 -03:00
1 parent da212e6926
commit 6328220c60
129 files changed
+1961 -1834

No files matched your search

+15 -15
View File
@@ -1,4 +1,4 @@
//! Carving por assinatura/estrutura sobre intervalos de bytes.
//! Signature- and structure-based file carving over byte ranges.
use crate::signatures::{category_for_ext, detect, might_start, Hit};
use crate::source::Source;
@@ -14,9 +14,9 @@ pub struct CarveCfg<'a> {
pub categories: &'a [Category],
}
/// Varre [start, end) a partir de `*next`. Chama `on_hit(offset, hit)` e retorna
/// `true` se terminou o intervalo (`false` se cancelado).
/// `advance(done_bytes)` informa o progresso dentro do intervalo.
/// Scans `[start, end)` starting from `*next`. Calls `on_hit(offset, hit)` and returns
/// `true` if the range completed (`false` if cancelled).
/// `advance(done_bytes)` reports progress within the range.
pub fn carve_range(
src: &dyn Source,
start: u64,
@@ -28,7 +28,7 @@ pub fn carve_range(
) -> CarveEnd {
let end = end.min(src.size());
let mut pos = (*next).max(start);
// Alinha ao setor.
// Align to sector boundary.
pos = pos.div_ceil(SECTOR) * SECTOR;
let mut buf = vec![0u8; CHUNK + LOOKAHEAD];
let mut skip_until = 0u64;
@@ -45,13 +45,13 @@ pub fn carve_range(
n
}
Err(_) => {
// Várias falhas seguidas = dispositivo sumiu: para com o ponto de retomada salvo.
// Multiple consecutive read failures = device disconnected: stop with resume point saved.
fails += 1;
if fails >= 4 {
*next = pos - (fails as u64 - 1) * CHUNK as u64;
return CarveEnd::IoLost;
}
// Setor ruim isolado: pula um bloco inteiro e segue (a imagem forense trata isso melhor).
// Isolated bad sector: skip a full block and continue (forensic imaging handles bad sectors better).
pos += CHUNK as u64;
ev.advance(CHUNK as u64);
*next = pos;
@@ -100,30 +100,30 @@ pub fn carve_range(
CarveEnd::Done
}
/// Como o carving de um intervalo terminou.
/// Outcome of carving a byte range.
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum CarveEnd {
Done,
Cancelled,
/// Várias leituras seguidas falharam: o dispositivo provavelmente foi desconectado.
/// Multiple consecutive reads failed: the device was likely disconnected.
IoLost,
}
/// Receptor de eventos do carving.
/// Receiver for file-carving events.
pub trait CarveEvents {
fn advance(&mut self, bytes: u64);
/// Cada trecho lido, antes de procurar assinaturas (para indexar o que serve a recomposição).
/// Called for each chunk read before signature scanning (used to index candidate defrag clusters).
fn chunk(&mut self, _abs: u64, _data: &[u8]) {}
fn hit(&mut self, offset: u64, hit: &Hit) -> HitAction;
}
/// O que fazer depois de um acerto.
/// Action to take after a signature hit.
pub enum HitAction {
/// Pula o conteúdo do arquivo reconhecido (comportamento padrão).
/// Skip past the recognized file content (default behavior).
Skip,
/// Pula só estes bytes (arquivo cujo resto não é confiável).
/// Skip only this many bytes (when the remainder of the file is unreliable).
SkipLen(u64),
/// Segue setor a setor (acerto descartado).
/// Continue sector by sector (hit discarded).
Continue,
}