From 7a1a6f2868b7527156714208c11aace73c4fa2a4 Mon Sep 17 00:00:00 2001 From: Jonathan Baecker Date: Thu, 10 Oct 2024 17:57:01 +0200 Subject: [PATCH] update translations, remove help text from db and apply it only in frontend --- engine/src/db/models.rs | 20 ------------- engine/src/utils/config.rs | 21 ------------- frontend/components/ConfigPlayout.vue | 39 +++++++++++++----------- frontend/i18n/locales/de-DE.js | 43 ++++++++++++++++----------- frontend/i18n/locales/en-US.js | 42 ++++++++++++++++---------- frontend/i18n/locales/pt-BR.js | 43 +++++++++++++++++---------- frontend/i18n/locales/ru-RU.js | 42 ++++++++++++++++---------- migrations/00001_create_tables.sql | 10 ------- 8 files changed, 126 insertions(+), 134 deletions(-) diff --git a/engine/src/db/models.rs b/engine/src/db/models.rs index 2f9abc29..a58b3500 100644 --- a/engine/src/db/models.rs +++ b/engine/src/db/models.rs @@ -267,23 +267,19 @@ where pub struct Configuration { pub id: i32, pub channel_id: i32, - pub general_help: String, pub general_stop_threshold: f64, - pub mail_help: String, pub mail_subject: String, pub mail_recipient: String, pub mail_level: String, pub mail_interval: i64, - pub logging_help: String, pub logging_ffmpeg_level: String, pub logging_ingest_level: String, pub logging_detect_silence: bool, #[serde(default)] pub logging_ignore: String, - pub processing_help: String, pub processing_mode: String, pub processing_audio_only: bool, pub processing_copy_audio: bool, @@ -311,34 +307,28 @@ pub struct Configuration { #[serde(default)] pub processing_vtt_dummy: Option, - pub ingest_help: String, pub ingest_enable: bool, pub ingest_param: String, #[serde(default)] pub ingest_filter: String, - pub playlist_help: String, pub playlist_day_start: String, pub playlist_length: String, pub playlist_infinit: bool, - pub storage_help: String, pub storage_filler: String, pub storage_extensions: String, pub storage_shuffle: bool, - pub text_help: String, pub text_add: bool, pub text_from_filename: bool, pub text_font: String, pub text_style: String, pub text_regex: String, - pub task_help: String, pub task_enable: bool, pub task_path: String, - pub output_help: String, pub output_mode: String, pub output_param: String, } @@ -348,19 +338,15 @@ impl Configuration { Self { id, channel_id, - general_help: config.general.help_text, general_stop_threshold: config.general.stop_threshold, - mail_help: config.mail.help_text, mail_subject: config.mail.subject, mail_recipient: config.mail.recipient, mail_level: config.mail.mail_level.to_string(), mail_interval: config.mail.interval, - logging_help: config.logging.help_text, logging_ffmpeg_level: config.logging.ffmpeg_level, logging_ingest_level: config.logging.ingest_level, logging_detect_silence: config.logging.detect_silence, logging_ignore: config.logging.ignore_lines.join(";"), - processing_help: config.processing.help_text, processing_mode: config.processing.mode.to_string(), processing_audio_only: config.processing.audio_only, processing_audio_track_index: config.processing.audio_track_index, @@ -381,28 +367,22 @@ impl Configuration { processing_filter: config.processing.custom_filter, processing_vtt_enable: config.processing.vtt_enable, processing_vtt_dummy: config.processing.vtt_dummy, - ingest_help: config.ingest.help_text, ingest_enable: config.ingest.enable, ingest_param: config.ingest.input_param, ingest_filter: config.ingest.custom_filter, - playlist_help: config.playlist.help_text, playlist_day_start: config.playlist.day_start, playlist_length: config.playlist.length, playlist_infinit: config.playlist.infinit, - storage_help: config.storage.help_text, storage_filler: config.storage.filler, storage_extensions: config.storage.extensions.join(";"), storage_shuffle: config.storage.shuffle, - text_help: config.text.help_text, text_add: config.text.add_text, text_font: config.text.font, text_from_filename: config.text.text_from_filename, text_style: config.text.style, text_regex: config.text.regex, - task_help: config.task.help_text, task_enable: config.task.enable, task_path: config.task.path.to_string_lossy().to_string(), - output_help: config.output.help_text, output_mode: config.output.mode.to_string(), output_param: config.output.output_param, } diff --git a/engine/src/utils/config.rs b/engine/src/utils/config.rs index 6d39024d..5d627187 100644 --- a/engine/src/utils/config.rs +++ b/engine/src/utils/config.rs @@ -199,7 +199,6 @@ impl Channel { #[derive(Debug, Default, Clone, Deserialize, Serialize)] pub struct General { - pub help_text: String, #[serde(skip_serializing, skip_deserializing)] pub id: i32, #[serde(skip_serializing, skip_deserializing)] @@ -222,7 +221,6 @@ pub struct General { impl General { fn new(config: &models::Configuration) -> Self { Self { - help_text: config.general_help.clone(), id: config.id, channel_id: config.channel_id, stop_threshold: config.general_stop_threshold, @@ -238,7 +236,6 @@ impl General { #[derive(Debug, Clone, Deserialize, Serialize)] pub struct Mail { - pub help_text: String, pub subject: String, #[serde(skip_serializing, skip_deserializing)] pub smtp_server: String, @@ -256,7 +253,6 @@ pub struct Mail { impl Mail { fn new(global: &models::GlobalSettings, config: &models::Configuration) -> Self { Self { - help_text: config.mail_help.clone(), subject: config.mail_subject.clone(), smtp_server: global.mail_smtp.clone(), starttls: global.mail_starttls, @@ -272,7 +268,6 @@ impl Mail { impl Default for Mail { fn default() -> Self { Mail { - help_text: String::default(), subject: String::default(), smtp_server: String::default(), starttls: bool::default(), @@ -287,7 +282,6 @@ impl Default for Mail { #[derive(Debug, Default, Clone, Deserialize, Serialize)] pub struct Logging { - pub help_text: String, pub ffmpeg_level: String, pub ingest_level: String, pub detect_silence: bool, @@ -297,7 +291,6 @@ pub struct Logging { impl Logging { fn new(config: &models::Configuration) -> Self { Self { - help_text: config.logging_help.clone(), ffmpeg_level: config.logging_ffmpeg_level.clone(), ingest_level: config.logging_ingest_level.clone(), detect_silence: config.logging_detect_silence, @@ -312,7 +305,6 @@ impl Logging { #[derive(Debug, Default, Clone, Deserialize, Serialize)] pub struct Processing { - pub help_text: String, pub mode: ProcessMode, pub audio_only: bool, pub copy_audio: bool, @@ -345,7 +337,6 @@ pub struct Processing { impl Processing { fn new(config: &models::Configuration) -> Self { Self { - help_text: config.processing_help.clone(), mode: ProcessMode::new(&config.processing_mode.clone()), audio_only: config.processing_audio_only, audio_track_index: config.processing_audio_track_index, @@ -374,7 +365,6 @@ impl Processing { #[derive(Debug, Default, Clone, Deserialize, Serialize)] pub struct Ingest { - pub help_text: String, pub enable: bool, pub input_param: String, pub custom_filter: String, @@ -385,7 +375,6 @@ pub struct Ingest { impl Ingest { fn new(config: &models::Configuration) -> Self { Self { - help_text: config.ingest_help.clone(), enable: config.ingest_enable, input_param: config.ingest_param.clone(), custom_filter: config.ingest_filter.clone(), @@ -396,7 +385,6 @@ impl Ingest { #[derive(Debug, Default, Clone, Deserialize, Serialize)] pub struct Playlist { - pub help_text: String, pub day_start: String, #[serde(skip_serializing, skip_deserializing)] pub start_sec: Option, @@ -409,7 +397,6 @@ pub struct Playlist { impl Playlist { fn new(config: &models::Configuration) -> Self { Self { - help_text: config.playlist_help.clone(), day_start: config.playlist_day_start.clone(), start_sec: None, length: config.playlist_length.clone(), @@ -421,7 +408,6 @@ impl Playlist { #[derive(Debug, Default, Clone, Deserialize, Serialize)] pub struct Storage { - pub help_text: String, #[serde(skip_serializing, skip_deserializing)] pub path: PathBuf, #[serde(skip_serializing, skip_deserializing)] @@ -438,7 +424,6 @@ pub struct Storage { impl Storage { fn new(config: &models::Configuration, path: PathBuf, shared_storage: bool) -> Self { Self { - help_text: config.storage_help.clone(), path, paths: vec![], filler: config.storage_filler.clone(), @@ -456,7 +441,6 @@ impl Storage { #[derive(Debug, Default, Clone, Deserialize, Serialize)] pub struct Text { - pub help_text: String, pub add_text: bool, #[serde(skip_serializing, skip_deserializing)] pub node_pos: Option, @@ -476,7 +460,6 @@ pub struct Text { impl Text { fn new(config: &models::Configuration) -> Self { Self { - help_text: config.text_help.clone(), add_text: config.text_add, node_pos: None, zmq_stream_socket: None, @@ -492,7 +475,6 @@ impl Text { #[derive(Debug, Default, Clone, Deserialize, Serialize)] pub struct Task { - pub help_text: String, pub enable: bool, pub path: PathBuf, } @@ -500,7 +482,6 @@ pub struct Task { impl Task { fn new(config: &models::Configuration) -> Self { Self { - help_text: config.task_help.clone(), enable: config.task_enable, path: PathBuf::from(config.task_path.clone()), } @@ -509,7 +490,6 @@ impl Task { #[derive(Debug, Default, Clone, Deserialize, Serialize)] pub struct Output { - pub help_text: String, pub mode: OutputMode, pub output_param: String, #[serde(skip_serializing, skip_deserializing)] @@ -523,7 +503,6 @@ pub struct Output { impl Output { fn new(config: &models::Configuration) -> Self { Self { - help_text: config.output_help.clone(), mode: OutputMode::new(&config.output_mode), output_param: config.output_param.clone(), output_count: 0, diff --git a/frontend/components/ConfigPlayout.vue b/frontend/components/ConfigPlayout.vue index e56a3b09..da5e17c9 100644 --- a/frontend/components/ConfigPlayout.vue +++ b/frontend/components/ConfigPlayout.vue @@ -9,6 +9,11 @@