Skip to content

Commit

Permalink
增加新功能的翻译 补充一些报错和提示信息的翻译
Browse files Browse the repository at this point in the history
  • Loading branch information
Nriver committed Aug 8, 2022
1 parent e3393ca commit e6e0b0b
Show file tree
Hide file tree
Showing 3 changed files with 98 additions and 1 deletion.
63 changes: 63 additions & 0 deletions 2.trans.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,8 @@ def replace_in_file(file_path, translation, base_path=BASE_PATH):
'title="{{Help on links}}"',
'title="{{Cloned note will be shown in note tree with given prefix}}"',
'{{search for note by its name}}',
'showMessage({{`Note "${clonedNote.title}" has been cloned into ${targetNote.title}`}}',
' logError("{{No path to clone to.}}"',
]
replace_in_file(file_path, translation)

Expand Down Expand Up @@ -523,6 +525,7 @@ def replace_in_file(file_path, translation, base_path=BASE_PATH):
'>{{Appearance}}<',
'>{{Shortcuts}}<',
'>{{Keyboard shortcuts}}<',
'>{{Text notes}}<',
'>{{Code notes}}<',
# removed from 0.50
# '>{{Username & password}}<',
Expand Down Expand Up @@ -571,6 +574,7 @@ def replace_in_file(file_path, translation, base_path=BASE_PATH):
'>{{Sort children by ...}}<',
'>{{Sorting criteria}}<',
'>{{Sorting direction}}<',
'>{{Folders}}<',
'>{{Sort }}<',
'>{{enter}}<',
' {{title}}',
Expand Down Expand Up @@ -854,6 +858,8 @@ def replace_in_file(file_path, translation, base_path=BASE_PATH):
'>{{Automatic readonly note size is the size after which notes will be displayed in a readonly mode (for performance reasons).}}<',
'>{{Automatic readonly size (text notes)}}<',
'>{{Automatic readonly size (code notes)}}<',
'>{{Network connections}}<',
'>{{Check for updates automatically}}<',
]
replace_in_file(file_path, translation)

Expand Down Expand Up @@ -908,6 +914,19 @@ def replace_in_file(file_path, translation, base_path=BASE_PATH):
]
replace_in_file(file_path, translation)

file_path = 'src/public/app/widgets/dialogs/options/text_notes.js'
translation = [
'>{{Settings on this options tab are saved automatically after each change.}}<',
'>{{Heading style}}<',
'>{{Plain}}<',
'>{{Underline}}<',
'>{{Markdown-style}}<',
'>{{Table of contents}}<',
'>{{You can also use this option to effectively disable TOC by setting a very high number.}}<',
'{{Table of contents will appear in text notes when the note has more than a defined number of headings. You can customize this number:}}',
]
replace_in_file(file_path, translation)

file_path = 'src/services/change_password.js'
translation = [
'''message: "{{Given current password doesn't match hash}}"''',
Expand All @@ -927,6 +946,18 @@ def replace_in_file(file_path, translation, base_path=BASE_PATH):
]
replace_in_file(file_path, translation, TARGET_PATH)

file_path = 'src/services/search/expressions/note_content_fulltext.js'
translation = [
'throw new Error(`{{Note content can be searched only with operators: }}`',
]
replace_in_file(file_path, translation, TARGET_PATH)

file_path = 'src/services/search/services/handle_parens.js'
translation = [
'throw new Error("{{Did not find matching right parenthesis.}}"',
]
replace_in_file(file_path, translation, TARGET_PATH)

