|
|
@@ -1,7 +1,16 @@
|
|
|
<?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';
|
|
|
+
|
|
|
+// Initialize translation system
|
|
|
+$translation = Translation::getInstance();
|
|
|
|
|
|
$publication = new Publication();
|
|
|
|
|
|
@@ -10,8 +19,8 @@ $pub = $publication->getById($id);
|
|
|
|
|
|
if (!$pub || $pub['status'] !== 'published') {
|
|
|
http_response_code(404);
|
|
|
- echo '<h1>Publication Not Found</h1>';
|
|
|
- echo '<p>The requested publication could not be found.</p>';
|
|
|
+ echo '<h1>' . t('error_publication_not_found') . '</h1>';
|
|
|
+ echo '<p>' . t('error_publication_not_found_description') . '</p>';
|
|
|
exit;
|
|
|
}
|
|
|
|
|
|
@@ -41,10 +50,11 @@ if ($pub['categories_array']) {
|
|
|
<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">Categories</a>
|
|
|
- <a href="search.php">Search</a>
|
|
|
+ <a href="index.php"><?php echo t('nav_home'); ?></a>
|
|
|
+ <a href="categories.php"><?php echo t('nav_categories'); ?></a>
|
|
|
+ <a href="search.php"><?php echo t('nav_search'); ?></a>
|
|
|
</nav>
|
|
|
+ <?php echo $translation->getLanguageSwitcher('publication.php?id=' . $id); ?>
|
|
|
</div>
|
|
|
</header>
|
|
|
|
|
|
@@ -87,7 +97,7 @@ if ($pub['categories_array']) {
|
|
|
|
|
|
<?php if (!empty($relatedPublications)): ?>
|
|
|
<section class="related-publications">
|
|
|
- <h2>Related Publications</h2>
|
|
|
+ <h2><?php echo t('related_publications'); ?></h2>
|
|
|
<div class="publication-grid">
|
|
|
<?php foreach ($relatedPublications as $related): ?>
|
|
|
<article class="publication-card">
|
|
|
@@ -112,7 +122,7 @@ if ($pub['categories_array']) {
|
|
|
<?php endif; ?>
|
|
|
|
|
|
<div class="publication-actions">
|
|
|
- <a href="index.php" class="btn">Back to Publications</a>
|
|
|
+ <a href="index.php" class="btn"><?php echo t('back_to_publications'); ?></a>
|
|
|
</div>
|
|
|
</div>
|
|
|
|