Skip to content

Commit 4378bff

Browse files
committed
fix #200 布尔类型国际化
1 parent d90b4b8 commit 4378bff

File tree

6 files changed

+17
-7
lines changed

6 files changed

+17
-7
lines changed

simpleui/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33

44
def get_version():
5-
return '3.7'
5+
return '3.8'

simpleui/static/admin/simpleui-x/automatic/dicts.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ var dicts = {
9393
//银行
9494
'fas fa-credit-card': ['银行卡', '银行', '信用卡', '储蓄卡'],
9595
//ad
96-
'fas fa-ad': ['宣传', '广告', 'banner', 'Banner', 'ad', 'Ad'],
96+
'fas fa-ad': ['宣传', '广告', 'banner', 'Banner', 'ad', 'Ad', '横幅', '轮播'],
9797
//hot
9898
'fab fa-hotjar': ['热搜', '热度', '火焰'],
9999
//info

simpleui/static/admin/simpleui-x/js/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@
477477
if (loading) {
478478
data.loading = true;
479479
this.loading = true;
480-
}else{
480+
} else {
481481
data.loading = false;
482482
this.loading = false;
483483
}

simpleui/templates/admin/index.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,6 @@
227227

228228
{% home_page %}
229229

230-
231230
{% if home %}
232231
<span v-if="index==0" slot="label"><i
233232
class="{{ icon }}"></i><span>{{ title }}</span>
@@ -376,7 +375,7 @@
376375
<script type="text/javascript" src="{% static '/admin/simpleui-x/theme/theme.js' %}"></script>
377376
<script type="text/javascript" src="{% static '/admin/simpleui-x/waves/waves.min.js' %}?_=2.0.5"></script>
378377
{% block index_js %}
379-
<script type="text/javascript" src="{% static '/admin/simpleui-x/js/index.js' %}?_=3.4"></script>
378+
<script type="text/javascript" src="{% static '/admin/simpleui-x/js/index.js' %}?_=3.9"></script>
380379
{% endblock %}
381380
{% block autoupdate %}
382381
{% if not "SIMPLEUI_STATIC_OFFLINE"|get_config %}

simpleui/templates/admin/search_form.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,10 @@
8080
<el-option label="{{ option.1 }}" value="{{ option.0 }}"></el-option>
8181
{% endfor %}
8282
{% else %}
83-
<el-option label="True" value="True"></el-option>
84-
<el-option label="False" value="False"></el-option>
83+
{% get_boolean_choices as choices %}
84+
{% for c in choices %}
85+
<el-option label="{{ c.1 }}" value="{{ c.0 }}"></el-option>
86+
{% endfor %}
8587
{% endif %}
8688
</el-select>
8789

simpleui/templatetags/simpletags.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
register = template.Library()
2323

2424
PY_VER = sys.version[0] # 2 or 3
25+
from django.utils.translation import gettext_lazy as _
2526

2627
if PY_VER != '2':
2728
from importlib import reload
@@ -477,3 +478,11 @@ def has_admindoc_page(context):
477478
return context.template_name.find('admin_doc') == 0
478479
else:
479480
return False
481+
482+
483+
@register.simple_tag
484+
def get_boolean_choices():
485+
return (
486+
('True', _('Yes')),
487+
('False', _('No'))
488+
)

0 commit comments

Comments
 (0)