mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-30 03:32:26 +08:00
add translation for doc notes
This commit is contained in:
parent
1e996d6f82
commit
1c2975a818
3
src/public/app/doc_notes/cn/hidden.html
Normal file
3
src/public/app/doc_notes/cn/hidden.html
Normal file
@ -0,0 +1,3 @@
|
||||
<p>隐藏树用于记录各种应用层数据,这些数据大部分时间可能对用户不可见。</p>
|
||||
|
||||
<p>确保你知道自己在做什么。对这个子树的错误更改可能会导致应用程序崩溃。</p>
|
@ -0,0 +1 @@
|
||||
<p>此启动器操作的键盘快捷键可以在“选项”->“快捷键”中进行配置。</p>
|
@ -0,0 +1,3 @@
|
||||
<p>“后退”和“前进”按钮允许您在导航历史中移动。</p>
|
||||
|
||||
<p>这些启动器仅在桌面版本中有效,在服务器版本中将被忽略,您可以使用浏览器的原生导航按钮代替。</p>
|
11
src/public/app/doc_notes/cn/launchbar_intro.html
Normal file
11
src/public/app/doc_notes/cn/launchbar_intro.html
Normal file
@ -0,0 +1,11 @@
|
||||
<p>欢迎来到启动栏配置界面。</p>
|
||||
|
||||
<p>您可以在此处执行以下操作:</p>
|
||||
|
||||
<ul>
|
||||
<li>通过拖动将可用的启动器移动到可见列表中(从而将它们放入启动栏)</li>
|
||||
<li>通过拖动将可见的启动器移动到可用列表中(从而将它们从启动栏中隐藏)</li>
|
||||
<li>您可以通过拖动重新排列列表中的项目</li>
|
||||
<li>通过右键点击“可见启动器”文件夹来创建新的启动器</li>
|
||||
<li>如果您想恢复默认设置,可以在右键菜单中找到“重置”选项。</li>
|
||||
</ul>
|
9
src/public/app/doc_notes/cn/launchbar_note_launcher.html
Normal file
9
src/public/app/doc_notes/cn/launchbar_note_launcher.html
Normal file
@ -0,0 +1,9 @@
|
||||
<p>您可以定义以下属性:</p>
|
||||
|
||||
<ol>
|
||||
<li><code>target</code> - 激活启动器时应打开的笔记</li>
|
||||
<li><code>hoistedNote</code> - 可选,在打开目标笔记之前将更改提升的笔记</li>
|
||||
<li><code>keyboardShortcut</code> - 可选,按下键盘快捷键将打开该笔记</li>
|
||||
</ol>
|
||||
|
||||
<p>启动栏显示来自启动器的标题/图标,这不一定与目标笔记的标题/图标一致。</p>
|
12
src/public/app/doc_notes/cn/launchbar_script_launcher.html
Normal file
12
src/public/app/doc_notes/cn/launchbar_script_launcher.html
Normal file
@ -0,0 +1,12 @@
|
||||
<p>脚本启动器可以执行通过 <code>~script</code> 关系连接的脚本(代码笔记)。</p>
|
||||
|
||||
<ol>
|
||||
<li><code>script</code> - 与应在启动器激活时执行的脚本笔记的关系</li>
|
||||
<li><code>keyboardShortcut</code> - 可选,按下键盘快捷键将激活启动器</li>
|
||||
</ol>
|
||||
|
||||
<h4>示例脚本</h4>
|
||||
|
||||
<pre>
|
||||
api.showMessage("当前笔记是 " + api.getActiveContextNote().title);
|
||||
</pre>
|
6
src/public/app/doc_notes/cn/launchbar_spacer.html
Normal file
6
src/public/app/doc_notes/cn/launchbar_spacer.html
Normal file
@ -0,0 +1,6 @@
|
||||
<p>间隔器允许您在视觉上将启动器分组。您可以在提升的属性中进行配置:</p>
|
||||
|
||||
<ul>
|
||||
<li><code>baseSize</code> - 定义以像素为单位的大小(如果有足够的空间)</li>
|
||||
<li><code>growthFactor</code> - 如果您希望间隔器保持恒定的 <code>baseSize</code>,则设置为 0;如果设置为正值,它将增长。</li>
|
||||
</ul>
|
34
src/public/app/doc_notes/cn/launchbar_widget_launcher.html
Normal file
34
src/public/app/doc_notes/cn/launchbar_widget_launcher.html
Normal file
@ -0,0 +1,34 @@
|
||||
<p>请在提升的属性中定义目标小部件笔记。该小部件将用于渲染启动栏图标。</p>
|
||||
|
||||
<h4>示例启动栏小部件</h4>
|
||||
|
||||
<pre>
|
||||
const TPL = `<div style="height: 53px; width: 53px;"></div>`;
|
||||
|
||||
class ExampleLaunchbarWidget extends api.NoteContextAwareWidget {
|
||||
doRender() {
|
||||
this.$widget = $(TPL);
|
||||
}
|
||||
|
||||
async refreshWithNote(note) {
|
||||
this.$widget.css("background-color", this.stringToColor(note.title));
|
||||
}
|
||||
|
||||
stringToColor(str) {
|
||||
let hash = 0;
|
||||
for (let i = 0; i < str.length; i++) {
|
||||
hash = str.charCodeAt(i) + ((hash << 5) - hash);
|
||||
}
|
||||
|
||||
let color = '#';
|
||||
for (let i = 0; i < 3; i++) {
|
||||
const value = (hash >> (i * 8)) & 0xFF;
|
||||
color += ('00' + value.toString(16)).substr(-2);
|
||||
}
|
||||
|
||||
return color;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = new ExampleLaunchbarWidget();
|
||||
</pre>
|
1
src/public/app/doc_notes/cn/share.html
Normal file
1
src/public/app/doc_notes/cn/share.html
Normal file
@ -0,0 +1 @@
|
||||
<p>在这里您可以找到所有分享的笔记。</p>
|
1
src/public/app/doc_notes/cn/user_hidden.html
Normal file
1
src/public/app/doc_notes/cn/user_hidden.html
Normal file
@ -0,0 +1 @@
|
||||
<p>此笔记作为一个子树,用于存储由用户脚本生成的数据,这些数据本应避免在隐藏子树中随意创建。</p>
|
@ -31,7 +31,14 @@ export default class DocTypeWidget extends TypeWidget {
|
||||
const docName = note.getLabelValue('docName');
|
||||
|
||||
if (docName) {
|
||||
this.$content.load(`${window.glob.appPath}/doc_notes/${docName}.html`);
|
||||
// find doc based on language
|
||||
const lng = i18next.language;
|
||||
this.$content.load(`${window.glob.appPath}/doc_notes/${lng}/${docName}.html`, (response, status) => {
|
||||
// fallback to english doc if no translation available
|
||||
if (status === 'error') {
|
||||
this.$content.load(`${window.glob.appPath}/doc_notes/en/${docName}.html`);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.$content.empty();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user