Skip to content

Commit

Permalink
fix(i18n): 修复重置密码那的i18n问题
Browse files Browse the repository at this point in the history
  • Loading branch information
ibuler authored and BaiJiangJie committed Nov 10, 2020
1 parent f04544e commit 987f840
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion apps/jumpserver/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ def convert_type(self, k, v):
tp = type(default_value)
# 对bool特殊处理
if tp is bool and isinstance(v, str):
if v in ("true", "True", "1"):
if v.lower() in ("true", "1"):
return True
else:
return False
Expand Down
8 changes: 7 additions & 1 deletion apps/jumpserver/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
from django.urls import path, include, re_path
from django.conf import settings
from django.conf.urls.static import static
from django.conf.urls.i18n import i18n_patterns
from django.views.i18n import JavaScriptCatalog

from . import views, api

Expand Down Expand Up @@ -66,7 +68,11 @@

urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) \
+ static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
# urlpatterns += js_i18n_patterns

js_i18n_patterns = i18n_patterns(
path('jsi18n/', JavaScriptCatalog.as_view(), name='javascript-catalog'),
)
urlpatterns += js_i18n_patterns

handler404 = 'jumpserver.views.handler404'
handler500 = 'jumpserver.views.handler500'
Expand Down
4 changes: 0 additions & 4 deletions apps/static/js/jumpserver.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
//此函数用于checkbox的全选和反选
var checked = false;

function gettext(s) {
return s
}

function check_all(form) {
var checkboxes = document.getElementById(form);
if (checked === false) {
Expand Down
1 change: 1 addition & 0 deletions apps/templates/_base_only_content.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

{% include '_head_css_js.html' %}
<link href="{% static "css/jumpserver.css" %}" rel="stylesheet">
<script src="{% url 'javascript-catalog' %}"></script>
<script src="{% static "js/jumpserver.js" %}"></script>
<style>
.passwordBox {
Expand Down

0 comments on commit 987f840

Please sign in to comment.