diff --git a/.gitignore b/.gitignore index 104f5bc0..84984ad7 100644 --- a/.gitignore +++ b/.gitignore @@ -16,4 +16,5 @@ venv/ .venv/ # Sphinx documentation -docs/_build/ \ No newline at end of file +docs/_build/ + diff --git a/explorer/locale/ru/LC_MESSAGES/django.mo b/explorer/locale/ru/LC_MESSAGES/django.mo new file mode 100644 index 00000000..d902a363 Binary files /dev/null and b/explorer/locale/ru/LC_MESSAGES/django.mo differ diff --git a/explorer/locale/ru/LC_MESSAGES/django.po b/explorer/locale/ru/LC_MESSAGES/django.po new file mode 100644 index 00000000..40b9e3d5 --- /dev/null +++ b/explorer/locale/ru/LC_MESSAGES/django.po @@ -0,0 +1,316 @@ +# 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: 2021-07-24 10:26-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=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" +"%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n" +"%100>=11 && n%100<=14)? 2 : 3);\n" + +#: explorer/apps.py:10 explorer/templates/explorer/base.html:10 +#: explorer/templates/explorer/base.html:35 +#: explorer/templates/explorer/fullscreen.html:8 +msgid "SQL Explorer" +msgstr "SQL Навигатор" + +#: explorer/models.py:40 +msgid "Include in snapshot task (if enabled)" +msgstr "Включить в задачу снятия снепшота (если разрешено)" + +#: explorer/models.py:47 +msgid "" +"Name of DB connection (as specified in settings) to use for this query.Will " +"use EXPLORER_DEFAULT_CONNECTION if left blank" +msgstr "" +"Название соединения БД (как указано в настройках), чтобы использовать для " +"этого запроса.Если не использовать, будет использоваться соединение по " +"умолчанию" + +#: explorer/models.py:60 explorer/templates/explorer/query_list.html:49 +#: explorer/templates/explorer/querylog_list.html:33 +msgid "Query" +msgstr "Запрос" + +#: explorer/models.py:61 +msgid "Queries" +msgstr "Запросы" + +#: explorer/templates/explorer/fullscreen.html:16 +#: explorer/templates/explorer/play.html:7 +#: explorer/templates/explorer/query.html:6 +#: explorer/templates/explorer/query.html:16 +#: explorer/templates/explorer/query_list.html:6 +#: explorer/templates/explorer/querylog_list.html:6 +msgid "New Query" +msgstr "Новый запрос" + +#: explorer/templates/explorer/fullscreen.html:39 +#: explorer/templates/explorer/preview_pane.html:81 +msgid "Empty Resultset" +msgstr "Результат запроса пуст" + +#: explorer/templates/explorer/play.html:8 +#: explorer/templates/explorer/play.html:16 +#: explorer/templates/explorer/query.html:7 +#: explorer/templates/explorer/query_list.html:7 +#: explorer/templates/explorer/querylog_list.html:7 +#: explorer/templates/explorer/querylog_list.html:23 +#: explorer/templates/explorer/querylog_list.html:33 +msgid "Playground" +msgstr "Полигон" + +#: explorer/templates/explorer/play.html:9 +#: explorer/templates/explorer/query.html:10 +#: explorer/templates/explorer/query_list.html:8 +#: explorer/templates/explorer/querylog_list.html:8 +msgid "Logs" +msgstr "Журналы" + +#: explorer/templates/explorer/play.html:17 +msgid "" +"The playground is for experimenting and writing ad-hoc queries. By default, " +"nothing you do here will be saved." +msgstr "" +"Полигон предназначен для экспериментов и написания специальных запросов. По " +"умолчанию тут ничего не будет сохраняться" + +#: explorer/templates/explorer/play.html:24 +#: explorer/templates/explorer/query.html:46 +msgid "Connection" +msgstr "Соединение" + +#: explorer/templates/explorer/play.html:39 +msgid "Playground SQL" +msgstr "Экспериментальный SQL" + +#: explorer/templates/explorer/play.html:55 +#: explorer/templates/explorer/query.html:110 +msgid "Refresh" +msgstr "Обновить" + +#: explorer/templates/explorer/play.html:58 +#: explorer/templates/explorer/play.html:68 +#: explorer/templates/explorer/query.html:98 +#: explorer/templates/explorer/query.html:115 +msgid "Toggle Dropdown" +msgstr "Включить выпадающий список" + +#: explorer/templates/explorer/play.html:61 +msgid "Save As New Query" +msgstr "Сохранить как новый запрос" + +#: explorer/templates/explorer/play.html:65 +#: explorer/templates/explorer/query.html:112 +msgid "Download" +msgstr "Скачать" + +#: explorer/templates/explorer/play.html:75 +#: explorer/templates/explorer/query.html:107 +msgid "Show Schema" +msgstr "Показать схему базы" + +#: explorer/templates/explorer/play.html:76 +#: explorer/templates/explorer/query.html:108 +msgid "Hide Schema" +msgstr "Скрыть схему" + +#: explorer/templates/explorer/play.html:77 +#: explorer/templates/explorer/query.html:106 +msgid "Format" +msgstr "Отформатировать запрос" + +#: explorer/templates/explorer/play.html:80 +msgid "Playground Query" +msgstr "Экспериментальный запрос" + +#: explorer/templates/explorer/preview_pane.html:8 +msgid "Preview" +msgstr "Предпросмотр" + +#: explorer/templates/explorer/preview_pane.html:9 +msgid "Snapshots" +msgstr "Варианты" + +#: explorer/templates/explorer/preview_pane.html:10 +#: explorer/templates/explorer/preview_pane.html:112 +msgid "Pivot" +msgstr "Сводная таблица" + +#: explorer/templates/explorer/preview_pane.html:19 +#, python-format +msgid "Execution time: %(duration)s ms" +msgstr "Время выполнения: %(duration)s мс" + +#: explorer/templates/explorer/preview_pane.html:28 +#, python-format +msgid "of %(total_rows)s total rows." +msgstr "из %(total_rows)s выбранных записей." + +#: explorer/templates/explorer/query.html:9 +msgid "Query Detail" +msgstr "Подробности запроса" + +#: explorer/templates/explorer/query.html:19 +msgid "History" +msgstr "История" + +#: explorer/templates/explorer/query.html:39 +msgid "Title" +msgstr "Название" + +#: explorer/templates/explorer/query.html:61 +msgid "Description" +msgstr "Описание" + +#: explorer/templates/explorer/query.html:95 +msgid "Save & Run" +msgstr "Сохранить и запустить" + +#: explorer/templates/explorer/query.html:103 +msgid "Save Only" +msgstr "Сохранить" + +#: explorer/templates/explorer/query.html:136 +msgid "Snapshot" +msgstr "Вариант" + +#: explorer/templates/explorer/query.html:142 +#, python-format +msgid "" +"Avg. execution: %(avg_duration|floatformat:2)sms. Query created by " +"%(user_email)s on %(created)s." +msgstr "" +"Среднее время выполнения: %(avg_duration|floatformat:2)s мс. Запрос в " +"%(created)s. от «%(user_email)s»" + +#: explorer/templates/explorer/query_confirm_delete.html:6 +#, python-format +msgid "Are you sure you want to delete \"%(title)s\" ?" +msgstr "Вы уверены в удалении «%(title)s»?" + +#: explorer/templates/explorer/query_list.html:14 +#, python-format +msgid " Your %(qlen)s Most Recently Run " +msgstr " Ваши последние запуски запросов, их %(qlen)s" + +#: explorer/templates/explorer/query_list.html:19 +msgid "Last Run" +msgstr "Последний запуск" + +#: explorer/templates/explorer/query_list.html:40 +msgid "All Queries" +msgstr "Все запросы" + +#: explorer/templates/explorer/query_list.html:43 +#: explorer/templates/explorer/schema.html:10 +msgid "Search" +msgstr "Поиск" + +#: explorer/templates/explorer/query_list.html:50 +msgid "Created" +msgstr "Создан" + +#: explorer/templates/explorer/query_list.html:52 +msgid "Email" +msgstr "Емейл" + +#: explorer/templates/explorer/query_list.html:54 +msgid "CSV" +msgstr "CSV" + +#: explorer/templates/explorer/query_list.html:56 +msgid "Play" +msgstr "Запустить" + +#: explorer/templates/explorer/query_list.html:57 +msgid "Delete" +msgstr "Удалить" + +#: explorer/templates/explorer/query_list.html:59 +msgid "Run Count" +msgstr "Число запусков" + +#: explorer/templates/explorer/query_list.html:79 +#, python-format +msgid "by %(cuser)s" +msgstr " пользователем «%(cuser)s»" + +#: explorer/templates/explorer/querylog_list.html:13 +#, python-format +msgid "Recent Query Logs - Page %(pagenum)s" +msgstr "Журнал последних запросов — страница %(pagenum)s " + +#: explorer/templates/explorer/querylog_list.html:18 +msgid "Run At" +msgstr "Время запуска" + +#: explorer/templates/explorer/querylog_list.html:19 +msgid "Run By" +msgstr "Запущено пользователем" + +#: explorer/templates/explorer/querylog_list.html:20 +msgid "Duration" +msgstr "Длительность" + +#: explorer/templates/explorer/querylog_list.html:21 +msgid "SQL" +msgstr "SQL" + +#: explorer/templates/explorer/querylog_list.html:22 +msgid "Query ID" +msgstr "ID запроса" + +#: explorer/templates/explorer/querylog_list.html:34 +msgid "Open" +msgstr "Открыть" + +#: explorer/templates/explorer/querylog_list.html:47 +#, python-format +msgid "Page %(pnum)s of %(anum)s." +msgstr "Страница %(pnum)s из %(anum)s." + +#: explorer/templates/explorer/schema.html:7 +msgid "Schema" +msgstr "Схема" + +#: explorer/templates/explorer/schema.html:14 +msgid "Collapse All" +msgstr "Свернуть все" + +#: explorer/templates/explorer/schema.html:17 +msgid "Expand All" +msgstr "Развернуть все" + +#: explorer/templates/explorer/schema_building.html:7 +msgid "Schema is building..." +msgstr "Строится схема…" + +#: explorer/templates/explorer/schema_building.html:8 +msgid "Please wait a minute, and refresh." +msgstr "Подождите минутку и обновите." + +#: explorer/views/query.py:125 +msgid "Query saved." +msgstr "Запрос сохранен." + +#~ msgid "Avg. execution:" +#~ msgstr "Среднее время запроса" + +#~ msgid "Query created by" +#~ msgstr "Запрос создан" + +#~ msgid "on" +#~ msgstr "в" diff --git a/explorer/locale/zh_Hans/LC_MESSAGES/django.mo b/explorer/locale/zh_Hans/LC_MESSAGES/django.mo index b3950a1b..4309a815 100644 Binary files a/explorer/locale/zh_Hans/LC_MESSAGES/django.mo and b/explorer/locale/zh_Hans/LC_MESSAGES/django.mo differ diff --git a/explorer/templates/explorer/fullscreen.html b/explorer/templates/explorer/fullscreen.html index 5596a739..6e3c5572 100644 --- a/explorer/templates/explorer/fullscreen.html +++ b/explorer/templates/explorer/fullscreen.html @@ -1,11 +1,11 @@ -{% load static %} +{% load static i18n %} - SQL Explorer{% if query %} - {{ query.title }}{% elif title %} - {{ title }}{% endif %} + {% trans "SQL Explorer" %}{% if query %} - {{ query.title }}{% elif title %} - {{ title }}{% endif %} @@ -13,7 +13,7 @@ -

