Skip to content

Commit

Permalink
Migrate existing translations in JS/TS to Django's javascript catalog
Browse files Browse the repository at this point in the history
  • Loading branch information
hansegucker committed Oct 16, 2023
1 parent c218d2e commit f4dfe0f
Show file tree
Hide file tree
Showing 7 changed files with 81 additions and 67 deletions.
4 changes: 3 additions & 1 deletion evap/evaluation/templates/evap_evaluation_edit_js.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{% load static %}

{% if editable %}
{% include 'sortable_form_js.html' %}
<script src="{% static 'js/sortable_form.js' %}"></script>
<script type="text/javascript">
rowChanged = function(row) {
name = $(row.find("select[id$=-contributor]")).find(":selected").text();
Expand Down
2 changes: 1 addition & 1 deletion evap/evaluation/templates/notebook.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ <h5 class="card-title m-0">
{% csrf_token %}
{{ notebook_form.notes }}
<div class="d-flex justify-content-center pt-3">
<button class="btn btn-primary" type="submit" data-errormessage="{% trans 'The server is not responding.' %}">
<button class="btn btn-primary" type="submit">
<span class="visible-if-ready">{% trans 'Save' %}</span>
<span class="visible-if-sending">{% trans 'Sending...' %}</span>
<span class="visible-if-successful">{% trans 'Saved successfully' %}</span>
Expand Down
62 changes: 0 additions & 62 deletions evap/evaluation/templates/sortable_form_js.html

This file was deleted.

71 changes: 71 additions & 0 deletions evap/locale/de/LC_MESSAGES/djangojs.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# 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: 2023-10-16 20:14+0200\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=2; plural=(n != 1);\n"

#: evap/static/js/notebook.js:29 evap/static/ts/src/notebook.ts:38
msgid "The server is not responding."
msgstr ""

#: evap/static/js/sortable_form.js:19
msgid "Delete"
msgstr ""

#: evap/static/js/sortable_form.js:20
msgid "add another"
msgstr ""

#: evap/static/js/tom-select.complete.min.js:132
msgid "<div>"
msgstr ""

#: evap/static/js/tom-select.complete.min.js:132
msgid "<div role=\"listbox\" tabindex=\"-1\">"
msgstr ""

#: evap/static/js/tom-select.complete.min.js:135
msgid "<input/>"
msgstr ""

#: evap/static/js/tom-select.complete.min.js:219
msgid "loading"
msgstr ""

#: evap/static/js/tom-select.complete.min.js:219
msgid "no_results"
msgstr ""

#: evap/static/js/tom-select.complete.min.js:219
msgid "not_loading"
msgstr ""

#: evap/static/js/tom-select.complete.min.js:219
msgid "option_create"
msgstr ""

#: evap/static/js/tom-select.complete.min.js:274
msgid "<option value=\""
msgstr ""

#: evap/static/js/tom-select.complete.min.js:329
msgid "<div class=\"dropdown-input-wrap\">"
msgstr ""

#: evap/static/js/tom-select.complete.min.js:331
msgid "<input class=\"items-placeholder\" tabindex=\"-1\" />"
msgstr ""
4 changes: 3 additions & 1 deletion evap/staff/templates/staff_questionnaire_form.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{% extends 'staff_questionnaire_base.html' %}

{% load static %}

{% block content %}
{{ block.super }}
{% if not editable %}
Expand Down Expand Up @@ -79,7 +81,7 @@ <h5 class="card-title">{% trans 'Questions' %}</h5>

{% block additional_javascript %}
{% if editable %}
{% include 'sortable_form_js.html' %}
<script src="{% static 'js/sortable_form.js' %}"></script>
<script type="text/javascript">
rowChanged = function(row) {
nameDe = $(row.find('textarea[id$=-text_de]')).val();
Expand Down
2 changes: 1 addition & 1 deletion evap/staff/templates/staff_text_answer_warnings.html
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
{% endblock %}

{% block additional_javascript %}
{% include 'sortable_form_js.html' %}
<script src="{% static 'js/sortable_form.js' %}"></script>

{{ text_answer_warnings|text_answer_warning_trigger_strings|json_script:'text-answer-warnings' }}

Expand Down
3 changes: 2 additions & 1 deletion evap/static/ts/src/notebook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ class NotebookFormLogic {
.catch(() => {
this.notebook.setAttribute("data-state", "ready");
submitter.disabled = false;
alert(submitter.dataset.errormessage);
// @ts-ignore
alert(window.gettext("The server is not responding."));
});
};

Expand Down

0 comments on commit f4dfe0f

Please sign in to comment.