diff --git a/edx_notifications/server/urls.py b/edx_notifications/server/urls.py index 45dff847..afb41770 100644 --- a/edx_notifications/server/urls.py +++ b/edx_notifications/server/urls.py @@ -3,8 +3,10 @@ """ from django.conf.urls import url, include +from django.views.i18n import JavaScriptCatalog urlpatterns = [ # pylint: disable=invalid-name url(r'^web/', include('edx_notifications.server.web.urls')), url(r'^api/', include('edx_notifications.server.api.urls')), + url(r'^jsi18n/$', JavaScriptCatalog.as_view(), name='javascript-catalog'), ] diff --git a/edx_notifications/server/web/locale/ar/LC_MESSAGES/django.mo b/edx_notifications/server/web/locale/ar/LC_MESSAGES/django.mo new file mode 100644 index 00000000..8c99fd90 Binary files /dev/null and b/edx_notifications/server/web/locale/ar/LC_MESSAGES/django.mo differ diff --git a/edx_notifications/server/web/locale/ar/LC_MESSAGES/django.po b/edx_notifications/server/web/locale/ar/LC_MESSAGES/django.po new file mode 100644 index 00000000..ba4d7ca2 --- /dev/null +++ b/edx_notifications/server/web/locale/ar/LC_MESSAGES/django.po @@ -0,0 +1,44 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-11-06 18:50+0500\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 " +"&& n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n" + +#: templates/django/notifications_widget_header.html:26 +msgid "View unread" +msgstr "عرض غير المقروءة" + +#: templates/django/notifications_widget_header.html:27 +msgid "View all" +msgstr "عرض الك" + +#: templates/django/notifications_widget_header.html:28 +msgid "Mark as read" +msgstr "وضع علامة كمقروء" + +#: templates/django/notifications_widget_header.html:31 +msgid "Hide" +msgstr "إخفاء" + +#: templates/django/notifications_widget_header.html:44 +msgid "You have no unread notifications." +msgstr "ليس لديك إشعارات غير مقروءة." + +#: templates/django/notifications_widget_preferences_header.html:11 +msgid "Notification preferences" +msgstr "تفضيلات الإشعارات" diff --git a/edx_notifications/server/web/locale/de/LC_MESSAGES/django.mo b/edx_notifications/server/web/locale/de/LC_MESSAGES/django.mo new file mode 100644 index 00000000..173ec0ab Binary files /dev/null and b/edx_notifications/server/web/locale/de/LC_MESSAGES/django.mo differ diff --git a/edx_notifications/server/web/locale/de/LC_MESSAGES/django.po b/edx_notifications/server/web/locale/de/LC_MESSAGES/django.po new file mode 100644 index 00000000..680d5f5c --- /dev/null +++ b/edx_notifications/server/web/locale/de/LC_MESSAGES/django.po @@ -0,0 +1,43 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-11-06 18:50+0500\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: templates/django/notifications_widget_header.html:26 +msgid "View unread" +msgstr "Ungelesene anzeigen" + +#: templates/django/notifications_widget_header.html:27 +msgid "View all" +msgstr "Alle anzeigen" + +#: templates/django/notifications_widget_header.html:28 +msgid "Mark as read" +msgstr "Als gelesen markieren" + +#: templates/django/notifications_widget_header.html:31 +msgid "Hide" +msgstr "Ausblenden" + +#: templates/django/notifications_widget_header.html:44 +msgid "You have no unread notifications." +msgstr "Sie haben keine ungelesenen Nachrichten" + +#: templates/django/notifications_widget_preferences_header.html:11 +msgid "Notification preferences" +msgstr "Benachrichtigungseinstellungen" diff --git a/edx_notifications/server/web/locale/en/LC_MESSAGES/django.mo b/edx_notifications/server/web/locale/en/LC_MESSAGES/django.mo new file mode 100644 index 00000000..24f0c511 Binary files /dev/null and b/edx_notifications/server/web/locale/en/LC_MESSAGES/django.mo differ diff --git a/edx_notifications/server/web/locale/en/LC_MESSAGES/django.po b/edx_notifications/server/web/locale/en/LC_MESSAGES/django.po new file mode 100644 index 00000000..c4c85033 --- /dev/null +++ b/edx_notifications/server/web/locale/en/LC_MESSAGES/django.po @@ -0,0 +1,42 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-11-06 18:50+0500\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: templates/django/notifications_widget_header.html:26 +msgid "View unread" +msgstr "" + +#: templates/django/notifications_widget_header.html:27 +msgid "View all" +msgstr "" + +#: templates/django/notifications_widget_header.html:28 +msgid "Mark as read" +msgstr "" + +#: templates/django/notifications_widget_header.html:31 +msgid "Hide" +msgstr "" + +#: templates/django/notifications_widget_header.html:44 +msgid "You have no unread notifications." +msgstr "" + +#: templates/django/notifications_widget_preferences_header.html:11 +msgid "Notification preferences" +msgstr "" diff --git a/edx_notifications/server/web/locale/es/LC_MESSAGES/django.mo b/edx_notifications/server/web/locale/es/LC_MESSAGES/django.mo new file mode 100644 index 00000000..e938b358 Binary files /dev/null and b/edx_notifications/server/web/locale/es/LC_MESSAGES/django.mo differ diff --git a/edx_notifications/server/web/locale/es/LC_MESSAGES/django.po b/edx_notifications/server/web/locale/es/LC_MESSAGES/django.po new file mode 100644 index 00000000..e823d69b --- /dev/null +++ b/edx_notifications/server/web/locale/es/LC_MESSAGES/django.po @@ -0,0 +1,42 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-11-06 18:50+0500\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: templates/django/notifications_widget_header.html:26 +msgid "View unread" +msgstr "Ver sin leer" + +#: templates/django/notifications_widget_header.html:27 +msgid "View all" +msgstr "Ver todas" + +#: templates/django/notifications_widget_header.html:28 +msgid "Mark as read" +msgstr "Marcar como leídas" + +#: templates/django/notifications_widget_header.html:31 +msgid "Hide" +msgstr "Ocultar" + +#: templates/django/notifications_widget_header.html:44 +msgid "You have no unread notifications." +msgstr "No hay notificaciones nuevas para mostrar." + +#: templates/django/notifications_widget_preferences_header.html:11 +msgid "Notification preferences" +msgstr "Preferencias de notificaciones" diff --git a/edx_notifications/server/web/locale/es419/LC_MESSAGES/django.mo b/edx_notifications/server/web/locale/es419/LC_MESSAGES/django.mo new file mode 100644 index 00000000..24f0c511 Binary files /dev/null and b/edx_notifications/server/web/locale/es419/LC_MESSAGES/django.mo differ diff --git a/edx_notifications/server/web/locale/es419/LC_MESSAGES/django.po b/edx_notifications/server/web/locale/es419/LC_MESSAGES/django.po new file mode 100644 index 00000000..c4c85033 --- /dev/null +++ b/edx_notifications/server/web/locale/es419/LC_MESSAGES/django.po @@ -0,0 +1,42 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-11-06 18:50+0500\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: templates/django/notifications_widget_header.html:26 +msgid "View unread" +msgstr "" + +#: templates/django/notifications_widget_header.html:27 +msgid "View all" +msgstr "" + +#: templates/django/notifications_widget_header.html:28 +msgid "Mark as read" +msgstr "" + +#: templates/django/notifications_widget_header.html:31 +msgid "Hide" +msgstr "" + +#: templates/django/notifications_widget_header.html:44 +msgid "You have no unread notifications." +msgstr "" + +#: templates/django/notifications_widget_preferences_header.html:11 +msgid "Notification preferences" +msgstr "" diff --git a/edx_notifications/server/web/locale/fr/LC_MESSAGES/django.mo b/edx_notifications/server/web/locale/fr/LC_MESSAGES/django.mo new file mode 100644 index 00000000..11384094 Binary files /dev/null and b/edx_notifications/server/web/locale/fr/LC_MESSAGES/django.mo differ diff --git a/edx_notifications/server/web/locale/fr/LC_MESSAGES/django.po b/edx_notifications/server/web/locale/fr/LC_MESSAGES/django.po new file mode 100644 index 00000000..04fec464 --- /dev/null +++ b/edx_notifications/server/web/locale/fr/LC_MESSAGES/django.po @@ -0,0 +1,43 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-11-06 18:50+0500\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#: templates/django/notifications_widget_header.html:26 +msgid "View unread" +msgstr "Afficher les élémens non lus" + +#: templates/django/notifications_widget_header.html:27 +msgid "View all" +msgstr "Affcicher tout" + +#: templates/django/notifications_widget_header.html:28 +msgid "Mark as read" +msgstr "Marquer comme lu" + +#: templates/django/notifications_widget_header.html:31 +msgid "Hide" +msgstr "Masquer" + +#: templates/django/notifications_widget_header.html:44 +msgid "You have no unread notifications." +msgstr "Vous n'avez aucune notification non lue." + +#: templates/django/notifications_widget_preferences_header.html:11 +msgid "Notification preferences" +msgstr "Préférences de notification" diff --git a/edx_notifications/server/web/locale/ja/LC_MESSAGES/django.mo b/edx_notifications/server/web/locale/ja/LC_MESSAGES/django.mo new file mode 100644 index 00000000..a685eae9 Binary files /dev/null and b/edx_notifications/server/web/locale/ja/LC_MESSAGES/django.mo differ diff --git a/edx_notifications/server/web/locale/ja/LC_MESSAGES/django.po b/edx_notifications/server/web/locale/ja/LC_MESSAGES/django.po new file mode 100644 index 00000000..c5550ca2 --- /dev/null +++ b/edx_notifications/server/web/locale/ja/LC_MESSAGES/django.po @@ -0,0 +1,43 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-11-06 18:50+0500\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#: templates/django/notifications_widget_header.html:26 +msgid "View unread" +msgstr "未読箇所を見る" + +#: templates/django/notifications_widget_header.html:27 +msgid "View all" +msgstr "全て見る" + +#: templates/django/notifications_widget_header.html:28 +msgid "Mark as read" +msgstr "既読にする" + +#: templates/django/notifications_widget_header.html:31 +msgid "Hide" +msgstr "隠す" + +#: templates/django/notifications_widget_header.html:44 +msgid "You have no unread notifications." +msgstr "未読通知はありません。" + +#: templates/django/notifications_widget_preferences_header.html:11 +msgid "Notification preferences" +msgstr "通知設定" diff --git a/edx_notifications/server/web/locale/nl/LC_MESSAGES/django.mo b/edx_notifications/server/web/locale/nl/LC_MESSAGES/django.mo new file mode 100644 index 00000000..690b1be1 Binary files /dev/null and b/edx_notifications/server/web/locale/nl/LC_MESSAGES/django.mo differ diff --git a/edx_notifications/server/web/locale/nl/LC_MESSAGES/django.po b/edx_notifications/server/web/locale/nl/LC_MESSAGES/django.po new file mode 100644 index 00000000..bc6c139b --- /dev/null +++ b/edx_notifications/server/web/locale/nl/LC_MESSAGES/django.po @@ -0,0 +1,43 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-11-06 18:50+0500\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: templates/django/notifications_widget_header.html:26 +msgid "View unread" +msgstr "" + +#: templates/django/notifications_widget_header.html:27 +msgid "View all" +msgstr "" + +#: templates/django/notifications_widget_header.html:28 +msgid "Mark as read" +msgstr "" + +#: templates/django/notifications_widget_header.html:31 +msgid "Hide" +msgstr "" + +#: templates/django/notifications_widget_header.html:44 +msgid "You have no unread notifications." +msgstr "" + +#: templates/django/notifications_widget_preferences_header.html:11 +msgid "Notification preferences" +msgstr "" diff --git a/edx_notifications/server/web/locale/pt/LC_MESSAGES/django.mo b/edx_notifications/server/web/locale/pt/LC_MESSAGES/django.mo new file mode 100644 index 00000000..0cc2a546 Binary files /dev/null and b/edx_notifications/server/web/locale/pt/LC_MESSAGES/django.mo differ diff --git a/edx_notifications/server/web/locale/pt/LC_MESSAGES/django.po b/edx_notifications/server/web/locale/pt/LC_MESSAGES/django.po new file mode 100644 index 00000000..a261252b --- /dev/null +++ b/edx_notifications/server/web/locale/pt/LC_MESSAGES/django.po @@ -0,0 +1,43 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-11-06 18:50+0500\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: templates/django/notifications_widget_header.html:26 +msgid "View unread" +msgstr "Ver não lida" + +#: templates/django/notifications_widget_header.html:27 +msgid "View all" +msgstr "Ver tudo" + +#: templates/django/notifications_widget_header.html:28 +msgid "Mark as read" +msgstr "Marcar como lida" + +#: templates/django/notifications_widget_header.html:31 +msgid "Hide" +msgstr "Ocultar" + +#: templates/django/notifications_widget_header.html:44 +msgid "You have no unread notifications." +msgstr "Você não tem notificações não lidas." + +#: templates/django/notifications_widget_preferences_header.html:11 +msgid "Notification preferences" +msgstr "Preferências de notificação" diff --git a/edx_notifications/server/web/locale/zh/LC_MESSAGES/django.mo b/edx_notifications/server/web/locale/zh/LC_MESSAGES/django.mo new file mode 100644 index 00000000..ca7d48b0 Binary files /dev/null and b/edx_notifications/server/web/locale/zh/LC_MESSAGES/django.mo differ diff --git a/edx_notifications/server/web/locale/zh/LC_MESSAGES/django.po b/edx_notifications/server/web/locale/zh/LC_MESSAGES/django.po new file mode 100644 index 00000000..3560b1f2 --- /dev/null +++ b/edx_notifications/server/web/locale/zh/LC_MESSAGES/django.po @@ -0,0 +1,42 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-11-06 18:50+0500\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: templates/django/notifications_widget_header.html:26 +msgid "View unread" +msgstr "查看未读项目" + +#: templates/django/notifications_widget_header.html:27 +msgid "View all" +msgstr "查看全部" + +#: templates/django/notifications_widget_header.html:28 +msgid "Mark as read" +msgstr "标记为已读" + +#: templates/django/notifications_widget_header.html:31 +msgid "Hide" +msgstr "隐藏" + +#: templates/django/notifications_widget_header.html:44 +msgid "You have no unread notifications." +msgstr "您有未读的通知。" + +#: templates/django/notifications_widget_preferences_header.html:11 +msgid "Notification preferences" +msgstr "通知首选项" diff --git a/edx_notifications/server/web/static/edx_notifications/js/views/notification_preferences_view.js b/edx_notifications/server/web/static/edx_notifications/js/views/notification_preferences_view.js index 784af409..73fcafe4 100644 --- a/edx_notifications/server/web/static/edx_notifications/js/views/notification_preferences_view.js +++ b/edx_notifications/server/web/static/edx_notifications/js/views/notification_preferences_view.js @@ -76,7 +76,8 @@ var NotificationPreferencesView = Backbone.View.extend({ /* we might - at some point - add a visual element to the */ /* loading, like a spinner */ var self = this; - this.collection.fetch({ + var language_code = ($('html').attr('lang') ? $('html').attr('lang') : 'en-us'); + this.collection.fetch({data: $.param({ course_lang: language_code}), success: function(){ self.render(); } diff --git a/edx_notifications/server/web/static/edx_notifications/templates/renderers/leaderboard/rank_changed.underscore b/edx_notifications/server/web/static/edx_notifications/templates/renderers/leaderboard/rank_changed.underscore index 5e05007b..7ffaf5f4 100644 --- a/edx_notifications/server/web/static/edx_notifications/templates/renderers/leaderboard/rank_changed.underscore +++ b/edx_notifications/server/web/static/edx_notifications/templates/renderers/leaderboard/rank_changed.underscore @@ -1 +1 @@ -You are now #<%= rank %> for <%= leaderboard_name %> in the cohort! +<%- gettext("You are now") %> #<%= rank %> <%- gettext("for") %> <%= leaderboard_name %> <%- gettext("in the cohort!") %> \ No newline at end of file diff --git a/edx_notifications/server/web/templates/django/notifications_widget_header.html b/edx_notifications/server/web/templates/django/notifications_widget_header.html index 7405cbfe..72267f5a 100644 --- a/edx_notifications/server/web/templates/django/notifications_widget_header.html +++ b/edx_notifications/server/web/templates/django/notifications_widget_header.html @@ -1,4 +1,5 @@ {% load static %} +{% load i18n %} @@ -6,6 +7,7 @@ + {% include 'django/notifications_widget_preferences_header.html' %} @@ -22,12 +24,12 @@

Notifications

    -
  • View unread
  • -
  • View all
  • -
  • Mark as read
  • +
  • {% trans "View unread" %}
  • +
  • {% trans "View all" %}
  • +
  • {% trans "Mark as read" %}
  • <% if (typeof this.global_variables.hide_link_is_visible != 'undefined' && this.global_variables.hide_link_is_visible != 'False') { %> -
  • Hide
  • +
  • {% trans "Hide" %}
  • <% } %> <% if (typeof this.global_variables.notification_preference_tab_is_visible != 'undefined' && this.global_variables.notification_preference_tab_is_visible == 'True') { %> @@ -40,7 +42,7 @@

    Notifications

      <% if (typeof grouped_user_notifications == 'undefined' || grouped_user_notifications.length == 0) { %>
    • -

      You have no unread notifications.

      +

      {% trans 'You have no unread notifications.' %}

    • <% } else { %> <% _.each(grouped_user_notifications, function(grouped_user_notification){ %> @@ -70,4 +72,4 @@

      <%= grouped_user_notification.group_title %>

- + \ No newline at end of file diff --git a/edx_notifications/server/web/templates/django/notifications_widget_preferences_header.html b/edx_notifications/server/web/templates/django/notifications_widget_preferences_header.html index 571c5a9e..404c6c85 100644 --- a/edx_notifications/server/web/templates/django/notifications_widget_preferences_header.html +++ b/edx_notifications/server/web/templates/django/notifications_widget_preferences_header.html @@ -1,4 +1,5 @@ {% load static %} +{% load i18n %} @@ -7,7 +8,7 @@ + \ No newline at end of file diff --git a/edx_notifications/server/web/urls.py b/edx_notifications/server/web/urls.py index 0cffa5e4..aa67da76 100644 --- a/edx_notifications/server/web/urls.py +++ b/edx_notifications/server/web/urls.py @@ -1,6 +1,6 @@ """ We currently have no server-side HTML generation. This file is reserved for future use. """ - urlpatterns = [ # pylint: disable=invalid-name + ] diff --git a/settings.py b/settings.py index 2663eab1..f22c7679 100644 --- a/settings.py +++ b/settings.py @@ -1,3 +1,5 @@ +#!/usr/bin/bash +# -*- coding: utf-8 -* """ Django settings file for local development purposes """ @@ -50,6 +52,28 @@ } }) + +js_info_dict = { + # 'packages': 'edx_notifications.server.web', + } +LANGUAGE_CODE = 'en' +LANGUAGES = ( + ('en', u'English '), + ('ar', u'العربية'), # Arabic + ('Ar-sa', u'Arabic'), # Arabic Saudi Arabia + ('zh', u'中文(简体)'), + ('ES419', u'Latin Spanish'), + ('es', u'Español'), + ('ja', u'Japanese'), + ('de', u'German'), + ('fr', u'french'), + ('nl', u'Dutch '), + ('pt', u'Português') +) +LOCALE_PATHS = [ + os.path.join(BASE_DIR, 'locale'), +] + MIDDLEWARE_CLASSES = ( 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', diff --git a/testserver/bokchoy_settings.py b/testserver/bokchoy_settings.py index c26f6179..cd2ad432 100644 --- a/testserver/bokchoy_settings.py +++ b/testserver/bokchoy_settings.py @@ -1,3 +1,5 @@ +#!/usr/bin/bash +# -*- coding: utf-8 -* """ Django settings for edx_notifications test project. For more information on this file, see @@ -36,8 +38,28 @@ 'django_nose', ) + +LANGUAGE_COOKIE_NAME = "openedx-language-preference" +LANGUAGES = ( + ('en', u'English '), + ('ar', u'العربية'), # Arabic + ('es', u'Español'), + ('nl', u'Dutch '), + ('pt', u'Português'), + ('zh-ch', u'中文(简体)'), + ('fr', u'Français'), + ('jp', u'日本人'), + ('de', u'Deutsche'), +) + +LOCALE_PATHS = [ + os.path.join(BASE_DIR, 'locale'), +] + MIDDLEWARE_CLASSES = ( + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.middleware.locale.LocaleMiddleware', 'django.middleware.common.CommonMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', @@ -95,11 +117,10 @@ # Internationalization # https://docs.djangoproject.com/en/1.6/topics/i18n/ -LANGUAGE_CODE = 'en-us' TIME_ZONE = 'UTC' -USE_I18N = True +USE_I18N = False USE_L10N = True diff --git a/testserver/settings.py b/testserver/settings.py index d3165039..a0f7c4db 100644 --- a/testserver/settings.py +++ b/testserver/settings.py @@ -1,3 +1,5 @@ +#!/usr/bin/bash +# -*- coding: utf-8 -* """ Django settings for edx_notifications test project. For more information on this file, see @@ -36,6 +38,32 @@ 'django_nose', ) +js_info_dict = { + 'packages': 'edx_notifications.server.web', + } +# js_info_dict = { +# 'packages': 'edx_notifications.server.web', +# } +# +# LANGUAGE_CODE = 'en' +# LANGUAGES = ( +# ('en', u'English '), +# ('ar', u'العربية'), # Arabic +# ('Ar-sa', u'Arabic'), # Arabic Saudi Arabia +# ('zh', u'中文(简体)'), +# ('ES419', u'Latin Spanish'), +# ('es', u'Español'), +# ('ja', u'Japanese'), +# ('de', u'German'), +# ('fr', u'french'), +# ('nl', u'Dutch '), +# ('pt', u'Português') +# ) +# +# LOCALE_PATHS = [ +# os.path.join(BASE_DIR, 'locale'), +# ] + MIDDLEWARE_CLASSES = ( 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', @@ -189,6 +217,10 @@ } } +TEMPLATE_CONTEXT_PROCESSORS = ( + 'django.core.context_processors.i18n', # this one + ) + # list all of the mappings of notification types to channel NOTIFICATION_CHANNEL_PROVIDER_TYPE_MAPS = { '*': 'durable', # default global mapping diff --git a/testserver/urls.py b/testserver/urls.py index 161ea8b9..2ac18f64 100644 --- a/testserver/urls.py +++ b/testserver/urls.py @@ -4,9 +4,8 @@ from django.conf.urls import url, include from django.contrib.auth.views import login - +from django.views.i18n import JavaScriptCatalog import views as testserver_views - urlpatterns = [ # pylint: disable=invalid-name url(r'^$', testserver_views.index), url(r'^accounts/login/$', login), @@ -15,4 +14,5 @@ url(r'^register/success/$', testserver_views.register_success), url(r'^api/', include('edx_notifications.server.api.urls')), + url(r'^jsi18n/$', JavaScriptCatalog.as_view(), name='javascript-catalog'), ]