{% if query %}{{ query.title }}{% if shared %}  shared{% endif %}{% else %}New Query{% endif %}

+

{% if query %}{{ query.title }}{% if shared %}  shared{% endif %}{% else %}{% trans "New Query" %}{% endif %}

@@ -36,7 +36,7 @@

{% if query %}{{ query.title }}{% if shared %}  shared {% endfor %} {% else %} -

+ {% endif %}
Empty Resultset
{% trans "Empty Resultset" %}
diff --git a/explorer/templates/explorer/preview_pane.html b/explorer/templates/explorer/preview_pane.html index d5cde41d..3bfb6b23 100644 --- a/explorer/templates/explorer/preview_pane.html +++ b/explorer/templates/explorer/preview_pane.html @@ -21,11 +21,11 @@
{% if rows > total_rows %} - Showing + {% trans Showing %} {% else %} - First + {% trans First %} {% endif %} - of {{ total_rows }} total rows. + {% blocktrans %}of {{ total_rows }} total rows.{% endblocktrans %} @@ -78,7 +78,7 @@ {% endfor %} {% else %} - Empty Resultset + {% blocktrans %}Empty Resultset{% endblocktrans %} {% endif %} @@ -109,7 +109,7 @@
- Pivot + {% blocktrans %}Pivot{% endblocktrans %}
diff --git a/explorer/templates/explorer/query.html b/explorer/templates/explorer/query.html index 6cf3059b..090f17a3 100644 --- a/explorer/templates/explorer/query.html +++ b/explorer/templates/explorer/query.html @@ -36,7 +36,7 @@

