Skip to content

Commit b0d8f9a

Browse files
committed
fix: show language name instead of language code
1 parent b555c00 commit b0d8f9a

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

phpmyfaq/show.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
use phpMyFAQ\Translation;
2424
use phpMyFAQ\Twig\TwigWrapper;
2525
use Symfony\Component\HttpFoundation\Request;
26-
use Symfony\Component\HttpFoundation\Response;
2726

2827
if (!defined('IS_VALID_PHPMYFAQ')) {
2928
http_response_code(400);

phpmyfaq/src/phpMyFAQ/Helper/CategoryHelper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ public function buildAvailableCategoryTranslationsList(array $availableCategoryT
198198
$link->setTitle(Strings::htmlentities($category));
199199
$link->text = Strings::htmlentities($category);
200200
$name = $link->toHtmlAnchor();
201-
$html .= sprintf('<li><strong>%s</strong>: %s</li>', $language, $name);
201+
$html .= sprintf('<li><strong>%s</strong>: %s</li>', LanguageCodes::get($language), $name);
202202
}
203203

204204
return $html;

tests/phpMyFAQ/Helper/CategoryHelperTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,8 +292,8 @@ public function testBuildAvailableCategoryTranslationsList(): void
292292
$this->mockConfiguration->method('getDefaultUrl')->willReturn('http://localhost/');
293293

294294
$availableTranslations = [
295-
'German' => 'Deutsche Kategorie',
296-
'French' => 'Catégorie française',
295+
'de' => 'Deutsche Kategorie',
296+
'fr' => 'Catégorie française',
297297
];
298298

299299
$result = $categoryHelper->buildAvailableCategoryTranslationsList($availableTranslations);

0 commit comments

Comments
 (0)