Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Allow configured dashboard tabs to be translated #45

Merged
merged 3 commits into from
May 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ Change Log
Unreleased
**********

0.9.0 - 2024-05-06
******************

Added
=====

* Allow embedded dashboard tab names to be localized

0.8.0 - 2024-05-06
******************

Expand Down
2 changes: 1 addition & 1 deletion platform_plugin_aspects/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
import os
from pathlib import Path

__version__ = "0.8.0"
__version__ = "0.9.0"

ROOT_DIRECTORY = Path(os.path.dirname(os.path.abspath(__file__)))
57 changes: 48 additions & 9 deletions platform_plugin_aspects/conf/locale/en/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
msgid ""
msgstr ""
"Project-Id-Version: 0.1a\n"
"Report-Msgid-Bugs-To: [email protected]\n"
"POT-Creation-Date: 2023-06-13 08:00+0000\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-05-06 15:45-0400\n"
"PO-Revision-Date: 2023-06-13 09:00+0000\n"
"Last-Translator: \n"
"Language-Team: openedx-translation <[email protected]>\n"
Expand All @@ -17,6 +17,22 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#: extensions/filters.py:60
msgid "Reports"
msgstr ""

#: settings/common.py:29
msgid "Course Dashboard"
msgstr ""

#: settings/common.py:35
msgid "Individual Learner Dashboard"
msgstr ""

#: settings/common.py:41
msgid "At-Risk Learners Dashboard"
msgstr ""

#: static/html/superset.html:9
msgid ""
"Superset is not configured properly. Please contact your system "
Expand All @@ -29,32 +45,55 @@ msgid ""
"your system administrator."
msgstr ""

#: xblock.py:31 xblock.py:32
#: utils.py:162
#, python-brace-format
msgid ""
"Unable to fetch Superset guest token, Superset server error {server_response}"
msgstr ""

#: utils.py:171
msgid ""
"Unable to fetch Superset guest token, mostly likely due to invalid settings."
"SUPERSET_CONFIG"
msgstr ""

#: views.py:85
#, python-brace-format
msgid "Invalid course id: '{course_id}'"
msgstr ""

#: views.py:97
#, python-brace-format
msgid "Course not found: '{course_id}'"
msgstr ""

#: xblock.py:40 xblock.py:41
msgid "Display name"
msgstr ""

#: xblock.py:33
#: xblock.py:42
msgid "Superset Dashboard"
msgstr ""

#: xblock.py:38
#: xblock.py:47
msgid "Dashboard UUID"
msgstr ""

#: xblock.py:40
#: xblock.py:49
msgid ""
"The ID of the dashboard to embed. Available in the Superset embed dashboard "
"UI."
msgstr ""

#: xblock.py:47
#: xblock.py:56
msgid "Filters"
msgstr ""

#: xblock.py:49
#: xblock.py:58
msgid ""
"List of SQL filters to apply to the\n"
" dashboard. E.g: [\"org='edX'\", \"country in ('us', 'co')\"]\n"
" The fields used here must be available on every dataset used by the dashboard.\n"
" The fields used here must be available on every dataset used "
"by the dashboard.\n"
" "
msgstr ""
24 changes: 21 additions & 3 deletions platform_plugin_aspects/settings/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@
from platform_plugin_aspects import ROOT_DIRECTORY


# Make '_' a no-op so we can scrape strings for translation, because
# `django.utils.translation.ugettext_noop` cannot be imported in this file
def _(text):
return text


def plugin_settings(settings):
"""
Set of plugin settings used by the Open Edx platform.
Expand All @@ -22,9 +28,21 @@ def plugin_settings(settings):
}
settings.ASPECTS_INSTRUCTOR_DASHBOARDS = [
{
"name": "Instructor Dashboard",
"slug": "instructor-dashboard",
"uuid": "1d6bf904-f53f-47fd-b1c9-6cd7e284d286",
"name": _("Course Dashboard"),
"slug": "course-dashboard-v1",
"uuid": "c0e64194-33d1-4d5a-8c10-4f51530c5ee9",
"allow_translations": True,
},
{
"name": _("Individual Learner Dashboard"),
"slug": "individual-learner",
"uuid": "abae8a25-1ba4-4653-81bd-d3937a162a11",
"allow_translations": True,
},
{
"name": _("At-Risk Learners Dashboard"),
"slug": "learner-groups",
"uuid": "8661d20c-cee6-4245-9fcc-610daea5fd24",
"allow_translations": True,
},
]
Expand Down
2 changes: 1 addition & 1 deletion platform_plugin_aspects/static/html/superset.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ <h2>{{display_name}}</h2>
{% else %}
<input type="radio" id="tab-{{forloop.counter}}" name="tab-group-1" />
{% endif %}
<label for="tab-{{forloop.counter}}">{{dashboard.name}}</label>
<label for="tab-{{forloop.counter}}">{% trans dashboard.name %}</label>
<div class="aspects-content superset-embedded-container" id="superset-embedded-container-{{dashboard.uuid}}"></div>
</div>
{% endfor %}
Expand Down
Loading