# no need for translate for now
file_path = 'src/services/search/services/search.js'
translation = [
Expand All @@ -936,6 +967,13 @@ def replace_in_file(file_path, translation, base_path=BASE_PATH):
file_path = 'src/services/sql_init.js'
translation = [
"title: '{{root}}",
'throw new Error("{{DB is already initialized}}"',
]
replace_in_file(file_path, translation, TARGET_PATH)

file_path = 'src/services/setup.js'
translation = [
'throw new Error(`{{Could not setup sync since local sync protocol version is ${appInfo.syncVersion} while remote is ${response.syncVersion}. To fix this issue, use same Trilium version on all instances.}}`',
]
replace_in_file(file_path, translation, TARGET_PATH)

Expand Down Expand Up @@ -1333,6 +1371,7 @@ def replace_in_file(file_path, translation, base_path=BASE_PATH):
'- {{run once an hour. You can use additional label <code>runAtHour</code> to specify at which hour.}}<',
'- {{run once a day}}<',
'>{{Custom request handler}}<',
'>{{ will force the Table of Contents to be shown, }}<',
'title="{{Cancel changes and close}}"',
'title="{{Attribute name can be composed of alphanumeric characters, colon and underscore only}}"',
'title="{{Relation is a named connection between source note and target note.}}"',
Expand Down Expand Up @@ -1386,6 +1425,7 @@ def replace_in_file(file_path, translation, base_path=BASE_PATH):
"{{marks note which is served on /share root.}}",
"{{note will be served in its raw format, without HTML wrapper}}",
"{{will forbid robot indexing of this note via <code>X-Robots-Tag: noindex</code> header}}",
"{{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.}}",
"{{comma delimited names of relations which should be displayed. All other ones will be hidden.}}",
"{{comma delimited names of relations which should be hidden. All other ones will be displayed.}}",
"{{executes when note is created on backend}}",
Expand Down Expand Up @@ -1800,6 +1840,21 @@ def replace_in_file(file_path, translation, base_path=BASE_PATH):
]
replace_in_file(file_path, translation)

file_path = 'src/public/app/widgets/floating_buttons/relation_map_buttons.js'
translation = [
'title="{{Create new child note and add it into this relation map}}"',
'title="{{Reset pan & zoom to initial coordinates and magnification}}"',
'title="{{Zoom In}}"',
'title="{{Zoom Out}}"',
]
replace_in_file(file_path, translation)

file_path = 'src/public/app/widgets/floating_buttons/mermaid_export_button.js'
translation = [
'title="{{Export Mermaid diagram as SVG}}"',
]
replace_in_file(file_path, translation)

