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
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:
1 parent
da212e6926
commit
6328220c60
129 files changed
+1961
-1834
No files matched your search
@@ -1,8 +1,8 @@
|
||||
//! Gerador mínimo de PDF (A4, texto e tabelas) para o relatório de recuperação.
|
||||
//! Minimal standalone PDF generator (A4, text, and tables) for forensic recovery reports.
|
||||
//!
|
||||
//! Usa só as fontes padrão do PDF (Helvetica, Helvetica-Bold e Courier) com codificação
|
||||
//! WinAnsi, então o arquivo é autocontido e não depende de fontes instaladas. Caracteres fora
|
||||
//! do Latin-1/WinAnsi viram `?`.
|
||||
//! Uses only built-in PDF Type 1 fonts (Helvetica, Helvetica-Bold, and Courier) with WinAnsi
|
||||
//! encoding so output files are self-contained with no embedded font dependencies. Characters
|
||||
//! outside Latin-1/WinAnsi are replaced with `?`.
|
||||
|
||||
use flate2::write::ZlibEncoder;
|
||||
use flate2::Compression;
|
||||
@@ -29,7 +29,7 @@ impl Font {
|
||||
}
|
||||
}
|
||||
|
||||
// Larguras AFM (milésimos de em) dos caracteres ASCII 32..=126.
|
||||
// AFM glyph widths (in thousandths of an em) for ASCII 32..=126.
|
||||
const HELV: [u16; 95] = [
|
||||
278, 278, 355, 556, 556, 889, 667, 191, 333, 333, 389, 584, 278, 333, 278, 278, 556, 556, 556,
|
||||
556, 556, 556, 556, 556, 556, 556, 278, 278, 584, 584, 584, 556, 1015, 667, 667, 722, 722, 667,
|
||||
@@ -45,7 +45,7 @@ const HELV_B: [u16; 95] = [
|
||||
278, 889, 611, 611, 611, 611, 389, 556, 333, 611, 556, 778, 556, 556, 500, 389, 280, 389, 584,
|
||||
];
|
||||
|
||||
/// Letra base de um caractere acentuado do Latin-1 (a largura é a da letra sem acento).
|
||||
/// Maps a Latin-1 accented character to its ASCII base letter for glyph width lookup.
|
||||
fn base_letter(c: char) -> char {
|
||||
match c {
|
||||
'À'..='Å' => 'A',
|
||||
@@ -88,7 +88,7 @@ pub fn text_width(s: &str, size: f64, f: Font) -> f64 {
|
||||
s.chars().map(|c| char_width(c, f)).sum::<f64>() * size
|
||||
}
|
||||
|
||||
/// Byte WinAnsi de um caractere (ou `?`).
|
||||
/// Converts a Unicode char to its WinAnsi byte (or `?` if unrepresentable).
|
||||
fn win_ansi(c: char) -> u8 {
|
||||
let n = c as u32;
|
||||
match c {
|
||||
@@ -120,8 +120,8 @@ fn escape(s: &str) -> String {
|
||||
o
|
||||
}
|
||||
|
||||
/// Quebra `s` em linhas de no máximo `width` pontos. Sem espaço onde quebrar (caminhos,
|
||||
/// hashes), corta no meio da palavra.
|
||||
/// Greedy word-wraps `s` into lines of at most `width` points. Long tokens without spaces
|
||||
/// (paths, hashes) are broken mid-token.
|
||||
pub fn wrap(s: &str, size: f64, f: Font, width: f64) -> Vec<String> {
|
||||
let mut lines = vec![];
|
||||
for para in s.split('\n') {
|
||||
@@ -270,7 +270,7 @@ impl Pdf {
|
||||
self.y -= 3.0;
|
||||
}
|
||||
|
||||
/// Aviso destacado com barra lateral.
|
||||
/// Renders a highlighted callout box with a colored left accent bar.
|
||||
pub fn note(&mut self, s: &str) {
|
||||
let size = 9.0;
|
||||
let lines = wrap(s, size, Font::Regular, Self::content_width() - 16.0);
|
||||
@@ -292,7 +292,7 @@ impl Pdf {
|
||||
self.y -= h + 6.0;
|
||||
}
|
||||
|
||||
/// Linhas rótulo/valor; o valor pode ser monoespaçado.
|
||||
/// Renders key/value metadata rows (with optional monospace value styling).
|
||||
pub fn kv(&mut self, rows: &[(&str, &str, Font)]) {
|
||||
let lw = 140.0;
|
||||
let size = 9.5;
|
||||
@@ -318,7 +318,7 @@ impl Pdf {
|
||||
self.y -= 4.0;
|
||||
}
|
||||
|
||||
/// Tabela com cabeçalho repetido a cada página e linhas que quebram texto.
|
||||
/// Renders a multi-page table with repeating headers and wrapped cell text.
|
||||
pub fn table(&mut self, cols: &[Col], rows: &[Vec<String>]) {
|
||||
let size = 8.0;
|
||||
let pad = 3.0;
|
||||
@@ -391,7 +391,7 @@ impl Pdf {
|
||||
self.y -= 6.0;
|
||||
}
|
||||
|
||||
/// Fecha o documento. `date` é a data de criação em UTC (`AAAAMMDDHHMMSS`).
|
||||
/// Finalizes and serializes the PDF document. `date` is the UTC creation timestamp (`YYYYMMDDHHMMSS`).
|
||||
pub fn finish(mut self, date: &str) -> Vec<u8> {
|
||||
if !self.cur.is_empty() || self.pages.is_empty() {
|
||||
self.pages.push(std::mem::take(&mut self.cur));
|
||||
@@ -416,7 +416,7 @@ impl Pdf {
|
||||
out.extend_from_slice(body);
|
||||
out.extend_from_slice(b"\nendobj\n");
|
||||
};
|
||||
// 1 catálogo, 2 páginas, 3-5 fontes, 6 info, depois (página, conteúdo) por página
|
||||
// PDF objects: 1 catalog, 2 pages root, 3-5 fonts, 6 info dict, then (page, content stream) per page
|
||||
obj(&mut out, b"<< /Type /Catalog /Pages 2 0 R >>");
|
||||
let kids: String = (0..total)
|
||||
.map(|i| format!("{} 0 R", 7 + 2 * i))
|
||||
|
||||
Reference in new issue
Block a user