Translate UI to Swedish
This commit is contained in:
10
src/main.rs
10
src/main.rs
@@ -105,14 +105,14 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
let args: Vec<String> = env::args().collect();
|
let args: Vec<String> = env::args().collect();
|
||||||
|
|
||||||
if args.len() != 2 {
|
if args.len() != 2 {
|
||||||
eprintln!("Usage: {} <csv-file>", args[0]);
|
eprintln!("Användning: {} <csv-fil>", args[0]);
|
||||||
std::process::exit(1);
|
std::process::exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
let input_path = Path::new(&args[1]);
|
let input_path = Path::new(&args[1]);
|
||||||
|
|
||||||
if !input_path.exists() {
|
if !input_path.exists() {
|
||||||
eprintln!("Error: File not found: {:?}", input_path);
|
eprintln!("Fel: Filen hittades inte: {:?}", input_path);
|
||||||
std::process::exit(1);
|
std::process::exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -124,7 +124,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
|
|
||||||
let batch = read_csv_file(input_path)?;
|
let batch = read_csv_file(input_path)?;
|
||||||
println!(
|
println!(
|
||||||
"Loaded {} transactions from {}",
|
"Laddade {} transaktioner från {}",
|
||||||
batch.transactions.len(),
|
batch.transactions.len(),
|
||||||
batch.filename
|
batch.filename
|
||||||
);
|
);
|
||||||
@@ -159,11 +159,11 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
.unwrap();
|
.unwrap();
|
||||||
let filename = format!("customer_{}.html", customer_num);
|
let filename = format!("customer_{}.html", customer_num);
|
||||||
fs::write(output_dir.join(&filename), customer_html)?;
|
fs::write(output_dir.join(&filename), customer_html)?;
|
||||||
println!("Generated {}", filename);
|
println!("Genererade {}", filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
println!(
|
println!(
|
||||||
"\nGenerated {} customer invoices in {:?}",
|
"\nGenererade {} kundfakturor i {:?}",
|
||||||
customer_count, output_dir
|
customer_count, output_dir
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="sv">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<title>Invoice - Customer {{ customer.customer_number }}</title>
|
<title>Faktura - Kund {{ customer.customer_number }}</title>
|
||||||
<style>
|
<style>
|
||||||
@page {
|
@page {
|
||||||
size: A4;
|
size: A4;
|
||||||
@@ -103,32 +103,32 @@
|
|||||||
<body>
|
<body>
|
||||||
<div class="header">
|
<div class="header">
|
||||||
<div>
|
<div>
|
||||||
<h1>Invoice - Customer {{ customer.customer_number }}</h1>
|
<h1>Faktura - Kund {{ customer.customer_number }}</h1>
|
||||||
<div>Batches: {{ batches | join(", ") }}</div>
|
<div>Batchar: {{ batches | join(", ") }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="meta">
|
<div class="meta">
|
||||||
<div>Generated: {{ generated_date }}</div>
|
<div>Genererad: {{ generated_date }}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% for card in customer.cards %}
|
{% for card in customer.cards %}
|
||||||
<div class="card-section">
|
<div class="card-section">
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<span>Card: {{ card.card_number }}</span>
|
<span>Kort: {{ card.card_number }}</span>
|
||||||
<span>{{ card.transactions.len() }} transactions</span>
|
<span>{{ card.transactions.len() }} transaktioner</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-summary">
|
<div class="card-summary">
|
||||||
Total: {{ card.total_amount }} | Volume: {{ card.total_volume }} L
|
Summa: {{ card.total_amount }} | Volym: {{ card.total_volume }} L
|
||||||
</div>
|
</div>
|
||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th class="date">Date</th>
|
<th class="date">Datum</th>
|
||||||
<th>Product</th>
|
<th>Produkt</th>
|
||||||
<th class="price">Price/L</th>
|
<th class="price">Pris/L</th>
|
||||||
<th class="volume">Volume (L)</th>
|
<th class="volume">Volym (L)</th>
|
||||||
<th class="amount">Amount</th>
|
<th class="amount">Belopp</th>
|
||||||
<th>Receipt</th>
|
<th>Kvitto</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@@ -143,7 +143,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
<tr class="card-total">
|
<tr class="card-total">
|
||||||
<td colspan="3">Card Total</td>
|
<td colspan="3">Kortsumma</td>
|
||||||
<td class="volume">{{ card.total_volume }}</td>
|
<td class="volume">{{ card.total_volume }}</td>
|
||||||
<td class="amount">{{ card.total_amount }}</td>
|
<td class="amount">{{ card.total_amount }}</td>
|
||||||
<td></td>
|
<td></td>
|
||||||
@@ -154,7 +154,7 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
<div class="grand-total">
|
<div class="grand-total">
|
||||||
Grand Total:<span>{{ customer.grand_total }}</span>
|
Totalsumma:<span>{{ customer.grand_total }}</span>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="sv">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<title>Invoice Overview</title>
|
<title>Fakturaöversikt</title>
|
||||||
<style>
|
<style>
|
||||||
@page {
|
@page {
|
||||||
size: A4;
|
size: A4;
|
||||||
@@ -59,18 +59,18 @@
|
|||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1>Invoice Overview</h1>
|
<h1>Fakturaöversikt</h1>
|
||||||
|
|
||||||
<div class="batch-info">
|
<div class="batch-info">
|
||||||
<strong>Processed Batches:</strong> {{ batches | join(", ") }}
|
<strong>Bearbetade batchar:</strong> {{ batches | join(", ") }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Customer Number</th>
|
<th>Kundnummer</th>
|
||||||
<th>Cards</th>
|
<th>Kort</th>
|
||||||
<th>Invoice</th>
|
<th>Faktura</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@@ -78,7 +78,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td>{{ num }}</td>
|
<td>{{ num }}</td>
|
||||||
<td>{{ card_count }}</td>
|
<td>{{ card_count }}</td>
|
||||||
<td><a href="customer_{{ num }}.html">View</a></td>
|
<td><a href="customer_{{ num }}.html">Visa</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|||||||
Reference in New Issue
Block a user