From fcd5ccedd4403ed3ece75a316668172c96c20c1e Mon Sep 17 00:00:00 2001 From: Bryan Gerlach Date: Wed, 17 Apr 2024 17:44:28 -0500 Subject: [PATCH] added back the translate code, I hope it is correct. --- api/templates/show_conn_log.html | 28 ++++++++++++++-------------- api/templates/show_file_log.html | 30 +++++++++++++++--------------- api/views_front.py | 8 ++++---- 3 files changed, 33 insertions(+), 33 deletions(-) diff --git a/api/templates/show_conn_log.html b/api/templates/show_conn_log.html index 2cea72e..1b3197b 100644 --- a/api/templates/show_conn_log.html +++ b/api/templates/show_conn_log.html @@ -5,19 +5,19 @@
-
{{ "Connection Log" }}:【{{u.username}}】
+
{{ "Connection Log" | translate }}:【{{u.username}}】
- - - - - - - - + + + + + + + + @@ -41,17 +41,17 @@
{% if page_obj.has_previous %} - - + + {% endif %} {% if page_obj.paginator.num_pages > 1 %} - {{ "Page #" }} {{ page_obj.number }} / {{ page_obj.paginator.num_pages }} + {{ "Page #" | translate }} {{ page_obj.number }} / {{ page_obj.paginator.num_pages }} {% endif %} {% if page_obj.has_next %} - - + + {% endif %}
diff --git a/api/templates/show_file_log.html b/api/templates/show_file_log.html index 17728bf..004d85c 100644 --- a/api/templates/show_file_log.html +++ b/api/templates/show_file_log.html @@ -5,20 +5,20 @@
-
{{ "File Transfer Log" }}:【{{u.username}}】
+
{{ "File Transfer Log" | translate }}:【{{u.username}}】
User IPUser IDUser AliasRemote IDRemote AliasConnection Start TimeConnection End TimeDuration (HH:MM:SS){{ "User IP" | translate }}{{ "User ID" | translate }}{{ "User Alias" | translate }}{{ "Remote ID" | translate }}{{ "Remote Alias" | translate }}{{ "Connection Start Time" | translate }}{{ "Connection End Time" | translate }}{{ "Duration (HH:MM:SS)" | translate }}
- - - - - - - - - + + + + + + + + + @@ -47,17 +47,17 @@
{% if page_obj.has_previous %} - - + + {% endif %} {% if page_obj.paginator.num_pages > 1 %} - {{ "page #" }} {{ page_obj.number }} / {{ page_obj.paginator.num_pages }} + {{ "page #" | translate }} {{ page_obj.number }} / {{ page_obj.paginator.num_pages }} {% endif %} {% if page_obj.has_next %} - - + + {% endif %}
diff --git a/api/views_front.py b/api/views_front.py index 5eccdc5..286c8dc 100644 --- a/api/views_front.py +++ b/api/views_front.py @@ -370,12 +370,12 @@ def get_conn_log(): peer = RustDeskPeer.objects.get(rid=v['rid']) logs[k]['alias'] = peer.alias except: - logs[k]['alias'] = 'UNKNOWN' + logs[k]['alias'] = _('UNKNOWN') try: peer = RustDeskPeer.objects.get(rid=v['from_id']) logs[k]['from_alias'] = peer.alias except: - logs[k]['from_alias'] = 'UNKNOWN' + logs[k]['from_alias'] = _('UNKNOWN') #from_zone = tz.tzutc() #to_zone = tz.tzlocal() #utc = logs[k]['logged_at'] @@ -406,12 +406,12 @@ def get_file_log(): peer_remote = RustDeskPeer.objects.get(rid=v['remote_id']) logs[k]['remote_alias'] = peer_remote.alias except: - logs[k]['remote_alias'] = 'UNKNOWN' + logs[k]['remote_alias'] = _('UNKNOWN') try: peer_user = RustDeskPeer.objects.get(rid=v['user_id']) logs[k]['user_alias'] = peer_user.alias except: - logs[k]['user_alias'] = 'UNKNOWN' + logs[k]['user_alias'] = _('UNKNOWN') sorted_logs = sorted(logs.items(), key=lambda x: x[1]['logged_at'], reverse=True) new_ordered_dict = {}
FileRemote IDRemote AliasUser IDUser AliasUser IPFilesizeSent/ReceivedLogged At{{ "File" | translate }}{{ "Remote ID" | translate }}{{ "Remote Alias" | translate }}{{ "User ID" | translate }}{{ "User Alias" | translate }}{{ "User IP" | translate }}{{ "Filesize" | translate }}{{ "Sent/Received" | translate }}{{ "Logged At" | translate }}