Translate UI to Swedish

This commit is contained in:
2026-03-23 10:46:39 +01:00
parent 1929b3ed49
commit bc586e21e7
3 changed files with 29 additions and 29 deletions

View File

@@ -105,14 +105,14 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
let args: Vec<String> = env::args().collect();
if args.len() != 2 {
eprintln!("Usage: {} <csv-file>", args[0]);
eprintln!("Användning: {} <csv-fil>", args[0]);
std::process::exit(1);
}
let input_path = Path::new(&args[1]);
if !input_path.exists() {
eprintln!("Error: File not found: {:?}", input_path);
eprintln!("Fel: Filen hittades inte: {:?}", input_path);
std::process::exit(1);
}
@@ -124,7 +124,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
let batch = read_csv_file(input_path)?;
println!(
"Loaded {} transactions from {}",
"Laddade {} transaktioner från {}",
batch.transactions.len(),
batch.filename
);
@@ -159,11 +159,11 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
.unwrap();
let filename = format!("customer_{}.html", customer_num);
fs::write(output_dir.join(&filename), customer_html)?;
println!("Generated {}", filename);
println!("Genererade {}", filename);
}
println!(
"\nGenerated {} customer invoices in {:?}",
"\nGenererade {} kundfakturor i {:?}",
customer_count, output_dir
);

View File

@@ -1,8 +1,8 @@
<!DOCTYPE html>
<html lang="en">
<html lang="sv">
<head>
<meta charset="UTF-8">
<title>Invoice - Customer {{ customer.customer_number }}</title>
<title>Faktura - Kund {{ customer.customer_number }}</title>
<style>
@page {
size: A4;
@@ -103,32 +103,32 @@
<body>
<div class="header">
<div>
<h1>Invoice - Customer {{ customer.customer_number }}</h1>
<div>Batches: {{ batches | join(", ") }}</div>
<h1>Faktura - Kund {{ customer.customer_number }}</h1>
<div>Batchar: {{ batches | join(", ") }}</div>
</div>
<div class="meta">
<div>Generated: {{ generated_date }}</div>
<div>Genererad: {{ generated_date }}</div>
</div>
</div>
{% for card in customer.cards %}
<div class="card-section">
<div class="card-header">
<span>Card: {{ card.card_number }}</span>
<span>{{ card.transactions.len() }} transactions</span>
<span>Kort: {{ card.card_number }}</span>
<span>{{ card.transactions.len() }} transaktioner</span>
</div>
<div class="card-summary">
Total: {{ card.total_amount }} | Volume: {{ card.total_volume }} L
Summa: {{ card.total_amount }} | Volym: {{ card.total_volume }} L
</div>
<table>
<thead>
<tr>
<th class="date">Date</th>
<th>Product</th>
<th class="price">Price/L</th>
<th class="volume">Volume (L)</th>
<th class="amount">Amount</th>
<th>Receipt</th>
<th class="date">Datum</th>
<th>Produkt</th>
<th class="price">Pris/L</th>
<th class="volume">Volym (L)</th>
<th class="amount">Belopp</th>
<th>Kvitto</th>
</tr>
</thead>
<tbody>
@@ -143,7 +143,7 @@
</tr>
{% endfor %}
<tr class="card-total">
<td colspan="3">Card Total</td>
<td colspan="3">Kortsumma</td>
<td class="volume">{{ card.total_volume }}</td>
<td class="amount">{{ card.total_amount }}</td>
<td></td>
@@ -154,7 +154,7 @@
{% endfor %}
<div class="grand-total">
Grand Total:<span>{{ customer.grand_total }}</span>
Totalsumma:<span>{{ customer.grand_total }}</span>
</div>
</body>
</html>

View File

@@ -1,8 +1,8 @@
<!DOCTYPE html>
<html lang="en">
<html lang="sv">
<head>
<meta charset="UTF-8">
<title>Invoice Overview</title>
<title>Fakturaöversikt</title>
<style>
@page {
size: A4;
@@ -59,18 +59,18 @@
</style>
</head>
<body>
<h1>Invoice Overview</h1>
<h1>Fakturaöversikt</h1>
<div class="batch-info">
<strong>Processed Batches:</strong> {{ batches | join(", ") }}
<strong>Bearbetade batchar:</strong> {{ batches | join(", ") }}
</div>
<table>
<thead>
<tr>
<th>Customer Number</th>
<th>Cards</th>
<th>Invoice</th>
<th>Kundnummer</th>
<th>Kort</th>
<th>Faktura</th>
</tr>
</thead>
<tbody>
@@ -78,7 +78,7 @@
<tr>
<td>{{ num }}</td>
<td>{{ card_count }}</td>
<td><a href="customer_{{ num }}.html">View</a></td>
<td><a href="customer_{{ num }}.html">Visa</a></td>
</tr>
{% endfor %}
</tbody>