[TikiWiki-commits] [Git][tikiwiki/tiki][29.x] [BP][ENH] Custom Translations: Improve error messages

"Bruno Kambere \(@kambereBr\) via TikiWiki-cvs" <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <694433a26c2c5_2a215ed7811412@gitlab-sidekiq-low-urgency-cpu-bound-v2-547b5c788f-mgdcd.mail>

Bruno Kambere pushed to branch 29.x at Tiki Wiki CMS Groupware / Tiki


Commits:
246c974c by Bruno Kambere at 2025-12-18T18:54:19+02:00
[BP][ENH] Custom Translations: Improve error messages
---
* [ENH] Custom Translations: Improve error messages
---
* [ENH] Custom Translations: Improve error messages

See merge request tikiwiki/tiki!9247

See merge request tikiwiki/tiki!9249

- - - - -


1 changed file:

- lib/core/Services/Language/Utilities.php


Changes:

=====================================
lib/core/Services/Language/Utilities.php
=====================================
@@ -212,7 +212,7 @@ class Services_Language_Utilities
         $langDirIsReadable = is_readable($directory);
 
         if (! $langDirIsReadable) {
-            throw new Services_Exception(tra('The language directory is not readable'), 400);
+            throw new Services_Exception(tr('The language directory %0 is missing or not readable. Please ask the administrator to check its existence and permissions.', $directory), 400);
         } else {
             return $langDirIsReadable;
         }
@@ -233,7 +233,7 @@ class Services_Language_Utilities
         $langDirIsWritable = is_writable($directory);
 
         if (! $langDirIsWritable) {
-            throw new Services_Exception(tra('The language directory is not writeable'), 400);
+            throw new Services_Exception(tr('The language directory %0 is missing or not writable. Please ask the administrator to check its existence and permissions.', $directory), 400);
         } else {
             return $langDirIsWritable;
         }
@@ -337,10 +337,10 @@ class Services_Language_Utilities
 
         //write the strings to custom.php file
         if (! ($fp = fopen($custom_file, 'w+'))) {
-            throw new Services_Exception(tra('Can not fopen custom.php'), 400);
+            throw new Services_Exception(tra('Can not read custom.php translation file. Please ask the administrator to check its existence and permissions.'), 400);
         } else {
             if (! fwrite($fp, $custom_code)) {
-                throw new Services_Exception(tra('Can not fwrite custom.php'), 400);
+                throw new Services_Exception(tra('Can not write custom.php translation file. Please ask the administrator to check its existence and permissions.'), 400);
             }
             fclose($fp);
             return true;
@@ -428,10 +428,10 @@ class Services_Language_Utilities
     {
         //validate input
         if (! is_array($sourceStringTranslationSet)) {
-            throw new Services_Exception(tr('Source string translation set is not an array'), 400);
+            throw new Services_Exception(tr('The source translation set is missing or invalid. Please ask the administrator to verify the translation file.'), 400);
         }
         if (! is_array($targetStringTranslationSet)) {
-            throw new Services_Exception(tr('Target string translation set is not an array'), 400);
+            throw new Services_Exception(tr('The target translation set is missing or invalid. Please ask the administrator to verify the translation file.'), 400);
         }
         //merge means that existing translations in the target are replaced and new ones are added to the set
         if ($process_type === 'merge') {



View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/246c974c22035d9caa4b25dff4367bcc2e0b0904

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/246c974c22035d9caa4b25dff4367bcc2e0b0904
You're receiving this email because of your account on gitlab.com.

_______________________________________________
TikiWiki-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.