From patchwork Tue Aug 1 15:48:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Stefan Schantl X-Patchwork-Id: 7055 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) client-signature ECDSA (secp384r1)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4RFffw5079z3wmm for ; Tue, 1 Aug 2023 15:49:12 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) client-signature ECDSA (secp384r1)) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4RFffq5MLlz15Q; Tue, 1 Aug 2023 15:49:07 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4RFffq4tkhz2yWd; Tue, 1 Aug 2023 15:49:07 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4RFffp3ql2z2y0p for ; Tue, 1 Aug 2023 15:49:06 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4RFffl1bJgz15Q; Tue, 1 Aug 2023 15:49:03 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1690904943; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=B5caD5fiu0B6GkSHLlNEdySd3L+yg5ziESkeG1HFSAg=; b=KIPyiUdRbyxSnZrQXvkKz35ZF+gpsA31s0B98gKuUB9xJfZZf5H9wDrf95Va22oVFyZs1G TuUlfYbZsCNeq7CA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1690904943; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=B5caD5fiu0B6GkSHLlNEdySd3L+yg5ziESkeG1HFSAg=; b=AvuIZnCUAeDM6cwo9fji9yOX65OyLlW7dXYLV7k8Oam4LRUnudkiHU0hfR9513KU4gUmNB 9qPUgvYPIDVYg1zgY898Yxn1pLRKUrpMhk9a2FtQag8tpek0cnThVqXvCrji5EnmeSg7nt BFgiv/5nmJ4CPEFMS7+OPkO6PRNnz0TXWh7I5aA4pi51AoeqFfpe6wPDQexjP+Jc5X7nNM zwgod8NQMuLXQIBmqw53JkWApv7Mc0CRpnckTEjoXIYOacwF6IU6bQX2Q+cHeCwWW0j8jd he6Q56ePZHPKvap0SILOUC5cZ/JZQD4YpGBNOpBjhhBXzpFehfr9AKpWNFYTEA== From: Stefan Schantl To: development@lists.ipfire.org Subject: [PATCHv2 08/12] extrahd.cgi: Add missing translation strings Date: Tue, 1 Aug 2023 17:48:35 +0200 Message-Id: <20230801154839.2373-8-stefan.schantl@ipfire.org> In-Reply-To: <20230801154839.2373-1-stefan.schantl@ipfire.org> References: <20230801154839.2373-1-stefan.schantl@ipfire.org> MIME-Version: 1.0 X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: development-bounces@lists.ipfire.org Sender: "Development" Signed-off-by: Stefan Schantl Reviewed-by: Bernhard Bitsch --- html/cgi-bin/extrahd.cgi | 21 ++++++++++++--------- langs/de/cgi-bin/de.pl | 5 +++++ langs/en/cgi-bin/en.pl | 5 +++++ 3 files changed, 22 insertions(+), 9 deletions(-) diff --git a/html/cgi-bin/extrahd.cgi b/html/cgi-bin/extrahd.cgi index de5f26d0e..0b59a02f7 100644 --- a/html/cgi-bin/extrahd.cgi +++ b/html/cgi-bin/extrahd.cgi @@ -98,14 +98,17 @@ $extrahdsettings{'UUID'} = ''; ## Add a new device. # if ($extrahdsettings{'ACTION'} eq $Lang::tr{'add'}) { + # Check if a mount path has been given. + if (not $extrahdsettings{'PATH'}) { + $errormessage = "$Lang::tr{'extrahd no mount point given'}."; + # Check if a valid mount path has been choosen. - unless(&is_valid_dir("$extrahdsettings{'PATH'}")) { - $errormessage = "$Lang::tr{'extrahd you cant mount'} $extrahdsettings{'DEVICE'} $Lang::tr{'extrahd to root'}."; - } + } elsif(not &is_valid_dir("$extrahdsettings{'PATH'}")) { + $errormessage = "$Lang::tr{'extrahd you cant mount'} $extrahdsettings{'DEVICE'} $Lang::tr{'extrahd to'} $extrahdsettings{'PATH'} $Lang::tr{'extrahd because it is outside the allowed mount path'}."; # Check if the given path allready is mounted somewhere. - if(&is_mounted("$extrahdsettings{'PATH'}")) { - $errormessage = "$Lang::tr{'extrahd you cant mount'} $extrahdsettings{'DEVICE'} $Lang::tr{'extrahd to'} $extrahdsettings{'PATH'}$Lang::tr{'extrahd because there is already a device mounted'}."; + } elsif(&is_mounted("$extrahdsettings{'PATH'}")) { + $errormessage = "$Lang::tr{'extrahd you cant mount'} $extrahdsettings{'DEVICE'} $Lang::tr{'extrahd to'} $extrahdsettings{'PATH'} $Lang::tr{'extrahd because there is already a device mounted'}."; } # Check against may previously configured drives. @@ -122,7 +125,7 @@ if ($extrahdsettings{'ACTION'} eq $Lang::tr{'add'}) { # Check if the path is allready used. if ( "$extrahdsettings{'PATH'}" eq "$path" ) { - $errormessage = "$Lang::tr{'extrahd you cant mount'} $extrahdsettings{'DEVICE'} $Lang::tr{'extrahd to'} $extrahdsettings{'PATH'}$Lang::tr{'extrahd because there is already a device mounted'}."; + $errormessage = "$Lang::tr{'extrahd you cant mount'} $extrahdsettings{'DEVICE'} $Lang::tr{'extrahd to'} $extrahdsettings{'PATH'} $Lang::tr{'extrahd because there is already a device mounted'}."; } # Check if the uuid is allready used. @@ -318,16 +321,16 @@ END # Check if the device is mounted properly. if(&is_mounted($mountpoint)) { - print "MOUNTED \n"; + print "$Lang::tr{ \n"; } else { - print "NOT MOUNTED \n"; + print "$Lang::tr{ \n"; } print "\n"; } else { unless($disabled) { print "\n"; - print "UNCONFIGURED \n"; + print "$Lang::tr{ \n"; print "\n"; } } diff --git a/langs/de/cgi-bin/de.pl b/langs/de/cgi-bin/de.pl index 33730f0c3..37b17b431 100644 --- a/langs/de/cgi-bin/de.pl +++ b/langs/de/cgi-bin/de.pl @@ -1025,11 +1025,16 @@ 'external access rule removed' => ' Regel für externen Zugang entfernt; starte Zugangskontroller neu', 'external aliases configuration' => 'Externe Alias-Konfiguration', 'extrahd' => 'ExtraHD', +'extrahd because it is outside the allowed mount path' => 'mounten, da sich das Ziel außerhalb der erlaubten Pfade befindet', 'extrahd because there is already a device mounted' => ' mounten, weil bereits ein Gerät gemountet ist', 'extrahd cant umount' => 'Konnte', 'extrahd detected drives' => 'Gefundene Laufwerke', 'extrahd install or load driver' => 'Wenn Ihre Festplatte nicht angezeigt wird, müssen Sie zuerst den Treiber laden oder ggf. auch nachinstallieren. Wenn diese jedoch angezeigt wird, aber keine Partitionen zu sehen sind, müssen diese erst angelegt werden.', 'extrahd maybe the device is in use' => 'nicht mounten. Vielleicht wird das Gerät bereits verwendet', +'extrahd no mount point given' => 'Kein Pfad zum mounten angegeben', +'extrahd mounted' => 'Gemounted', +'extrahd not mounted' => 'Nicht gemounted', +'extrahd not configured' => 'Nicht konfiguriert', 'extrahd to' => 'nicht nach', 'extrahd to root' => 'nicht nach root mounten', 'extrahd unable to read' => 'Lesefehler von', diff --git a/langs/en/cgi-bin/en.pl b/langs/en/cgi-bin/en.pl index 729516538..b00ecc5eb 100644 --- a/langs/en/cgi-bin/en.pl +++ b/langs/en/cgi-bin/en.pl @@ -1072,11 +1072,16 @@ 'external access rule removed' => ' External access rule removed; restarting access controller', 'external aliases configuration' => 'External aliases configuration', 'extrahd' => 'ExtraHD', +'extrahd because it it outside the allowed mount path' => ', because it is outside the allowed mount path', 'extrahd because there is already a device mounted' => ', because there is already a device mounted', 'extrahd cant umount' => 'Can\'t umount', 'extrahd detected drives' => 'detected drives', 'extrahd install or load driver' => 'If your device isn\'t listed here, you need to install or load the driver.
If you can see your device but no partitions you have to create them first.', +'extrahd no mount point given', => 'No mount point given', 'extrahd maybe the device is in use' => '. Maybe the device is in use', +'extrahd mounted' => 'Mounted', +'extrahd not mounted' => 'Not mounted', +'extrahd not configured' => 'Not configured', 'extrahd to' => 'to', 'extrahd to root' => 'to root', 'extrahd unable to read' => 'Unable to read',