Просмотр исходного кода

Have configtest check whether the sq_default_language is actually installed.
Might hint people that didn't download the locales package.

Thijs Kinkhorst 20 лет назад
Родитель
Сommit
76c5cf3640
1 измененных файлов с 19 добавлено и 1 удалено
  1. 19 1
      src/configtest.php

+ 19 - 1
src/configtest.php

@@ -172,6 +172,24 @@ foreach($theme as $thm) {
 
 echo $IND . "Themes OK.<br />\n";
 
+if ( $squirrelmail_default_language != 'en_US' ) {
+    $loc_path = SM_PATH .'locale/'.$squirrelmail_default_language.'/LC_MESSAGES/squirrelmail.mo';
+    if( ! file_exists( $loc_path ) ) {
+        do_err('You have set <i>' . $squirrelmail_default_language . 
+            '</i> as your default language, but I cannot find this translation (should be '.
+            'in <tt>' . $loc_path . '</tt>). Please note that you have to download translations '.
+            'separately from the main SquirrelMail package.', FALSE);
+    } elseif ( ! is_readable( $loc_path ) ) {
+        do_err('You have set <i>' . $squirrelmail_default_language . 
+            '</i> as your default language, but I cannot read this translation (file '.
+            'in <tt>' . $loc_path . '</tt> unreadable).', FALSE);
+    } else {
+        echo $IND . "Default language OK.<br />\n";
+    }
+} else {
+    echo $IND . "Default language OK.<br />\n";
+}
+
 echo $IND . "Base URL detected as: <tt>" . htmlspecialchars(get_location()) . "</tt><br />\n";
 
 
@@ -440,4 +458,4 @@ if( empty($ldap_server) ) {
 </html>
 <?php
 // vim: et ts=4
-?>
+?>