|
|
@@ -1,7 +1,15 @@
|
|
|
<?php
|
|
|
+// Start session for language preference
|
|
|
+if (session_status() === PHP_SESSION_NONE) {
|
|
|
+ session_start();
|
|
|
+}
|
|
|
+
|
|
|
require_once '../includes/config.php';
|
|
|
require_once '../includes/database.php';
|
|
|
require_once '../includes/publication.php';
|
|
|
+require_once '../includes/translation.php';
|
|
|
+
|
|
|
+// Translation system is auto-initialized when translation.php is included
|
|
|
|
|
|
$publication = new Publication();
|
|
|
|
|
|
@@ -31,11 +39,11 @@ if ($category) {
|
|
|
$totalPages = ceil($totalPublications / $limit);
|
|
|
?>
|
|
|
<!DOCTYPE html>
|
|
|
-<html lang="en">
|
|
|
+<html lang="<?php echo Translation::getCurrentLang(); ?>">
|
|
|
<head>
|
|
|
<meta charset="UTF-8">
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
|
- <title>Categories - <?php echo SITE_TITLE; ?></title>
|
|
|
+ <title><?php echo t('categories'); ?> - <?php echo SITE_TITLE; ?></title>
|
|
|
<link rel="stylesheet" href="../css/style.css">
|
|
|
</head>
|
|
|
<body>
|
|
|
@@ -43,10 +51,11 @@ $totalPages = ceil($totalPublications / $limit);
|
|
|
<div class="container">
|
|
|
<h1><a href="index.php"><?php echo SITE_TITLE; ?></a></h1>
|
|
|
<nav class="main-nav">
|
|
|
- <a href="index.php">Home</a>
|
|
|
- <a href="categories.php" class="active">Categories</a>
|
|
|
- <a href="search.php">Search</a>
|
|
|
+ <a href="index.php"><?php echo t('nav_home'); ?></a>
|
|
|
+ <a href="categories.php" class="active"><?php echo t('nav_categories'); ?></a>
|
|
|
+ <a href="search.php"><?php echo t('nav_search'); ?></a>
|
|
|
</nav>
|
|
|
+ <?php echo Translation::getLanguageSwitcher('categories.php'); ?>
|
|
|
</div>
|
|
|
</header>
|
|
|
|
|
|
@@ -54,19 +63,19 @@ $totalPages = ceil($totalPublications / $limit);
|
|
|
<div class="content-layout">
|
|
|
<aside class="sidebar">
|
|
|
<div class="sidebar-section">
|
|
|
- <h3>Search</h3>
|
|
|
+ <h3><?php echo t('search'); ?></h3>
|
|
|
<form method="get" action="search.php" class="search-form">
|
|
|
- <input type="text" name="q" placeholder="Search publications...">
|
|
|
- <button type="submit" class="btn btn-sm">Search</button>
|
|
|
+ <input type="text" name="q" placeholder="<?php echo t('search_placeholder'); ?>">
|
|
|
+ <button type="submit" class="btn btn-sm"><?php echo t('search'); ?></button>
|
|
|
</form>
|
|
|
</div>
|
|
|
|
|
|
<div class="sidebar-section">
|
|
|
- <h3>Categories</h3>
|
|
|
+ <h3><?php echo t('categories'); ?></h3>
|
|
|
<ul class="category-list">
|
|
|
<li>
|
|
|
<a href="categories.php" <?php echo empty($currentCategory) ? 'class="active"' : ''; ?>>
|
|
|
- All Categories
|
|
|
+ <?php echo t('all_categories'); ?>
|
|
|
</a>
|
|
|
</li>
|
|
|
<?php foreach ($categories as $cat): ?>
|
|
|
@@ -82,14 +91,14 @@ $totalPages = ceil($totalPublications / $limit);
|
|
|
</div>
|
|
|
|
|
|
<div class="sidebar-section">
|
|
|
- <h3>Category Stats</h3>
|
|
|
+ <h3><?php echo t('category_stats'); ?></h3>
|
|
|
<div class="category-stats">
|
|
|
<div class="stat-item">
|
|
|
- <span class="stat-label">Total Categories:</span>
|
|
|
+ <span class="stat-label"><?php echo t('total_categories'); ?>:</span>
|
|
|
<span class="stat-value"><?php echo count($categories); ?></span>
|
|
|
</div>
|
|
|
<div class="stat-item">
|
|
|
- <span class="stat-label">Total Publications:</span>
|
|
|
+ <span class="stat-label"><?php echo t('total_publications'); ?>:</span>
|
|
|
<span class="stat-value">
|
|
|
<?php echo array_sum(array_column($categories, 'publication_count')); ?>
|
|
|
</span>
|
|
|
@@ -102,14 +111,14 @@ $totalPages = ceil($totalPublications / $limit);
|
|
|
<div class="page-header">
|
|
|
<h2>
|
|
|
<?php if ($currentCategory): ?>
|
|
|
- Category: <?php echo htmlspecialchars($currentCategory); ?>
|
|
|
+ <?php echo t('category'); ?>: <?php echo htmlspecialchars($currentCategory); ?>
|
|
|
<?php else: ?>
|
|
|
- All Categories
|
|
|
+ <?php echo t('all_categories'); ?>
|
|
|
<?php endif; ?>
|
|
|
</h2>
|
|
|
|
|
|
<?php if ($currentCategory): ?>
|
|
|
- <a href="categories.php" class="btn btn-secondary">View All Categories</a>
|
|
|
+ <a href="categories.php" class="btn btn-secondary"><?php echo t('view_all_categories'); ?></a>
|
|
|
<?php endif; ?>
|
|
|
</div>
|
|
|
|