Merge "Fix development environment by adding default annotation helper"
diff --git a/.gitignore b/.gitignore
index 2dbe719..c954958 100644
--- a/.gitignore
+++ b/.gitignore
@@ -11,6 +11,8 @@
 kalamar.*.conf
 kalamar.conf.json
 kalamar.conf.js
+kalamar.*.dict
+!kalamar.queries.dict
 script/hypnotoad.pid
 .sass-cache
 dev/css
diff --git a/Changes b/Changes
index 7a02ead..d1e1eb2 100755
--- a/Changes
+++ b/Changes
@@ -1,4 +1,4 @@
-0.26 2018-02-12
+0.26 2018-02-14
         - Added meta data view.
         - Attach reference line to match bottom.
         - Separate match views and integrate relation menu
@@ -6,7 +6,9 @@
         - Attach querycreator object to annotation table.
         - Update client side dependencies
         - Introduce development mode to client side code.
-        - Generalized Poliqarp tutorials.
+        - Generalized Poliqarp tutorials and made
+          example queries corpus independent.
+        - Improve README.
 
 0.25 2018-01-31
         - Make annotation helper configurable.
diff --git a/README.md b/README.md
index 29120a5..5ea5725 100644
--- a/README.md
+++ b/README.md
@@ -91,6 +91,9 @@
 The basic configuration file is ```kalamar.conf```. To define derivations,
 create a configuration file with the pattern ```kalamar.[MYNAME].conf``` and
 follow the descriptions in ```kalamar.conf```.
+For client-side configurations, a file ```kalamar.conf.js``` can be
+introduced, that will be consulted during the build process, loading
+optional components using a ```require(...)``` directive.
 
 ### Localization
 
@@ -101,10 +104,44 @@
 $ perl script/kalamar localize pl
 ```
 
-The newly defined dictionary file can then be added to the resource definition
-of the ```Localize``` plugin.
+The newly defined dictionary file can then be modified and added to the resources
+definition of the ```Localize``` plugin in the configuration:
+
+```
+Localize => {
+  resources => ['kalamar.pl.dict']
+}
+```
+
+To localize example queries according to a special corpus environment,
+define a name of the example corpus in the configuration,
+and create a translation file based on ```kalamar.queries.dict```
+as a blueprint.
+
+```
+Kalamar => {
+  examplecorpus => 'mycorpus'
+}
+
+```
 
 Currently the JavaScript translations are separated and stored in ```dev/js/src/loc```.
+To generate assets relying on different locales, add the locale to ```Gruntfile.js```.
+
+To localize the annotation helper according to a special corpus environment,
+different annotation foundries can be loaded in ```kalamar.conf.js```.
+For example to support ```marmot``` and ```malt```,
+the configuration may look like this:
+
+```
+require([
+  "hint/foundries/marmot",
+  "hint/foundries/malt"
+]);
+```
+
+See ```dev/js/src/hint/foundries``` for
+more optional foundries.
 
 
 ## COPYRIGHT AND LICENSE
diff --git a/kalamar.conf b/kalamar.conf
index b9d1519..5a7c635 100644
--- a/kalamar.conf
+++ b/kalamar.conf
@@ -5,7 +5,7 @@
 #
 #   kalamar.[MYNAME].conf
 #
-# To load the configuration, start your applikation with
+# To load the configuration, start your application with
 # the environment variable
 #
 #   MOJO_MODE=[MYNAME]
@@ -13,14 +13,15 @@
 # Further typical configurations in this file include
 #
 # - hypnotoad
-#    See Mojo::Server::Hypnotoad
+#     See Mojo::Server::Hypnotoad
 # - MailException
-#    See Mojolicious::Plugin::MailException
+#     See Mojolicious::Plugin::MailException
 # - TagHelpers-Pagination
-#    See Mojolicious::Plugin::TagHelpers::Pagination
+#     See Mojolicious::Plugin::TagHelpers::Pagination
 # - Search
-#    See Mojolicious::Plugin::Search
-#
+#     See Mojolicious::Plugin::Search
+# - Localize
+#     See Mojolicious::Plugin::Localize
 
 # The default Kustvakt api endpoint
 my $api = 'http://localhost:9999/api/';
@@ -40,7 +41,7 @@
 
     # The name of the base corpus,
     # for query examples (see kalamar.queries.dict)
-    # examplecorpus => 'corola'
+    # examplecorpus => 'dereko'
   },
 
   # See Mojolicious::Plugin::TagHelpers::MailToChiffre
diff --git a/kalamar.queries.dict b/kalamar.queries.dict
index 311ed42..5192f8a 100644
--- a/kalamar.queries.dict
+++ b/kalamar.queries.dict
@@ -2,7 +2,6 @@
 # prepend the string '** ' to the query.
 {
   Q => {
-    _ => sub { shift->config('Kalamar')->{'examplecorpus'} },
     -dereko => {
       poliqarp => {
         simple => 'Baum',
diff --git a/lib/Kalamar.pm b/lib/Kalamar.pm
index fbb418f..43e98b6 100644
--- a/lib/Kalamar.pm
+++ b/lib/Kalamar.pm
@@ -105,6 +105,11 @@
 
   # Localization framework
   $self->plugin(Localize => {
+    dict => {
+      Q => {
+        _ => sub { shift->config('Kalamar')->{'examplecorpus'} },
+      }
+    },
     resources => ['kalamar.dict', 'kalamar.queries.dict']
   });