diff --git a/atramhasis/__init__.py b/atramhasis/__init__.py index 42cea536..e57d4d16 100644 --- a/atramhasis/__init__.py +++ b/atramhasis/__init__.py @@ -16,6 +16,7 @@ def includeme(config): config.add_route('search_result', pattern='/conceptschemes/{scheme_id}/c', accept='text/html') config.include('pyramid_skosprovider') config.scan('pyramid_skosprovider') + config.add_translation_dirs('atramhasis:locale/') config.scan() diff --git a/atramhasis/locale/de/LC_MESSAGES/atramhasis.po b/atramhasis/locale/de/LC_MESSAGES/atramhasis.po deleted file mode 100644 index 0df243db..00000000 --- a/atramhasis/locale/de/LC_MESSAGES/atramhasis.po +++ /dev/null @@ -1,21 +0,0 @@ -# Translations template for PROJECT. -# Copyright (C) 2011 ORGANIZATION -# This file is distributed under the same license as the PROJECT project. -# FIRST AUTHOR , 2011. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: PROJECT VERSION\n" -"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2011-05-12 09:14-0330\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=utf-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Generated-By: Babel 0.9.6\n" - -msgid "Hello!" -msgstr "Hallo!" diff --git a/atramhasis/locale/en/LC_MESSAGES/atramhasis.po b/atramhasis/locale/en/LC_MESSAGES/atramhasis.po new file mode 100644 index 00000000..1ebb3bb3 --- /dev/null +++ b/atramhasis/locale/en/LC_MESSAGES/atramhasis.po @@ -0,0 +1,23 @@ +# English translations for atramhasis. +# Copyright (C) 2014 ORGANIZATION +# This file is distributed under the same license as the atramhasis project. +# FIRST AUTHOR , 2014. +# +msgid "" +msgstr "" +"Project-Id-Version: atramhasis 0.0\n" +"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" +"POT-Creation-Date: 2014-04-18 14:14+0200\n" +"PO-Revision-Date: 2014-04-18 14:38+0200\n" +"Last-Translator: FULL NAME \n" +"Language-Team: en \n" +"Plural-Forms: nplurals=2; plural=(n != 1)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 1.3\n" + +#: atramhasis/templates/atramhasis.jinja2:10 +msgid "tr_search" +msgstr "Search" + diff --git a/atramhasis/locale/fr/LC_MESSAGES/atramhasis.po b/atramhasis/locale/fr/LC_MESSAGES/atramhasis.po index dc0aae5d..56e72048 100644 --- a/atramhasis/locale/fr/LC_MESSAGES/atramhasis.po +++ b/atramhasis/locale/fr/LC_MESSAGES/atramhasis.po @@ -1,21 +1,23 @@ -# Translations template for PROJECT. -# Copyright (C) 2011 ORGANIZATION -# This file is distributed under the same license as the PROJECT project. -# FIRST AUTHOR , 2011. +# French translations for atramhasis. +# Copyright (C) 2014 ORGANIZATION +# This file is distributed under the same license as the atramhasis project. +# FIRST AUTHOR , 2014. # -#, fuzzy msgid "" msgstr "" -"Project-Id-Version: PROJECT VERSION\n" +"Project-Id-Version: atramhasis 0.0\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2011-05-12 09:14-0330\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"POT-Creation-Date: 2014-04-18 14:14+0200\n" +"PO-Revision-Date: 2014-04-18 14:38+0200\n" "Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" +"Language-Team: fr \n" +"Plural-Forms: nplurals=2; plural=(n > 1)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" -"Generated-By: Babel 0.9.6\n" +"Generated-By: Babel 1.3\n" + +#: atramhasis/templates/atramhasis.jinja2:10 +msgid "tr_search" +msgstr "Rechercher" -msgid "Hello!" -msgstr "Bonjour!" diff --git a/atramhasis/locale/nl/LC_MESSAGES/atramhasis.po b/atramhasis/locale/nl/LC_MESSAGES/atramhasis.po new file mode 100644 index 00000000..62de5eda --- /dev/null +++ b/atramhasis/locale/nl/LC_MESSAGES/atramhasis.po @@ -0,0 +1,23 @@ +# Dutch translations for atramhasis. +# Copyright (C) 2014 ORGANIZATION +# This file is distributed under the same license as the atramhasis project. +# FIRST AUTHOR , 2014. +# +msgid "" +msgstr "" +"Project-Id-Version: atramhasis 0.0\n" +"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" +"POT-Creation-Date: 2014-04-18 14:14+0200\n" +"PO-Revision-Date: 2014-04-18 14:22+0200\n" +"Last-Translator: FULL NAME \n" +"Language-Team: nl \n" +"Plural-Forms: nplurals=2; plural=(n != 1)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 1.3\n" + +#: atramhasis/templates/atramhasis.jinja2:10 +msgid "tr_search" +msgstr "Zoeken" + diff --git a/atramhasis/static/js/vendor/app.js b/atramhasis/static/js/vendor/app.js index ec1f6989..870ddc5e 100644 --- a/atramhasis/static/js/vendor/app.js +++ b/atramhasis/static/js/vendor/app.js @@ -6,4 +6,20 @@ $(document).ready(function () { var url = $("#scheme").val(); $("#search-form").attr("action", url); }); -}); \ No newline at end of file + + /* + * Language cookie + */ + var usrLang = $.cookie( '_LOCALE_' ); + if (usrLang==null)usrLang='en' + $('#LanguageDropDownList').val(usrLang); + $('#LanguageDropDownList').change(function () { + changeLanguage($('#LanguageDropDownList').val()); + }); +}); + +function changeLanguage(usrLang) { + $.cookie('_LOCALE_', usrLang, { expires: 365, path: '/' }); + location.reload(); +} + diff --git a/atramhasis/templates/atramhasis.jinja2 b/atramhasis/templates/atramhasis.jinja2 index 615f0f6f..939077c0 100644 --- a/atramhasis/templates/atramhasis.jinja2 +++ b/atramhasis/templates/atramhasis.jinja2 @@ -7,7 +7,7 @@ {% block content %}
-
Search
+
{% trans %}tr_search{% endtrans %}
diff --git a/atramhasis/templates/base.jinja2 b/atramhasis/templates/base.jinja2 index 02de0e1d..67c6e858 100644 --- a/atramhasis/templates/base.jinja2 +++ b/atramhasis/templates/base.jinja2 @@ -18,6 +18,17 @@

[atramhasis]

+ + +
+
    + +
+
@@ -41,6 +52,7 @@ + diff --git a/message-extraction.ini b/message-extraction.ini index 0c3d54bc..8599639d 100644 --- a/message-extraction.ini +++ b/message-extraction.ini @@ -1,3 +1,2 @@ -[python: **.py] [jinja2: **.jinja2] encoding = utf-8