|
|
@@ -1,41 +0,0 @@
|
|
|
-<?php
|
|
|
-// Debug language detection issue
|
|
|
-session_start();
|
|
|
-
|
|
|
-echo "=== Language Detection Debug ===\n\n";
|
|
|
-
|
|
|
-// Check if session is working
|
|
|
-echo "Session ID: " . session_id() . "\n";
|
|
|
-echo "Session data: " . print_r($_SESSION, true) . "\n\n";
|
|
|
-
|
|
|
-// Check GET parameters
|
|
|
-echo "GET parameters: " . print_r($_GET, true) . "\n\n";
|
|
|
-
|
|
|
-// Check browser language
|
|
|
-echo "Browser language: " . ($_SERVER['HTTP_ACCEPT_LANGUAGE'] ?? 'not set') . "\n\n";
|
|
|
-
|
|
|
-// Check constants
|
|
|
-echo "DEFAULT_LANGUAGE constant: " . (defined('DEFAULT_LANGUAGE') ? DEFAULT_LANGUAGE : 'not defined') . "\n\n";
|
|
|
-
|
|
|
-// Initialize translation system
|
|
|
-require_once 'includes/config.php';
|
|
|
-require_once 'includes/translation.php';
|
|
|
-
|
|
|
-echo "After loading config:\n";
|
|
|
-echo "DEFAULT_LANGUAGE constant: " . (defined('DEFAULT_LANGUAGE') ? DEFAULT_LANGUAGE : 'not defined') . "\n\n";
|
|
|
-
|
|
|
-try {
|
|
|
- $translation = Translation::getInstance();
|
|
|
- echo "Current language: " . $translation->getCurrentLanguage() . "\n";
|
|
|
- echo "Supported languages: " . implode(', ', array_keys($translation->getSupportedLanguages())) . "\n";
|
|
|
- echo "Session language after init: " . ($_SESSION['language'] ?? 'not set') . "\n\n";
|
|
|
-
|
|
|
- // Test translation
|
|
|
- echo "Test translation 'nav_home': " . $translation->translate('nav_home') . "\n";
|
|
|
-
|
|
|
-} catch (Exception $e) {
|
|
|
- echo "Error: " . $e->getMessage() . "\n";
|
|
|
-}
|
|
|
-
|
|
|
-echo "\n=== Debug Complete ===\n";
|
|
|
-?>
|