Skip to content

Commit

Permalink
Init simple translation
Browse files Browse the repository at this point in the history
  • Loading branch information
mamashin committed Mar 22, 2024
1 parent 23d667c commit 9e1af99
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 4 deletions.
13 changes: 12 additions & 1 deletion apps/core/templates/main.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% load static %}
{% load static %}{% load i18n %}
<!doctype html>
<html lang="en">
<head>
Expand Down Expand Up @@ -106,13 +106,15 @@
}
</script>
</head>
{% get_current_language as LANGUAGE_CODE %}
<body hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'>
<main class="container">
<div id="main">
{% include "nav.html" %}
{% block get_qr %}
<div id="scan_result">
<article class="pico-background-sand-150" data-theme="light">
{% if LANGUAGE_CODE == 'ru' %}
<p>С помощью этого сервиса вы можете сканировать QR-коды формата UPN (Словения) и получать
информацию о
платежах в формате EPC (Revolut, WISE и т.д.)</p>
Expand All @@ -122,6 +124,15 @@
<p>
После сканирования QR-кода, вы можете скопировать ссылку на этот код, чтобы поделиться ей.
</p>
{% else %}
<p>With this service, you can scan QR codes in the UPN format (Slovenia) and receive payment information in the EPC format (Revolut, WISE, etc.).</p>
<p><kbd>Scan</kbd> - scan QR with a camera</p>
<p><kbd>Enter</kbd> - manually enter payment details</p>
<p><kbd>Edit</kbd> - edit the scanned code</p>
<p>
After scanning the QR code, you can copy the link to this code to share it.
</p>
{% endif %}
</article>
</div>
{% endblock get_qr %}
Expand Down
8 changes: 7 additions & 1 deletion apps/core/templates/qr_link.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
<div><small>Ссылка для копирования</small></div>
{% load i18n %}
{% get_current_language as LANGUAGE_CODE %}
{% if LANGUAGE_CODE == 'ru' %}
<div><small>Ссылка для копирования</small></div>
{% else %}
<div><small>Link for sharing QR</small></div>
{% endif %}
<fieldset role="group">
<input value="{{ request.scheme}}://{{ request.get_host }}/qr/{{ model.rnd }}/" readonly />
<button data-tooltip="copy to clipboard" onclick="copyToClipboard('/qr/{{ model.rnd }}/')">
Expand Down
8 changes: 6 additions & 2 deletions apps/core/templates/qr_ok.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
{% extends "nav.html" %}

{% extends "nav.html" %}{% load i18n %}
{% get_current_language as LANGUAGE_CODE %}
{% block menu %}
{% if LANGUAGE_CODE == 'ru' %}
<p>QR код для оплаты через Revolut / Wise / ...</p>
{% else %}
<p>QR code for payment via Revolut / Wise / ...</p>
{% endif %}
<hr />
<div class="grid">
<div class="qr-code">
Expand Down
1 change: 1 addition & 0 deletions apps/qr/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
__author__ = 'Nikolay Mamashin (mamashin@gmail.com)'

from django import forms
from django.utils.translation import gettext_lazy as _

from .models import UpnModel

Expand Down
1 change: 1 addition & 0 deletions apps/qr/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from django.core.exceptions import ValidationError
from django.utils.dateparse import parse_datetime
from django.core.serializers.json import DjangoJSONEncoder
from django.utils.translation import gettext_lazy as _


def rnd(rnd_len: int = 6):
Expand Down
1 change: 1 addition & 0 deletions conf/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
MIDDLEWARE = (
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
Expand Down

0 comments on commit 9e1af99

Please sign in to comment.