Add addon to title
Change-Id: Ifca39aab2c1ada0adb54f05f48a6e0c3a8b7f358
diff --git a/Changes b/Changes
index bbbd952..2d6e43c 100644
--- a/Changes
+++ b/Changes
@@ -1,5 +1,6 @@
-0.52 2023-11-22
+0.52 2023-11-29
- Update Piwik dependency to point to matomo.js. (diewald)
+ - Add addon to title and description. (diewald)
0.51 2023-09-27
- Support defined log file in configuration. (diewald)
diff --git a/kalamar.dict b/kalamar.dict
index e6332fe..98b3154 100644
--- a/kalamar.dict
+++ b/kalamar.dict
@@ -27,7 +27,7 @@
pwdforgotten => 'Password vergessen?',
# TODO: use document.write() refering to vc.getName()!
searchjob => '»<%== $q %>« <% if (param("collection")) { %>im definierten Korpus <% } %>mit <%== loc("QL_" . $ql, "unbekannter Anfragesprache") %>',
- searchtitle => 'KorAP: Finde <%== loc("searchjob") %>',
+ searchtitle => '<%= loc("en_korap_label") %>: Finde <%== loc("searchjob") %>',
searchplaceholder => 'Finde ...',
go => 'Los!',
news => 'Neuigkeiten & Ankündigungen',
@@ -56,8 +56,8 @@
underConstruction => 'In Vorbereitung!',
korap => {
-short => 'KorAP',
- desc => 'KorAP - Korpusanalyseplattform der nächsten Generation',
- overview => 'KorAP - Übersicht',
+ desc => '<%= loc "en_korap_label" %> - Korpusanalyseplattform der nächsten Generation',
+ overview => '<%= loc "en_korap_label" %> - Übersicht',
keywords => 'KorAP, DeReKo, Korpussuche, IDS Mannheim, Leibniz-Institut für Deutsche Sprache',
},
privacy => 'Datenschutz',
@@ -129,7 +129,7 @@
news => 'News & Announcements',
# TODO: use document.write() refering to vc.getName()!
searchjob => '»<%== $q %>« <% if (param("collection")) { %>in the defined corpus <% } %>with <%== loc("QL_". $ql, "unknown query language") %>',
- searchtitle => 'KorAP: Find <%== loc("searchjob") %>',
+ searchtitle => '<%= loc("korap_label") %>: Find <%== loc("searchjob") %>',
searchplaceholder => 'Find ...',
in => 'in',
by => 'by',
@@ -156,8 +156,9 @@
tutorial => 'Help and Documentation',
korap => {
-short => 'KorAP',
- desc => 'KorAP - Corpus Analysis Platform',
- overview => 'KorAP - Overview',
+ label => '<%= loc "korap_short" %><% if (loc("title_addon")) { %>-<%= loc("title_addon") %><% } %>',
+ desc => '<%= loc "korap_label" %> - Corpus Analysis Platform',
+ overview => '<%= loc "korap_label" %> - Overview',
region => 'DE-BW',
placename => 'Mannheim',
keywords => 'KorAP, DeReKo, Corpus Query Platform, IDS Mannheim, Leibniz Institute for the German Language'
diff --git a/t/page.t b/t/page.t
index 11bc8e1..8b0afd0 100644
--- a/t/page.t
+++ b/t/page.t
@@ -47,6 +47,7 @@
de_recentCorpusPub => 'Neuere Publikationen zu DeReKo als linguistische Forschungsdatengrundlage',
en_recentToolPub => 'Recent publications to refer to KorAP as a research tool',
de_recentToolPub => 'Neuere Publikationen zu KorAP als Forschungswerkzeug',
+ title_addon => 'Test',
}
},
'TagHelpers-ContentBlock' => {
@@ -81,6 +82,12 @@
->text_is('section > section h4', 'Recent publications to refer to DeReKo as linguistic research data')
;
+$t->get_ok('/')
+ ->text_is('title', 'KorAP-Test - Corpus Analysis Platform')
+ ->text_is('h1 > span', 'KorAP-Test - Corpus Analysis Platform')
+ ->text_is('div.logoaddon', 'Test')
+ ;
+
done_testing;
1;
diff --git a/t/query.t b/t/query.t
index c7d0a55..376a879 100644
--- a/t/query.t
+++ b/t/query.t
@@ -11,7 +11,13 @@
my $mount_point = '/realapi/';
$ENV{KALAMAR_API} = $mount_point;
-my $t = Test::Mojo->new('Kalamar');
+my $t = Test::Mojo->new('Kalamar' => {
+ Localize => {
+ dict => {
+ title_addon => 'Test'
+ }
+ }
+});
# Mount fake backend
# Get the fixture path
@@ -32,8 +38,8 @@
->status_is(200)
->content_type_is('text/html;charset=UTF-8')
- ->text_is('title', 'KorAP: Find »baum« with Poliqarp')
- ->element_exists('meta[name="DC.title"][content="KorAP: Find »baum« with Poliqarp"]')
+ ->text_is('title', 'KorAP-Test: Find »baum« with Poliqarp')
+ ->element_exists('meta[name="DC.title"][content="KorAP-Test: Find »baum« with Poliqarp"]')
->element_exists('body[itemscope][itemtype="http://schema.org/SearchResultsPage"]')
# Total results
@@ -102,8 +108,8 @@
# Query with partial cache (for total results)
$err = $t->get_ok('/?q=baum')
->status_is(200)
- ->text_is('title', 'KorAP: Find »baum« with Poliqarp')
- ->element_exists('meta[name="DC.title"][content="KorAP: Find »baum« with Poliqarp"]')
+ ->text_is('title', 'KorAP-Test: Find »baum« with Poliqarp')
+ ->element_exists('meta[name="DC.title"][content="KorAP-Test: Find »baum« with Poliqarp"]')
->element_exists('body[itemscope][itemtype="http://schema.org/SearchResultsPage"]')
->header_isnt('X-Kalamar-Cache', 'true')
->content_like(qr!${q}cutOff${q}:true!)
@@ -115,8 +121,8 @@
# Query without partial cache (unfortunately) (but no total results)
$err = $t->get_ok('/?q=baum&cutoff=true')
->status_is(200)
- ->text_is('title', 'KorAP: Find »baum« with Poliqarp')
- ->element_exists('meta[name="DC.title"][content="KorAP: Find »baum« with Poliqarp"]')
+ ->text_is('title', 'KorAP-Test: Find »baum« with Poliqarp')
+ ->element_exists('meta[name="DC.title"][content="KorAP-Test: Find »baum« with Poliqarp"]')
->element_exists('body[itemscope][itemtype="http://schema.org/SearchResultsPage"]')
->header_isnt('X-Kalamar-Cache', 'true')
->content_like(qr!${q}cutOff${q}:true!)
@@ -128,8 +134,8 @@
# Query with partial cache (but no total results)
$err = $t->get_ok('/?q=baum&cutoff=true')
->status_is(200)
- ->text_is('title', 'KorAP: Find »baum« with Poliqarp')
- ->element_exists('meta[name="DC.title"][content="KorAP: Find »baum« with Poliqarp"]')
+ ->text_is('title', 'KorAP-Test: Find »baum« with Poliqarp')
+ ->element_exists('meta[name="DC.title"][content="KorAP-Test: Find »baum« with Poliqarp"]')
->element_exists('body[itemscope][itemtype="http://schema.org/SearchResultsPage"]')
->header_is('X-Kalamar-Cache', 'true')
->content_like(qr!${q}cutOff${q}:true!)
@@ -142,8 +148,8 @@
# Query with full cache
$err = $t->get_ok('/?q=baum')
->status_is(200)
- ->text_is('title', 'KorAP: Find »baum« with Poliqarp')
- ->element_exists('meta[name="DC.title"][content="KorAP: Find »baum« with Poliqarp"]')
+ ->text_is('title', 'KorAP-Test: Find »baum« with Poliqarp')
+ ->element_exists('meta[name="DC.title"][content="KorAP-Test: Find »baum« with Poliqarp"]')
->element_exists('body[itemscope][itemtype="http://schema.org/SearchResultsPage"]')
->header_is('X-Kalamar-Cache', 'true')
->content_like(qr!${q}cutOff${q}:true!)
@@ -156,7 +162,7 @@
# Query with page information
$err = $t->get_ok('/?q=der&p=1&count=2' => { 'Accept-Language' => 'en-US, en, de-DE' })
->status_is(200)
- ->text_is('title', 'KorAP: Find »der« with Poliqarp')
+ ->text_is('title', 'KorAP-Test: Find »der« with Poliqarp')
# Total results
->text_is('#total-results', '14,581')
@@ -193,7 +199,8 @@
# Query with page information - next page
$err = $t->get_ok('/?q=der&p=2&count=2' => { 'Accept-Language' => 'de-DE, en-US, en' })
->status_is(200)
- ->text_is('title', 'KorAP: Finde »der« mit Poliqarp')
+ ->text_is('div.logoaddon', 'Test')
+ ->text_is('title', 'KorAP-Test: Finde »der« mit Poliqarp')
->element_exists('#search')
# Total results
diff --git a/templates/layouts/main.html.ep b/templates/layouts/main.html.ep
index 5e0c8d7..590ce85 100644
--- a/templates/layouts/main.html.ep
+++ b/templates/layouts/main.html.ep
@@ -20,7 +20,7 @@
<meta name="author" content="The KorAP Team" />
<meta name="DC.type" content="service" />
<meta name="DC.creator" content="IDS Mannheim" />
- <meta name="DC.title" content="<%= title() || loc('korap_short') %>" />
+ <meta name="DC.title" content="<%= title() || loc('korap_desc') %>" />
<meta name="DC.description" content="<%= $desc %>" />
<meta name="DC.format" content="text/html" />
<meta name="DC.contributor" content="The KorAP Team" />