{% if query %}{{ query.title }}{% if shared %}  shared{{ error|escape }}

{% endfor %}{% endif %} - +
@@ -133,13 +133,13 @@

{% if query %}{{ query.title }}{% if shared %}  shared
{% if query and can_change and tasks_enabled %} - {{ form.snapshot }} Snapshot + {{ form.snapshot }} {% blocktrans %}Snapshot{% endblocktrans %} {% endif %}
{% if query.avg_duration %} - Avg. execution: {{ query.avg_duration|floatformat:2 }}ms. Query created by {{ form.created_by_user_email }} on {{ form.created_at_time }}. + {% blocktrans with avg_duration=query.avg_duration user_email=form.created_by_user_email created=form.created_at_time %}Avg. execution: {{ avg_duration|floatformat:2 }}ms. Query created by {{ user_email }} on {{ created }}.{% endblocktrans %} {% endif %}
diff --git a/explorer/templates/explorer/query_confirm_delete.html b/explorer/templates/explorer/query_confirm_delete.html index 98964d90..4cb1d543 100644 --- a/explorer/templates/explorer/query_confirm_delete.html +++ b/explorer/templates/explorer/query_confirm_delete.html @@ -3,7 +3,7 @@ {% block sql_explorer_content %}
{% csrf_token %}
- Are you sure you want to delete "{{ object.title }}" ? + {% blocktrans with title=object.title %}Are you sure you want to delete "{{ title }}" ?{% endblocktrans %}
diff --git a/explorer/templates/explorer/query_list.html b/explorer/templates/explorer/query_list.html index 43b21eaf..27595af7 100644 --- a/explorer/templates/explorer/query_list.html +++ b/explorer/templates/explorer/query_list.html @@ -11,12 +11,12 @@ {% block sql_explorer_content %} {% if recent_queries|length > 0 %} -

