Added german poliqarp tutorial
Change-Id: I6addb6c6c4a0fee2f5725701b961ac58a531db1a
diff --git a/kalamar.dict b/kalamar.dict
index 72ae9bf..6d95ce7 100644
--- a/kalamar.dict
+++ b/kalamar.dict
@@ -61,6 +61,13 @@
loginFail => 'Anmeldung fehlgeschlagen',
logoutSuccess => 'Abmeldung erfolgreich',
logoutFail => 'Abmeldung fehlgeschlagen'
+ },
+ Template => {
+ doc => {
+ ql => {
+ 'poliqarp-plus' => 'de/doc/ql/poliqarp-plus'
+ }
+ }
}
},
-en => {
@@ -115,6 +122,18 @@
loginFail => 'Access denied',
logoutSuccess => 'Logout successful',
logoutFail => 'Logout failed'
+ },
+ Template => {
+ doc => {
+ ql => {
+# 'annis' => 'doc/ql/annis',
+# 'cosmas-2' => 'doc/ql/cosmas-2',
+# 'cql' => 'doc/ql/cql',
+ 'poliqarp-plus' => 'doc/ql/poliqarp-plus',
+# 'regexp' => 'doc/ql/regexp',
+# 'wildcards' => 'doc/ql/wildcards'
+ }
+ }
}
}
};
diff --git a/lib/Kalamar/Controller/Documentation.pm b/lib/Kalamar/Controller/Documentation.pm
index 8d2510b..10e982f 100644
--- a/lib/Kalamar/Controller/Documentation.pm
+++ b/lib/Kalamar/Controller/Documentation.pm
@@ -4,6 +4,7 @@
# Show documentation page
sub page {
my $c = shift;
+
if ($c->param('embedded')) {
$c->stash(embedded => 1);
};
@@ -27,7 +28,7 @@
return $c->render(
sidebar_active => 1,
main_class => 'tutorial',
- template => join('/', @path)
+ template => $c->loc('Template_' . join('_', @path), join('/', @path))
);
};
diff --git a/t/doc.t b/t/doc.t
index 1b06146..b16e1d9 100644
--- a/t/doc.t
+++ b/t/doc.t
@@ -7,6 +7,7 @@
my $t = Test::Mojo->new('Kalamar');
+# Embedding
$t->get_ok('/doc/ql/poliqarp-plus')
->status_is(200)
->text_like('title', qr/poliqarp/i)
@@ -27,5 +28,31 @@
->element_exists('li.folded.active')
->text_is('li.folded.active a', 'Poliqarp+');
+# Languages
+$t->get_ok('/' => { 'Accept-Language' => 'de-DE, en-US, en' })
+ ->status_is(200)
+ ->text_is("title", "KorAP - Korpusanalyseplattform der nächsten Generation");
+
+$t->get_ok('/' => { 'Accept-Language' => 'en-US, en, de-DE' })
+ ->status_is(200)
+ ->text_is("title", "KorAP - Corpus Analysis Platform");
+
+
+# Pages
+$t->get_ok('/doc/ql/poliqarp-plus' => { 'Accept-Language' => 'en-US, en, de-DE' })
+ ->status_is(200)
+ ->text_is("title", "KorAP: Poliqarp+")
+ ->text_is('main section > h3', 'Simple Segments');
+
+$t->get_ok('/doc/ql/poliqarp-plus' => { 'Accept-Language' => 'de-DE, en-US, en' })
+ ->status_is(200)
+ ->text_is("title", "KorAP: Poliqarp+")
+ ->text_is('main section > h3', 'Einfache Segmente');
+
+
+$t->get_ok('/doc/ql/annis' => { 'Accept-Language' => 'en-US, en, de-DE' })
+ ->status_is(200)
+ ->text_is("title", "KorAP: Annis QL");
+
done_testing();
diff --git a/templates/de/doc/ql/poliqarp-plus.html.ep b/templates/de/doc/ql/poliqarp-plus.html.ep
index a619f98..827ae01 100644
--- a/templates/de/doc/ql/poliqarp-plus.html.ep
+++ b/templates/de/doc/ql/poliqarp-plus.html.ep
@@ -75,7 +75,7 @@
%= doc_query poliqarp => '[base=Baum]'
- <p>Der dritte Sonderschlüssel ist <code>pos</code> und bezieht sich auf die Wortarten-Annotation der <% = doc_link_to 'Standard-Foundry', 'data', 'annotation'%>.
+ <p>Der dritte Sonderschlüssel ist <code>pos</code> und bezieht sich auf die Wortarten-Annotation der <%= doc_link_to 'Standard-Foundry', 'data', 'annotation'%>.
Die folgende Abfrage findet alle attributiven Adjektive:</p>
%= doc_query poliqarp => '[pos=ADJA]'