From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 839121FF183 for ; Wed, 30 Jul 2025 14:47:01 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 37FA5D003; Wed, 30 Jul 2025 14:48:25 +0200 (CEST) Mime-Version: 1.0 Date: Wed, 30 Jul 2025 14:48:21 +0200 Message-Id: To: "Proxmox VE development discussion" , "Maximiliano Sandoval" X-Mailer: aerc 0.20.0 References: <20250730103825.233570-1-m.sandoval@proxmox.com> <20250730103825.233570-15-m.sandoval@proxmox.com> In-Reply-To: <20250730103825.233570-15-m.sandoval@proxmox.com> From: "Shannon Sterz" X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1753879690944 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.022 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: Re: [pve-devel] [PATCH yew-widget-toolkit v2 1/1] improve translatable strings X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" On Wed Jul 30, 2025 at 12:38 PM CEST, Maximiliano Sandoval wrote: > We error when the fields are empty, hence must is more appropiate. > > Signed-off-by: Maximiliano Sandoval > --- > src/widget/form/field.rs | 2 +- > src/widget/form/number.rs | 4 ++-- > src/widget/form/selector.rs | 2 +- > src/widget/form/textarea.rs | 2 +- > 4 files changed, 5 insertions(+), 5 deletions(-) > > diff --git a/src/widget/form/field.rs b/src/widget/form/field.rs > index 314b5e16..da3b9777 100644 > --- a/src/widget/form/field.rs > +++ b/src/widget/form/field.rs > @@ -329,7 +329,7 @@ impl ManagedField for StandardField { > > if value.is_empty() { > if props.required { > - return Err(Error::msg(tr!("Field may not be empty."))); > + return Err(Error::msg(tr!("Field must not be empty."))); > } else { > return Ok(Value::String(String::new())); > } > diff --git a/src/widget/form/number.rs b/src/widget/form/number.rs > index 78d44a39..298b4c8b 100644 > --- a/src/widget/form/number.rs > +++ b/src/widget/form/number.rs > @@ -433,7 +433,7 @@ impl ManagedField for NumberField { > > if is_empty { > if props.required { > - return Err(Error::msg(tr!("Field may not be empty."))); > + return Err(Error::msg(tr!("Field must not be empty."))); > } else { > return Ok(Value::Null); > } > @@ -441,7 +441,7 @@ impl ManagedField for NumberField { > > let number = match T::value_to_number(value) { > Ok(number) => number, > - Err(err) => return Err(Error::msg(tr!("Input invalid: {}", err.to_string()))), > + Err(err) => return Err(Error::msg(tr!("Invalid input: {}", err.to_string()))), nit: this change seems unrelated to the reasoning above, might be nice to get that added to the commit message or split it out. -->8 snip 8<-- _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel