From 9c1eb35e884ee498d1e8155ba541e8115fef16be Mon Sep 17 00:00:00 2001 From: ma0068 Date: Thu, 31 Jul 2025 11:18:37 +0200 Subject: [PATCH] Tab Contact: Phrase for Validation Length PLZ --- .../api/frontend/v1/stv/Address.php | 11 +++++++++- system/phrasesupdate.php | 20 +++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/application/controllers/api/frontend/v1/stv/Address.php b/application/controllers/api/frontend/v1/stv/Address.php index 324e306f3..d14111e99 100644 --- a/application/controllers/api/frontend/v1/stv/Address.php +++ b/application/controllers/api/frontend/v1/stv/Address.php @@ -31,6 +31,11 @@ class Address extends FHCAPI_Controller 'getNations' => self::PERM_LOGGED, 'getPlaces' => self::PERM_LOGGED ]); + + // Load language phrases + $this->loadPhrases([ + 'ui' + ]); } public function getNations() @@ -53,7 +58,11 @@ class Address extends FHCAPI_Controller $this->form_validation->set_data(['address.plz' => $plz]); - $this->form_validation->set_rules('address.plz', 'PLZ', 'required|numeric|less_than[10000]'); + $this->form_validation->set_rules('address.plz', 'PLZ', 'required|numeric|less_than[10000]', [ + 'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'PLZ']), + 'numeric' => $this->p->t('ui', 'error_fieldNotNumeric', ['field' => 'PLZ']), + 'less_than' => $this->p->t('ui', 'error_fieldLessThan10000', ['field' => 'PLZ']) + ]); if (!$this->form_validation->run()) $this->terminateWithValidationErrors($this->form_validation->error_array()); diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index c190d7b4f..5ca44148d 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -44597,6 +44597,26 @@ and represent the current state of research on the topic. The prescribed citatio ) ) ), + array( + 'app' => 'core', + 'category' => 'ui', + 'phrase' => 'error_fieldLessThan10000', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Das Eingabefeld {field} darf maximal 4-stellig sein.', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'The Field {Field} must contain a number less then 10000.', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), // FHC-4 Finetuning END );