file_path = 'src/public/app/widgets/mobile_widgets/mobile_detail_menu.js'
translation = [
'title: "{{Insert child note}}"',
Expand All @@ -1813,6 +1868,8 @@ def replace_in_file(file_path, translation, base_path=BASE_PATH):
translation = [
'>{{No plugin buttons loaded yet.}}<',
'> {{Switch to desktop version}}<',
'>{{ Enter protected session}}<',
'>{{ Leave protected session}}<',
'> {{Logout}}<',
'title="{{New note}}"',
'title="{{Collapse note tree}}"',
Expand Down Expand Up @@ -3107,6 +3164,12 @@ def replace_in_file(file_path, translation, base_path=BASE_PATH):
]
replace_in_file(file_path, translation, TARGET_PATH)

file_path = 'src/routes/api/image.js'
translation = [
'message: "{{Unknown image type: }}"',
]
replace_in_file(file_path, translation, TARGET_PATH)

file_path = 'src/routes/api/login.js'
translation = [
'''message: "{{DB schema does not exist, can't sync.}}"''',
Expand Down
17 changes: 17 additions & 0 deletions translations.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,7 @@
'JS backend': '',
'Open': '',
' Enter protected session': '',
' Leave protected session': '',
'This note is protected and to access it you need to enter password.': '',
'Content of this note cannot be displayed in the book format': '',
'Collapse all notes': '',
Expand Down Expand Up @@ -1411,6 +1412,7 @@
'match words': '',
'This note was originally taken from:': '',
'Table of Contents': '',
'Table of contents': '',
'Apply bulk actions': '',
'Apply bulk actions on selected notes': '',
'Bulk assign attributes': '',
Expand Down Expand Up @@ -1464,4 +1466,19 @@
'Disclaimer on the experimental status': '',
'Web View is an experimental note type, and it might be removed or substantially changed in the future. Web View works also only in the desktop build.': '',
'Type the content of your code note here...': '',
'Text notes': '',
' will force the Table of Contents to be shown, ': '',
'You can also use this option to effectively disable TOC by setting a very high number.': '',
'The diagram could not be displayed. See ': '',
'Note content can be searched only with operators: ': '',
'Did not find matching right parenthesis.': '',
'Could not setup sync since local sync protocol version is ${appInfo.syncVersion} while remote is ${response.syncVersion}. To fix this issue, use same Trilium version on all instances.': '',
'DB is already initialized': '',
'Unknown image type: ': '',
'Folders': '',
'Export Mermaid diagram as SVG': '',
'Table of contents will appear in text notes when the note has more than a defined number of headings. You can customize this number:': '',
'Network connections': '',
'Check for updates automatically': '',
"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.": '',
}
19 changes: 18 additions & 1 deletion translations_cn.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@
'descending': '降序',
'No link to add.': '缺少要添加的链接.',
'`Note "${clonedNote.title}" has been cloned into ${targetNote.title}`': '`笔记 "${clonedNote.title}" 已被克隆至 ${targetNote.title}`',
'No path to clone to.': '缺少要克隆到的路径.js组件',
'No path to clone to.': '缺少要克隆到的路径.',
'Are you sure you want to remove the note "${title}" from relation map?': '你确定要从关系图中删除笔记"${title}"吗?',
"If you don't check this, note will be only removed from relation map, but will stay as a note.": '如果你不勾选这个, 只会从关系图中删除笔记的引用, 但保留笔记本身.',
'Also delete note': '连笔记一起删除',
Expand Down Expand Up @@ -416,6 +416,7 @@
'JS backend': 'JS 后端',
'Open': '打开',
' Enter protected session': '进入受保护的会话',
' Leave protected session': '退出受保护的会话',
'This note is protected and to access it you need to enter password.': '此笔记受保护, 您需要输入密码来访问它.',
'Content of this note cannot be displayed in the book format': '该笔记的内容无法以书籍格式显示',
'Collapse all notes': '折叠所有笔记',
Expand Down Expand Up @@ -1404,6 +1405,7 @@
'match words': '全字匹配',
'This note was originally taken from:': '笔记来源:',
'Table of Contents': '目录',
'Table of contents': '目录',
'Apply bulk actions': '应用批量动作',
'Apply bulk actions on selected notes': '对选定的笔记应用批量动作',
'Branch prefix has been saved.': '分支前缀已保存.',
Expand Down Expand Up @@ -1459,5 +1461,20 @@
'Disclaimer on the experimental status': '实验性功能免责声明',
'Web View is an experimental note type, and it might be removed or substantially changed in the future. Web View works also only in the desktop build.': '网页视图是一种实验性笔记类型, 将来可能会被删除或大幅更改. 网页视图只在桌面端有效',
'Type the content of your code note here...': '在此处输入代码笔记的内容...',
'Text notes': '文字笔记',
' will force the Table of Contents to be shown, ': '将会强制显示目录,',
'You can also use this option to effectively disable TOC by setting a very high number.': '您可以设置一个非常大的数来禁用目录.',
'The diagram could not be displayed. See ': '图表无法显示. 请看 ',
'Note content can be searched only with operators: ': '笔记内容只能使用运算符搜索: ',
'Did not find matching right parenthesis.': '没有找到匹配的右括号.',
'Could not setup sync since local sync protocol version is ${appInfo.syncVersion} while remote is ${response.syncVersion}. To fix this issue, use same Trilium version on all instances.': '无法设置同步,因为本地同步协议版本是 ${appInfo.syncVersion} 而远程是 ${response.syncVersion}. 要修复这个问题, 请保证所有Trilium服务端和客户端都使用相同的版本',
'DB is already initialized': '数据库已经初始化',
'Unknown image type: ': '未知图像类型: ',
'Folders': '文件夹',
'Export Mermaid diagram as SVG': '将美人鱼图导出为SVG',
'Table of contents will appear in text notes when the note has more than a defined number of headings. You can customize this number:': '当笔记具有超过定义数量的标题时, 目录将出现在文本笔记中. 你可以自定义这个数值:',
'Network connections': '网络连接',
'Check for updates automatically': '自动检查更新',
"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.": "需要身份验证才能访问此共享笔记. 值的格式'用户名:密码'. 别忘了设置为可继承来对所有子笔记和图片生效.",
'': '',
}

0 comments on commit e6e0b0b

Please sign in to comment.