Skip to content

Commit

Permalink
Added i18n and Russian translation (#450)
Browse files Browse the repository at this point in the history
* First translation of all message already prepared for localication

* add trans/blocktrans tags for all UI literals in templates

* add trans/blocktrans tags for all UI literals in templates. Add russian translation for all this staff

* Sorry fix a typo

* generated localization files excluded from git

* generated localization files excluded from git

* force store compiled russian messages

* Enable mo files back

* add load i18n to some templates, now tests OK

* fix #450 (comment)

* fix #450 (comment)
  • Loading branch information
belonesox authored Jul 24, 2021
1 parent 6f7c38c commit c99ef70
Show file tree
Hide file tree
Showing 14 changed files with 353 additions and 34 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ venv/
.venv/

# Sphinx documentation
docs/_build/
docs/_build/

Binary file added explorer/locale/ru/LC_MESSAGES/django.mo
Binary file not shown.
316 changes: 316 additions & 0 deletions explorer/locale/ru/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
@@ -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 <EMAIL@ADDRESS>, 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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\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 "в"
Binary file modified explorer/locale/zh_Hans/LC_MESSAGES/django.mo
Binary file not shown.
8 changes: 4 additions & 4 deletions explorer/templates/explorer/fullscreen.html
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{% load static %}
{% load static i18n %}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>SQL Explorer{% if query %} - {{ query.title }}{% elif title %} - {{ title }}{% endif %}</title>
<title>{% trans "SQL Explorer" %}{% if query %} - {{ query.title }}{% elif title %} - {{ title }}{% endif %}</title>

<link rel="stylesheet" href="{% static 'explorer/css/bootstrap.min.css' %}" />
<link rel="stylesheet" href="{% static 'explorer/css/explorer.css' %}" />

</head>

<body>
<h2>{% if query %}{{ query.title }}{% if shared %}<small>&nbsp;&nbsp;shared</small>{% endif %}{% else %}New Query{% endif %}</h2>
<h2>{% if query %}{{ query.title }}{% if shared %}<small>&nbsp;&nbsp;shared</small>{% endif %}{% else %}{% trans "New Query" %}{% endif %}</h2>
<table class="table table-striped">
<thead>
<tr>
Expand All @@ -36,7 +36,7 @@ <h2>{% if query %}{{ query.title }}{% if shared %}<small>&nbsp;&nbsp;shared</sma
</tr>
{% endfor %}
{% else %}
<tr class="text-center"><td colspan="{{ headers|length }}">Empty Resultset</td></tr>
<tr class="text-center"><td colspan="{{ headers|length }}">{% trans "Empty Resultset" %}</td></tr>
{% endif %}
</tbody>
</table>
Expand Down
10 changes: 5 additions & 5 deletions explorer/templates/explorer/preview_pane.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
<div class="col-md-6 text-right">
<span class="row-control">
{% if rows > total_rows %}
Showing <input class="rows-input" type="text" name="rows" id="rows" value="{{ total_rows }}" />
{% trans Showing %}<input class="rows-input" type="text" name="rows" id="rows" value="{{ total_rows }}" />
{% else %}
First <input class="rows-input" type="text" name="rows" id="rows" value="{{ rows }}" />
{% trans First %}<input class="rows-input" type="text" name="rows" id="rows" value="{{ rows }}" />
{% endif %}
of {{ total_rows }} total rows.
{% blocktrans %}of {{ total_rows }} total rows.{% endblocktrans %}
</span>
<span>
<small>
Expand Down Expand Up @@ -78,7 +78,7 @@
</tr>
{% endfor %}
{% else %}
<tr class="text-center"><td colspan="{{ headers|length }}">Empty Resultset</td></tr>
<tr class="text-center"><td colspan="{{ headers|length }}">{% blocktrans %}Empty Resultset{% endblocktrans %}</td></tr>
{% endif %}
</tbody>
</table>
Expand Down Expand Up @@ -109,7 +109,7 @@
<div class="panel-heading">
<div class="row">
<div class="col-md-6">
<span class="panel-title">Pivot</span>
<span class="panel-title">{% blocktrans %}Pivot{% endblocktrans %}</span>
</div>
<div class="col-md-6 text-right">
<small><a id="pivot-bookmark" data-baseurl="{% url 'explorer_playground' %}?querylog_id={{ ql_id }}" href="#"><i class="glyphicon glyphicon-link"></i></a></small>
Expand Down
Loading

0 comments on commit c99ef70

Please sign in to comment.