Your {{ recent_queries|length }} Most Recently Run

+

{% blocktrans with qlen=recent_queries|length %} Your {{qlen}} Most Recently Run {% endblocktrans %}

- - + + @@ -76,7 +76,7 @@

{% trans "All Queries" %}

{% if tasks_enabled %} diff --git a/explorer/templates/explorer/querylog_list.html b/explorer/templates/explorer/querylog_list.html index 1589f8f2..b7c4e2cc 100644 --- a/explorer/templates/explorer/querylog_list.html +++ b/explorer/templates/explorer/querylog_list.html @@ -10,17 +10,17 @@ {% endblock %} {% block sql_explorer_content %} -

{% blocktrans %}Recent Query Logs - Page {{page_obj.number}}{% endblocktrans %}

+

{% blocktrans with pagenum=page_obj.number %}Recent Query Logs - Page {{pagenum}}{% endblocktrans %}

QueryLast Run{% trans Query %}{% trans "Last Run" %} CSV
{{ object.created_at|date:"SHORT_DATE_FORMAT" }} {% if object.created_by_user %} - by {{ object.created_by_user }} + {% blocktrans with cuser=object.created_by_user %}by {{cuser}}{% endblocktrans %} {% endif %}
- - - - - - + + + + + + @@ -30,8 +30,8 @@

