- $filename = $gettext_php_dir;
- if (substr($filename, -1) != '/')
- $filename .= '/';
- $filename .= $squirrelmail_language . '/LC_MESSAGES/' .
- $gettext_php_domain . '.po';
-
- $file = @fopen($filename, 'r');
- if ($file == false) {
- // Uh-ho -- we can't load the file. Just fake it. :-)
- // This is also for English, which doesn't use translations
- $gettext_php_loaded = true;
- $gettext_php_loaded_language = $squirrelmail_language;
- $gettext_php_short_circuit = true; // Avoid fuzzy matching when we
- // didn't load strings
- return;
- }
-
- $key = '';
- $SkipRead = false;
- while (! feof($file)) {
- if (! $SkipRead)
+function gettext_php_load_strings() {
+ global $squirrelmail_language, $gettext_php_translateStrings,
+ $gettext_php_domain, $gettext_php_dir, $gettext_php_loaded,
+ $gettext_php_loaded_language, $gettext_php_short_circuit;
+
+ /*
+ * $squirrelmail_language gives 'en' for English, 'de' for German,
+ * etc. I didn't wanna use getenv or similar, but you easily could
+ * change my code to do that.
+ */
+
+ $gettext_php_translateStrings = array();
+
+ $gettext_php_short_circuit = false; /* initialization */
+
+ $filename = $gettext_php_dir;
+ if (substr($filename, -1) != '/')
+ $filename .= '/';
+ $filename .= $squirrelmail_language . '/LC_MESSAGES/' .
+ $gettext_php_domain . '.po';
+
+ $file = @fopen($filename, 'r');
+ if ($file == false) {
+ /* Uh-ho -- we can't load the file. Just fake it. :-)
+ This is also for English, which doesn't use translations */
+ $gettext_php_loaded = true;
+ $gettext_php_loaded_language = $squirrelmail_language;
+ /* Avoid fuzzy matching when we didn't load strings */
+ $gettext_php_short_circuit = true;
+ return;
+ }
+
+ $key = '';
+ $SkipRead = false;
+ while (! feof($file)) {
+ if (! $SkipRead) {