Translate all UI strings to English

This commit is contained in:
SW 2026-06-15 13:47:05 +02:00
parent 8d92110c58
commit aa3b5e09df
3 changed files with 13 additions and 13 deletions

View file

@ -28,10 +28,10 @@ use crate::events::{handle_event, poll_event};
#[derive(Parser, Debug)] #[derive(Parser, Debug)]
#[command(name = "lines")] #[command(name = "lines")]
#[command(about = "TUI pro rychlé spouštění často používaných příkazů")] #[command(about = "TUI for running frequently used commands")]
#[command(version)] #[command(version)]
struct Args { struct Args {
/// Cesta k datové složce (výchozí: ~/.lines) /// Path to the data directory (default: ~/.lines)
#[arg(short, long)] #[arg(short, long)]
dir: Option<PathBuf>, dir: Option<PathBuf>,
} }
@ -43,7 +43,7 @@ fn main() -> io::Result<()> {
// Ensure data directory exists // Ensure data directory exists
if let Err(e) = std::fs::create_dir_all(&config.data_dir) { if let Err(e) = std::fs::create_dir_all(&config.data_dir) {
eprintln!( eprintln!(
"Nepodařilo se vytvořit datovou složku {}: {}", "Failed to create data directory {}: {}",
config.data_dir.display(), config.data_dir.display(),
e e
); );

View file

@ -157,10 +157,10 @@ mod tests {
#[test] #[test]
fn test_parse_markdown_run_all() { fn test_parse_markdown_run_all() {
let input = "# Spustí vše\n\n# Docker update\nssh root@192.168.53.3 /opt/mealie/update.sh\nssh root@192.168.53.5 /opt/yamtrack/update.sh\n"; let input = "# Run all\n\n# Docker update\nssh admin@host1.example.com /opt/app/update.sh\nssh admin@host2.example.com /opt/app/update.sh\n";
let sections = parse_markdown(input); let sections = parse_markdown(input);
assert_eq!(sections.len(), 2); assert_eq!(sections.len(), 2);
assert_eq!(sections[0].title, "Spustí vše"); assert_eq!(sections[0].title, "Run all");
assert!(sections[0].commands.is_empty()); assert!(sections[0].commands.is_empty());
assert_eq!(sections[1].commands.len(), 2); assert_eq!(sections[1].commands.len(), 2);
} }

View file

@ -54,7 +54,7 @@ fn draw_groups(f: &mut Frame, app: &App, area: ratatui::layout::Rect) {
.collect(); .collect();
let block = Block::default() let block = Block::default()
.title(" Skupiny ") .title(" Groups ")
.borders(Borders::ALL) .borders(Borders::ALL)
.border_style(border_style(app.focus == Focus::Groups)); .border_style(border_style(app.focus == Focus::Groups));
@ -81,7 +81,7 @@ fn draw_files(f: &mut Frame, app: &App, area: ratatui::layout::Rect) {
.collect(); .collect();
let block = Block::default() let block = Block::default()
.title(" Soubory ") .title(" Files ")
.borders(Borders::ALL) .borders(Borders::ALL)
.border_style(border_style(app.focus == Focus::Files)); .border_style(border_style(app.focus == Focus::Files));
@ -96,7 +96,7 @@ fn draw_sections(f: &mut Frame, app: &App, area: ratatui::layout::Rect) {
.enumerate() .enumerate()
.map(|(i, section)| { .map(|(i, section)| {
let label = if section.is_run_all() { let label = if section.is_run_all() {
format!("{} (vše)", section.title) format!("{} (all)", section.title)
} else { } else {
section.title.clone() section.title.clone()
}; };
@ -113,7 +113,7 @@ fn draw_sections(f: &mut Frame, app: &App, area: ratatui::layout::Rect) {
.collect(); .collect();
let block = Block::default() let block = Block::default()
.title(" Příkazy ") .title(" Commands ")
.borders(Borders::ALL) .borders(Borders::ALL)
.border_style(border_style(app.focus == Focus::Sections)); .border_style(border_style(app.focus == Focus::Sections));
@ -125,7 +125,7 @@ fn draw_preview(f: &mut Frame, app: &App, area: ratatui::layout::Rect) {
let text = match app.current_section() { let text = match app.current_section() {
Some(section) => { Some(section) => {
let title = if section.is_run_all() { let title = if section.is_run_all() {
format!("{} — spustí všechny příkazy v souboru", section.title) format!("{} — runs all commands in this file", section.title)
} else { } else {
section.title.clone() section.title.clone()
}; };
@ -161,11 +161,11 @@ fn draw_preview(f: &mut Frame, app: &App, area: ratatui::layout::Rect) {
Text::from(lines) Text::from(lines)
} }
None => Text::from("Žádný příkaz k zobrazení."), None => Text::from("No command to display."),
}; };
let block = Block::default() let block = Block::default()
.title(" Náhled ") .title(" Preview ")
.borders(Borders::ALL); .borders(Borders::ALL);
let paragraph = Paragraph::new(text).block(block).wrap(Wrap { trim: true }); let paragraph = Paragraph::new(text).block(block).wrap(Wrap { trim: true });
@ -173,7 +173,7 @@ fn draw_preview(f: &mut Frame, app: &App, area: ratatui::layout::Rect) {
} }
fn draw_status(f: &mut Frame, app: &App, area: ratatui::layout::Rect) { fn draw_status(f: &mut Frame, app: &App, area: ratatui::layout::Rect) {
let help = "↑/↓ nebo j/k: pohyb | →/←: panel | Enter: spustit | e: editovat | r: reload | q: konec"; let help = "↑/↓ or j/k: move | →/← or h/l: panel | Enter: run | o: open in new window | e: edit | r: reload | q: quit";
let text = match &app.message { let text = match &app.message {
Some(msg) => Text::from(msg.as_str()), Some(msg) => Text::from(msg.as_str()),
None => Text::from(help), None => Text::from(help),