{% blocktrans %}Recent Query Logs - Page {{page_obj.number}}{% endblocktrans

- - + + {% endfor %} @@ -44,7 +44,7 @@

{% blocktrans %}Recent Query Logs - Page {{page_obj.number}}{% endblocktrans << {% endif %} - Page {{ page_obj.number }} of {{ page_obj.paginator.num_pages }}. + {% blocktrans with pnum=page_obj.number anum=page_obj.paginator.num_pages %}Page {{ pnum }} of {{ anum }}.{% endblocktrans %} {% if page_obj.has_next %} >> diff --git a/explorer/templates/explorer/schema.html b/explorer/templates/explorer/schema.html index ae7f88e0..4816c4e6 100644 --- a/explorer/templates/explorer/schema.html +++ b/explorer/templates/explorer/schema.html @@ -4,10 +4,10 @@ {% block sql_explorer_content_takeover %}
-

Schema

+

{% blocktrans %}Schema{% endblocktrans %}

- +

diff --git a/explorer/templates/explorer/schema_building.html b/explorer/templates/explorer/schema_building.html index 0c0e92a8..521ae442 100644 --- a/explorer/templates/explorer/schema_building.html +++ b/explorer/templates/explorer/schema_building.html @@ -1,11 +1,11 @@ {% extends "explorer/base.html" %} - +{% load i18n %} {% block sql_explorer_content_takeover %}
-

Schema is building...

-
Please wait a minute, and refresh.
+

{% blocktrans %}Schema is building...{% endblocktrans %}

+
{% blocktrans %}Please wait a minute, and refresh.{% endblocktrans %}
{% endblock %} \ No newline at end of file diff --git a/explorer/views/query.py b/explorer/views/query.py index b584045b..84d145fe 100644 --- a/explorer/views/query.py +++ b/explorer/views/query.py @@ -15,6 +15,7 @@ from explorer.views.mixins import ExplorerContextMixin from explorer.views.utils import query_viewmodel +from django.utils.translation import gettext_lazy as _ class PlayQueryView(PermissionRequiredMixin, ExplorerContextMixin, View): @@ -121,7 +122,7 @@ def post(self, request, query_id): form=form, run_query=show, rows=url_get_rows(request), - message="Query saved." if success else None + message=_("Query saved.") if success else None ) return self.render_template('explorer/query.html', vm) diff --git a/manage.py b/manage.py index 32d50d48..5ef8448a 100644 --- a/manage.py +++ b/manage.py @@ -5,3 +5,4 @@ from django.core import management if __name__ == "__main__": management.execute_from_command_line() + \ No newline at end of file

Run AtRun ByDurationSQLQuery IDPlayground{% blocktrans %}Run At{% endblocktrans %}{% blocktrans %}Run By{% endblocktrans %}{% blocktrans %}Duration{% endblocktrans %}{% blocktrans %}SQL{% endblocktrans %}{% blocktrans %}Query ID{% endblocktrans %}{% blocktrans %}Playground{% endblocktrans %}
{{ object.run_by_user.email }} {{ object.duration|floatformat:2 }}ms {{ object.sql }} {% if object.query_id %}Query {{ object.query_id }}{% elif object.is_playground %}Playground{% else %}--{% endif %}Open {% if object.query_id %}{% blocktrans %}Query{% endblocktrans %} {{ object.query_id }}{% elif object.is_playground %}{% blocktrans %}Playground{% endblocktrans %}{% else %}--{% endif %}{% blocktrans %}Open{% endblocktrans %}