From 8a4122d04956ac3464e8a2c8fa18c2aeec0684a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frederik=20M=C3=B6llers?= Date: Sun, 7 Sep 2025 22:59:01 +0200 Subject: [PATCH 1/8] Add internationalization for third-party styles Added proper internationalization for JanosBibliographyStyle and VancouverBibliographyStyle. Translation of strings like "in", "Master's Thesis" etc. was missing. --- bibtexbrowser.php | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/bibtexbrowser.php b/bibtexbrowser.php index c91a18e..a5b04ff 100755 --- a/bibtexbrowser.php +++ b/bibtexbrowser.php @@ -2524,11 +2524,11 @@ function JanosBibliographyStyle($bibentry) { } if ($type=="inproceedings" && $bibentry->hasField(BOOKTITLE)) { - $booktitle = ''.'In '.$bibentry->getField(BOOKTITLE).''; + $booktitle = ''.__('In').' '.$bibentry->getField(BOOKTITLE).''; } if ($type=="incollection" && $bibentry->hasField(BOOKTITLE)) { - $booktitle = ''.'Chapter in '.$bibentry->getField(BOOKTITLE).''; + $booktitle = ''.__('Chapter in').' '.$bibentry->getField(BOOKTITLE).''; } if ($type=="article" && $bibentry->hasField("journal")) { @@ -2551,14 +2551,14 @@ function JanosBibliographyStyle($bibentry) { $publisher=''; if ($type=="phdthesis") { - $publisher = 'PhD thesis, '.$bibentry->getField(SCHOOL); + $publisher = __('PhD thesis').', '.$bibentry->getField(SCHOOL); } if ($type=="mastersthesis") { - $publisher = 'Master\'s thesis, '.$bibentry->getField(SCHOOL); + $publisher = __('Master\'s thesis').', '.$bibentry->getField(SCHOOL); } if ($type=="techreport") { - $publisher = 'Technical report, '; + $publisher = __('Technical report').', '; $publisher .=$bibentry->getField("institution"); if ($bibentry->hasField("number")) { $publisher .= ' '.$bibentry->getField("number"); @@ -2571,13 +2571,13 @@ function JanosBibliographyStyle($bibentry) { if ($publisher!='') $entry[] = $publisher; if ($type=="article") { - if ($bibentry->hasField('volume')) $entry[] = "vol. ".$bibentry->getField("volume"); - if ($bibentry->hasField('number')) $entry[] = 'no. '.$bibentry->getField("number"); + if ($bibentry->hasField('volume')) $entry[] = __("vol.")." ".$bibentry->getField("volume"); + if ($bibentry->hasField('number')) $entry[] = __('no.').' '.$bibentry->getField("number"); } if ($bibentry->hasField('address')) $entry[] = $bibentry->getField("address"); - if ($bibentry->hasField('pages')) $entry[] = str_replace("--", "-", "pp. ".$bibentry->getField("pages")); + if ($bibentry->hasField('pages')) $entry[] = str_replace("--", "-", __("pp.")." ".$bibentry->getField("pages")); if ($bibentry->hasField(YEAR)) $entry[] = $bibentry->getYear(); @@ -2641,9 +2641,9 @@ function VancouverBibliographyStyle($bibentry) { $booktitle = $editor; $booktitle = $bibentry->getField("note"); } else if ($type=="inproceedings") { - $booktitle = 'In: ' . $editor . $bibentry->getField(BOOKTITLE); + $booktitle = __('In').': ' . $editor . $bibentry->getField(BOOKTITLE); } else if ($type=="incollection") { - $booktitle = 'Chapter in '; + $booktitle = __('Chapter in').' '; if ($editor!='') $booktitle .= $editor; $booktitle .= $bibentry->getField(BOOKTITLE); } else if ($type=="article") { @@ -2656,11 +2656,11 @@ function VancouverBibliographyStyle($bibentry) { $publisher=''; if ($type=="phdthesis") { - $publisher = 'PhD thesis, '.$bibentry->getField(SCHOOL); + $publisher = __('PhD thesis').', '.$bibentry->getField(SCHOOL); } else if ($type=="mastersthesis") { - $publisher = 'Master\'s thesis, '.$bibentry->getField(SCHOOL); + $publisher = __('Master\'s thesis').', '.$bibentry->getField(SCHOOL); } else if ($type=="techreport") { - $publisher = 'Technical report, '.$bibentry->getField("institution"); + $publisher = __('Technical report').', '.$bibentry->getField("institution"); } if ($bibentry->hasField("publisher")) { $publisher = $bibentry->getField("publisher"); From 0bd87f51fde0547fc09bd8acb9121d24fc75d35c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frederik=20M=C3=B6llers?= Date: Sun, 7 Sep 2025 09:05:34 +0200 Subject: [PATCH 2/8] Improve use of CSS font-weight --- bibtexbrowser.css | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bibtexbrowser.css b/bibtexbrowser.css index be6ebd7..ac0dbc1 100644 --- a/bibtexbrowser.css +++ b/bibtexbrowser.css @@ -11,14 +11,14 @@ body { } .sheader { font-size: 1.5rem; - font-weight: 600; + font-weight: 700; padding-top: 1.5em; padding-bottom: .5em; } .theader { display: block; font-size: 1.25rem; - font-weight: 600; + font-weight: 700; padding-top: .5em; padding-bottom: .5em; } @@ -29,6 +29,9 @@ td.bibitem { padding-left: 1.5rem; display: block; } +.bibtitle { + font-weight: 700; +} a { color: #C01632; text-decoration: underline; From 24689aceb4616cf150884ebe8506dcf78aa8ac23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frederik=20M=C3=B6llers?= Date: Sun, 7 Sep 2025 22:59:01 +0200 Subject: [PATCH 3/8] Add internationalization for third-party styles Added proper internationalization for JanosBibliographyStyle and VancouverBibliographyStyle. Translation of strings like "in", "Master's Thesis" etc. was missing. --- bibtexbrowser.php | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/bibtexbrowser.php b/bibtexbrowser.php index c91a18e..a5b04ff 100755 --- a/bibtexbrowser.php +++ b/bibtexbrowser.php @@ -2524,11 +2524,11 @@ function JanosBibliographyStyle($bibentry) { } if ($type=="inproceedings" && $bibentry->hasField(BOOKTITLE)) { - $booktitle = ''.'In '.$bibentry->getField(BOOKTITLE).''; + $booktitle = ''.__('In').' '.$bibentry->getField(BOOKTITLE).''; } if ($type=="incollection" && $bibentry->hasField(BOOKTITLE)) { - $booktitle = ''.'Chapter in '.$bibentry->getField(BOOKTITLE).''; + $booktitle = ''.__('Chapter in').' '.$bibentry->getField(BOOKTITLE).''; } if ($type=="article" && $bibentry->hasField("journal")) { @@ -2551,14 +2551,14 @@ function JanosBibliographyStyle($bibentry) { $publisher=''; if ($type=="phdthesis") { - $publisher = 'PhD thesis, '.$bibentry->getField(SCHOOL); + $publisher = __('PhD thesis').', '.$bibentry->getField(SCHOOL); } if ($type=="mastersthesis") { - $publisher = 'Master\'s thesis, '.$bibentry->getField(SCHOOL); + $publisher = __('Master\'s thesis').', '.$bibentry->getField(SCHOOL); } if ($type=="techreport") { - $publisher = 'Technical report, '; + $publisher = __('Technical report').', '; $publisher .=$bibentry->getField("institution"); if ($bibentry->hasField("number")) { $publisher .= ' '.$bibentry->getField("number"); @@ -2571,13 +2571,13 @@ function JanosBibliographyStyle($bibentry) { if ($publisher!='') $entry[] = $publisher; if ($type=="article") { - if ($bibentry->hasField('volume')) $entry[] = "vol. ".$bibentry->getField("volume"); - if ($bibentry->hasField('number')) $entry[] = 'no. '.$bibentry->getField("number"); + if ($bibentry->hasField('volume')) $entry[] = __("vol.")." ".$bibentry->getField("volume"); + if ($bibentry->hasField('number')) $entry[] = __('no.').' '.$bibentry->getField("number"); } if ($bibentry->hasField('address')) $entry[] = $bibentry->getField("address"); - if ($bibentry->hasField('pages')) $entry[] = str_replace("--", "-", "pp. ".$bibentry->getField("pages")); + if ($bibentry->hasField('pages')) $entry[] = str_replace("--", "-", __("pp.")." ".$bibentry->getField("pages")); if ($bibentry->hasField(YEAR)) $entry[] = $bibentry->getYear(); @@ -2641,9 +2641,9 @@ function VancouverBibliographyStyle($bibentry) { $booktitle = $editor; $booktitle = $bibentry->getField("note"); } else if ($type=="inproceedings") { - $booktitle = 'In: ' . $editor . $bibentry->getField(BOOKTITLE); + $booktitle = __('In').': ' . $editor . $bibentry->getField(BOOKTITLE); } else if ($type=="incollection") { - $booktitle = 'Chapter in '; + $booktitle = __('Chapter in').' '; if ($editor!='') $booktitle .= $editor; $booktitle .= $bibentry->getField(BOOKTITLE); } else if ($type=="article") { @@ -2656,11 +2656,11 @@ function VancouverBibliographyStyle($bibentry) { $publisher=''; if ($type=="phdthesis") { - $publisher = 'PhD thesis, '.$bibentry->getField(SCHOOL); + $publisher = __('PhD thesis').', '.$bibentry->getField(SCHOOL); } else if ($type=="mastersthesis") { - $publisher = 'Master\'s thesis, '.$bibentry->getField(SCHOOL); + $publisher = __('Master\'s thesis').', '.$bibentry->getField(SCHOOL); } else if ($type=="techreport") { - $publisher = 'Technical report, '.$bibentry->getField("institution"); + $publisher = __('Technical report').', '.$bibentry->getField("institution"); } if ($bibentry->hasField("publisher")) { $publisher = $bibentry->getField("publisher"); From e2154ea9b0cbc9c247fbf52aea8b84ad2f8ed244 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frederik=20M=C3=B6llers?= Date: Sun, 7 Sep 2025 23:09:34 +0200 Subject: [PATCH 4/8] Translate remaining english strings to german "vol.", "no.", "pp." --- bibtexbrowser.german.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bibtexbrowser.german.php b/bibtexbrowser.german.php index ca7df46..f995f5e 100644 --- a/bibtexbrowser.german.php +++ b/bibtexbrowser.german.php @@ -7,13 +7,16 @@ $BIBTEXBROWSER_LANG['Book Chapters'] = "Buchbeiträge"; $BIBTEXBROWSER_LANG['Chapter in'] = "Kapitel in"; $BIBTEXBROWSER_LANG['In'] = "In"; $BIBTEXBROWSER_LANG['Master\'s thesis'] = "Masterarbeit"; +$BIBTEXBROWSER_LANG['no.'] = "Nr."; $BIBTEXBROWSER_LANG['No date'] = "Kein Datum"; $BIBTEXBROWSER_LANG['No publications present'] = "Keine Publikationen vorhanden"; $BIBTEXBROWSER_LANG['Other Publications'] = "Andere Veröffentlichungen"; +$BIBTEXBROWSER_LANG['pp.'] = "S."; $BIBTEXBROWSER_LANG['PhD thesis'] = "Dissertation"; $BIBTEXBROWSER_LANG['Refereed Articles'] = "Zeitschriftenbeiträge"; $BIBTEXBROWSER_LANG['Refereed Conference Papers'] = "Konferenzbeiträge"; $BIBTEXBROWSER_LANG['Refereed Workshop Papers'] = "Workshopbeiträge"; $BIBTEXBROWSER_LANG['Technical report'] = "Technischer Bericht"; +$BIBTEXBROWSER_LANG['vol.'] = "Bd."; @define('LAST_AUTHOR_SEPARATOR',' und '); ?> From a8c24dab1864437d3b145d53820c30b605ae2f87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frederik=20M=C3=B6llers?= Date: Mon, 8 Sep 2025 04:59:13 +0000 Subject: [PATCH 5/8] Add internationalization for third-party styles (#137) --- bibtexbrowser.php | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/bibtexbrowser.php b/bibtexbrowser.php index c91a18e..a5b04ff 100755 --- a/bibtexbrowser.php +++ b/bibtexbrowser.php @@ -2524,11 +2524,11 @@ function JanosBibliographyStyle($bibentry) { } if ($type=="inproceedings" && $bibentry->hasField(BOOKTITLE)) { - $booktitle = ''.'In '.$bibentry->getField(BOOKTITLE).''; + $booktitle = ''.__('In').' '.$bibentry->getField(BOOKTITLE).''; } if ($type=="incollection" && $bibentry->hasField(BOOKTITLE)) { - $booktitle = ''.'Chapter in '.$bibentry->getField(BOOKTITLE).''; + $booktitle = ''.__('Chapter in').' '.$bibentry->getField(BOOKTITLE).''; } if ($type=="article" && $bibentry->hasField("journal")) { @@ -2551,14 +2551,14 @@ function JanosBibliographyStyle($bibentry) { $publisher=''; if ($type=="phdthesis") { - $publisher = 'PhD thesis, '.$bibentry->getField(SCHOOL); + $publisher = __('PhD thesis').', '.$bibentry->getField(SCHOOL); } if ($type=="mastersthesis") { - $publisher = 'Master\'s thesis, '.$bibentry->getField(SCHOOL); + $publisher = __('Master\'s thesis').', '.$bibentry->getField(SCHOOL); } if ($type=="techreport") { - $publisher = 'Technical report, '; + $publisher = __('Technical report').', '; $publisher .=$bibentry->getField("institution"); if ($bibentry->hasField("number")) { $publisher .= ' '.$bibentry->getField("number"); @@ -2571,13 +2571,13 @@ function JanosBibliographyStyle($bibentry) { if ($publisher!='') $entry[] = $publisher; if ($type=="article") { - if ($bibentry->hasField('volume')) $entry[] = "vol. ".$bibentry->getField("volume"); - if ($bibentry->hasField('number')) $entry[] = 'no. '.$bibentry->getField("number"); + if ($bibentry->hasField('volume')) $entry[] = __("vol.")." ".$bibentry->getField("volume"); + if ($bibentry->hasField('number')) $entry[] = __('no.').' '.$bibentry->getField("number"); } if ($bibentry->hasField('address')) $entry[] = $bibentry->getField("address"); - if ($bibentry->hasField('pages')) $entry[] = str_replace("--", "-", "pp. ".$bibentry->getField("pages")); + if ($bibentry->hasField('pages')) $entry[] = str_replace("--", "-", __("pp.")." ".$bibentry->getField("pages")); if ($bibentry->hasField(YEAR)) $entry[] = $bibentry->getYear(); @@ -2641,9 +2641,9 @@ function VancouverBibliographyStyle($bibentry) { $booktitle = $editor; $booktitle = $bibentry->getField("note"); } else if ($type=="inproceedings") { - $booktitle = 'In: ' . $editor . $bibentry->getField(BOOKTITLE); + $booktitle = __('In').': ' . $editor . $bibentry->getField(BOOKTITLE); } else if ($type=="incollection") { - $booktitle = 'Chapter in '; + $booktitle = __('Chapter in').' '; if ($editor!='') $booktitle .= $editor; $booktitle .= $bibentry->getField(BOOKTITLE); } else if ($type=="article") { @@ -2656,11 +2656,11 @@ function VancouverBibliographyStyle($bibentry) { $publisher=''; if ($type=="phdthesis") { - $publisher = 'PhD thesis, '.$bibentry->getField(SCHOOL); + $publisher = __('PhD thesis').', '.$bibentry->getField(SCHOOL); } else if ($type=="mastersthesis") { - $publisher = 'Master\'s thesis, '.$bibentry->getField(SCHOOL); + $publisher = __('Master\'s thesis').', '.$bibentry->getField(SCHOOL); } else if ($type=="techreport") { - $publisher = 'Technical report, '.$bibentry->getField("institution"); + $publisher = __('Technical report').', '.$bibentry->getField("institution"); } if ($bibentry->hasField("publisher")) { $publisher = $bibentry->getField("publisher"); From 2867059f685e49a5195b08bb55619bec2cd5be6d Mon Sep 17 00:00:00 2001 From: Martin Monperrus Date: Tue, 9 Sep 2025 07:13:11 +0200 Subject: [PATCH 6/8] fix https://github.com/monperrus/bibtexbrowser/issues/136 --- BibtexbrowserTest.php | 66 +++++++++++++++++++++++++++++++++++++++++++ bibtexbrowser.php | 2 +- 2 files changed, 67 insertions(+), 1 deletion(-) diff --git a/BibtexbrowserTest.php b/BibtexbrowserTest.php index cca6d4a..4cd0d27 100755 --- a/BibtexbrowserTest.php +++ b/BibtexbrowserTest.php @@ -1455,6 +1455,72 @@ class BibtexbrowserTest extends PHPUnit_Framework_TestCase { $this->assertEquals(0, count($results)); } + function test_tags_pagination() { + // Define the page size for pagination + bibtexbrowser_configure('TAGS_SIZE', 2); + + // Create a test BibTeX database with multiple entries and keywords + $bibtex = "@article{paper1,title={Paper One},keywords={tagA, tagB},year=2020} + @article{paper2,title={Paper Two},keywords={tagC},year=2020} + @article{paper3,title={Paper Three},keywords={tagD},year=2020} + @article{paper4,title={Paper Four},keywords={tagE},year=2020}"; + + $test_data = fopen('php://memory','r+'); + fwrite($test_data, $bibtex); + fseek($test_data, 0); + + $db = new BibDataBase(); + $db->update_internal("inline", $test_data); + + // Create MenuManager display + $display = new MenuManager(); + $display->setDB($db); + + // Test the first page + $_GET["tags_page"] = '1'; + ob_start(); + $display->display(); + $output1 = ob_get_clean(); + + // Tags are sorted alphabetically. + $this->assertStringContainsString('tagA', $output1); + $this->assertStringContainsString('tagB', $output1); + $this->assertStringNotContainsString('tagC', $output1); + + // Verify pagination link to the next page + $this->assertStringContainsString('keywords_page=2', $output1); + + // Test the second page + $_GET["keywords_page"] = '2'; + ob_start(); + $display->display(); + $output2 = ob_get_clean(); + + $this->assertStringContainsString('tagC', $output2); + $this->assertStringContainsString('tagD', $output2); + $this->assertStringNotContainsString('tagA', $output2); + $this->assertStringNotContainsString('tagE', $output2); + + // Verify navigation links to previous and next pages + $this->assertStringContainsString('keywords_page=1', $output2); + $this->assertStringContainsString('keywords_page=3', $output2); + + // Test the third page + $_GET["keywords_page"] = '3'; + ob_start(); + $display->display(); + $output3 = ob_get_clean(); + + $this->assertStringContainsString('tagE', $output3); + $this->assertStringNotContainsString('tagD', $output3); + + // Verify navigation link to the previous page + $this->assertStringContainsString('keywords_page=2', $output3); + $this->assertStringNotContainsString('keywords_page=4', $output3); // No next page + + // Clean up + unset($_GET["keywords_page"]); + } function test_venuevc_pagination() { // Define the page size for pagination bibtexbrowser_configure('VENUE_SIZE', 2); diff --git a/bibtexbrowser.php b/bibtexbrowser.php index a5b04ff..dcc05d3 100755 --- a/bibtexbrowser.php +++ b/bibtexbrowser.php @@ -2994,7 +2994,7 @@ class MenuManager { } else $page = 1; - if (count($tags)>0) $this->displayMenu('Keywords', $tags, $page, bibtexbrowser_configuration("MENU_SIZE"), Q_TAG_PAGE, + if (count($tags)>0) $this->displayMenu('Keywords', $tags, $page, bibtexbrowser_configuration("TAGS_SIZE"), Q_TAG_PAGE, Q_TAG); } From 2381e7c412d616db80d9f93aa99d86ac87b9a4ed Mon Sep 17 00:00:00 2001 From: Hans-Nikolai Viessmann Date: Wed, 1 Oct 2025 14:00:10 +0200 Subject: [PATCH 7/8] add DokuWiki bb2dw plugin reference to readme file (#138) --- README.wiki | 1 + 1 file changed, 1 insertion(+) diff --git a/README.wiki b/README.wiki index eeb5b3c..cd90d51 100755 --- a/README.wiki +++ b/README.wiki @@ -60,6 +60,7 @@ The following uses bibtexbrowser under the hood: * [[http://www.monperrus.net/martin/feeding-mysql-database-with-bibtexbrowser|Feeding a MySQL database from the content of a bibtex file]] * Publication lists in Wordpress with [[http://www.monperrus.net/martin/wp-publications|wp-publications]] * [[http://www.monperrus.net/martin/publication-lists-with-hal-and-bibtexbrowser|Publication lists with HAL and bibtexbrowser]] +* Generating publication lists in DokuWiki using the [[https://www.dokuwiki.org/plugin:bb4dw|bb4dw plugin]] =====Demo and screenshot===== From 95fe89312145c6b6f5817307f621fbe0792855e9 Mon Sep 17 00:00:00 2001 From: Martin Monperrus Date: Wed, 1 Oct 2025 14:04:59 +0200 Subject: [PATCH 8/8] Update README.wiki --- README.wiki | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.wiki b/README.wiki index cd90d51..4dac4f2 100755 --- a/README.wiki +++ b/README.wiki @@ -64,7 +64,7 @@ The following uses bibtexbrowser under the hood: =====Demo and screenshot===== -Demo: [[http://bibtexbrowser.sourceforge.net/bibtexbrowser.php?bib=metrics.bib|Here, you can browse a bibtex file dedicated to software metrics]] +Demo: [[https://www.monperrus.net/martin/bibtexbrowser.php|Here, you can browse a bibtex file of Martin's papers.]] bibtexbrowser screenshot