Skip to content

Commit 4155e38

Browse files
committed
修复flex布局下部分界面中文自动换行的问题
1 parent 2cc6b11 commit 4155e38

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

2.trans.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,29 @@ def replace_in_file(file_path, translation, base_path=BASE_PATH):
8282
with open(about_file_path, 'w') as f:
8383
f.write(content)
8484

85+
# 修复flex布局下部分界面中文自动换行的问题
86+
# 选项界面
87+
file_path = 'src/public/app/widgets/dialogs/options.js'
88+
with open(file_path, 'r') as f:
89+
content = f.read()
90+
target_element = '<ul class="nav nav-tabs flex-column">'
91+
if target_element in content:
92+
content = content.replace('<ul class="nav nav-tabs flex-column">',
93+
'<ul class="nav nav-tabs flex-column" style="white-space: nowrap;">')
94+
with open(file_path, 'w') as f:
95+
f.write(content)
96+
97+
# 升级属性
98+
file_path = 'src/public/app/widgets/ribbon_widgets/promoted_attributes.js'
99+
with open(file_path, 'r') as f:
100+
content = f.read()
101+
target_element = '<div class="promoted-attribute-cell">'
102+
new_element = '<div class="promoted-attribute-cell" style="white-space: nowrap;">'
103+
if target_element in content:
104+
content = content.replace(target_element, new_element)
105+
with open(file_path, 'w') as f:
106+
f.write(content)
107+
85108
# 下面一堆是正则匹配规则, 读代码的时候下面这一段可以跳过, 直接看最后面几行
86109
# TL;DR, the following codes are regex matches, you can jump to the last few lines.
87110

0 commit comments

Comments
 (0)