Skip to content

Commit 2555362

Browse files
committed
翻译更新。优化汉化版的设置界面样式。
1 parent 682d93a commit 2555362

File tree

3 files changed

+40
-1
lines changed

3 files changed

+40
-1
lines changed

2.trans.py

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,28 @@ def replace_in_file(file_path, translation, base_path=BASE_PATH):
9494
with open(file_path, 'w') as f:
9595
f.write(content)
9696

97+
# 修复受保护的会话输入密码框样式
98+
file_path = 'src/public/app/widgets/dialogs/protected_session_password.js'
99+
with open(file_path, 'r') as f:
100+
content = f.read()
101+
target_element = ' <div class="form-group">\n <label>'
102+
if target_element in content:
103+
content = content.replace(' <div class="form-group">\n <label>',
104+
' <div class="form-group">\n <label style="width: -webkit-fill-available">')
105+
with open(file_path, 'w') as f:
106+
f.write(content)
107+
108+
# 修复设置界面样式
109+
file_path = 'src/public/app/widgets/dialogs/options.js'
110+
with open(file_path, 'r') as f:
111+
content = f.read()
112+
target_element = ' <br/>\n <div class="tab-content">'
113+
if target_element in content:
114+
content = content.replace(' <br/>\n <div class="tab-content">',
115+
' <br/>\n <div class="tab-content" style="width: -webkit-fill-available">')
116+
with open(file_path, 'w') as f:
117+
f.write(content)
118+
97119
# 升级属性
98120
file_path = 'src/public/app/widgets/ribbon_widgets/promoted_attributes.js'
99121
with open(file_path, 'r') as f:
@@ -515,6 +537,7 @@ def replace_in_file(file_path, translation, base_path=BASE_PATH):
515537
file_path = 'src/public/app/widgets/dialogs/note_type_chooser.js'
516538
translation = [
517539
'>{{Choose note type}}<',
540+
'{{Choose note type / template of the new note:}}',
518541
'>{{Dropdown trigger}}<',
519542
]
520543
replace_in_file(file_path, translation)
@@ -542,6 +565,7 @@ def replace_in_file(file_path, translation, base_path=BASE_PATH):
542565
translation = [
543566
'>{{Password is not set}}<',
544567
'{{Protected notes are encrypted using a user password, but password has not been set yet.}}',
568+
'''{{To be able to protect notes, <a class="open-password-options-button" href="javascript:">\n click here to open the Options dialog</a> and set your password.}}''',
545569
]
546570
replace_in_file(file_path, translation)
547571

@@ -556,7 +580,7 @@ def replace_in_file(file_path, translation, base_path=BASE_PATH):
556580
file_path = 'src/public/app/widgets/dialogs/protected_session_password.js'
557581
translation = [
558582
'>{{Protected session}}<',
559-
'>{{To proceed with requested action you need to start protected session by entering password:}}<',
583+
'{{To proceed with requested action you need to start protected session by entering password:}}',
560584
'>{{Start protected session }}<',
561585
'>{{enter}}<',
562586
'title="{{Help on Protected notes}}"',
@@ -1704,6 +1728,9 @@ def replace_in_file(file_path, translation, base_path=BASE_PATH):
17041728
' {{Show backend log}}',
17051729
' {{Reload frontend}}',
17061730
'title="{{Reload can help with some visual glitches without restarting the whole app.}}"',
1731+
' {{Zoom}}',
1732+
'title="{{Zoom out}}"',
1733+
'title="{{Zoom in}}"',
17071734
' {{Toggle fullscreen}}',
17081735
' {{Show Help}}',
17091736
' {{About Trilium Notes}}',
@@ -1719,6 +1746,7 @@ def replace_in_file(file_path, translation, base_path=BASE_PATH):
17191746
'>{{ Open note externally}}<',
17201747
'>{{Import files}}<',
17211748
'>{{Export note}}<',
1749+
'>{{Delete note}}<',
17221750
'>{{ Print note}}<',
17231751
]
17241752
replace_in_file(file_path, translation)

translations.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1481,4 +1481,10 @@
14811481
'Network connections': '',
14821482
'Check for updates automatically': '',
14831483
"require credentials to access this shared note. Value is expected to be in format 'username:password'. Don't forget to make this inheritable to apply to child-notes/images.": '',
1484+
'To be able to protect notes, <a class="open-password-options-button" href="javascript:">
1485+
click here to open the Options dialog</a> and set your password.': '',
1486+
'Choose note type / template of the new note:': '',
1487+
'Zoom': '',
1488+
'Zoom out': '',
1489+
'Zoom in': '',
14841490
}

translations_cn.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1476,5 +1476,10 @@
14761476
'Network connections': '网络连接',
14771477
'Check for updates automatically': '自动检查更新',
14781478
"require credentials to access this shared note. Value is expected to be in format 'username:password'. Don't forget to make this inheritable to apply to child-notes/images.": "需要身份验证才能访问此共享笔记. 值的格式'用户名:密码'. 别忘了设置为可继承来对所有子笔记和图片生效.",
1479+
"""To be able to protect notes, <a class="open-password-options-button" href="javascript:">\n click here to open the Options dialog</a> and set your password.""": """要保护笔记, 请<a class="open-password-options-button" href="javascript:">点击这里打开设置界面</a>并设置密码.""",
1480+
'Choose note type / template of the new note:': '请选择新笔记的类型/模板:',
1481+
'Zoom': '缩放',
1482+
'Zoom out': '缩小',
1483+
'Zoom in': '放大',
14791484
'': '',
14801485
}

0 commit comments

Comments
 (0)