GithubHelp home page GithubHelp logo

nriver / trilium-translation Goto Github PK

View Code? Open in Web Editor NEW
2.0K 27.0 246.0 10.64 MB

Translation for Trilium Notes. Trilium Notes 中文适配, 体验优化

License: GNU Affero General Public License v3.0

Python 49.38% Dockerfile 0.07% HTML 37.95% CSS 5.06% JavaScript 7.50% Shell 0.03%
trilium-notes trilium-translation trilium-chinese-translation chinese enhancement i18n note-taking translation docker docker-compose

trilium-translation's Introduction

🌏 Trilium Translation

Github all releases GitHub license Maintenance GitHub release Docker

English | 简体中文

This repo provides a translation for the awesome Trilium Notes. If you'd like to translate Trilium Notes into any language you like, please follow this guide. Currently, I have translated Trilium Notes into Chinese. The translation will keep update to the latest Trilium Notes' stable releases.

Star this repo if you like it, thx :)

If you have old data, PLEASE BACK UP YOUR DATA BEFORE USE.

🦮 Table of Contents


📸 Screenshots

Original dark theme

dark

Original light theme

light

Nier theme made by me :)

nier

Canvas Note

am3

Math formular

nier


📚 How to use

  1. Download from the latest Release that suit your computer system.
  2. Unzip and execute(trilium for Linux, trilium.sh for Linux server, trilium.exe for Windows, trilium.app for macOS).
  3. Enjoy :)

🐳 How to run server with docker

For Trilium Notes server, you can download my docker-compose.yml Then run it with docker simply by executing:

docker-compose up -d

It will download the Chinese version of Trilium I built on Docker Hub.

Open http://127.0.0.1:8080 in your browser to access the server page.

Your note data will be in the same directory of the docker-compose.yml file.


🌐 How to translate

If you would like to check the code (my codes comes with Chinese and English comments, check it) and compile it by yourself. Here is some information may be useful.

WARNING! The scripts I wrote includes some 'rm -rf' commands, modify and use codes with care!

🌐 How does the translation work

It extracts the resource files from the latest Trilium Notes official release and use regular expression to replace UI text for each file. Then pack the translated files back into the package. Done.

💻 Compile Environment Requirement

My environment is Manjaro(Linux)/macOS based, but you can make some change to work on other platform. You need to change some path configuration in my code to work on your machine.

Python3 with module

pip3 install requests --user

Nodejs with module

npm install -g asar webpack webpack-cli
npm install webpack --save-dev

7z if you want to make release

🔍 Translate Process

  1. Modify configurations in settings.py by the comments.
  2. Do translate in translations.py. (See translations_cn.py. There are over 1000 lines to translate, be patient :) )
  3. Run python3 init.py to download latest Trilium Notes.
  4. Run python3 trans.py to make a translation patch.
  5. Run python3 make_release.py to apply patch to releases for all platforms.

Note: In translations.py there are some texts begin or ends with quotes were made on purpose for regex match, do not remove them in your translation. There are some text like '${xxxx}' in the translation, these are the placeholder in the original Trilium Notes source code, do not modify them unless you know what you are doing.

📝 More text to translate

If you'd like to translate more text, mark each text in the file that you want to translate with double brackets{{}} like I did in trans.py.

Put everything between double brackets into the dict in translations.py and translate to the language you like. (Some text were ended with }. Try to avoid triple brackets by change from ${xxx}}}' to something like ${xxx}'}} )


🛑 Limitations

The translation is hard-coded in the frontend/backend source code, so you can not switch between languages. If there were some mistakes in the translation, Trilium Notes may not function correctly. Therefore, please back up your data before use.

If you break Trilium Notes somehow, you need to redownload everything with init.py.


🤔 Common questions

The following are some representative questions that I feel are frequently asked by users, so I'll summarize them.

Which VPS provider are you using to run the Trilium Notes server?

I'm using Racknerd now. It's insainly cheap. And very suitable to host Trilium Server.

Racknerd's promotions seem to be ongoing, and you can always purchase them. If you're interested, you might want to give it a try. The links include an affiliate code, which you can remove if you prefer.

I've tested Trilium's server program, and it typically consumes around 150MB of memory. So, the cheapest level would be sufficient, which costs only $10 per year. If you find the storage is not enough for you, you can try the slightly more expensive option, which is usually less than $20 per year and can provide you with about 30GB of SSD storage.

Promotion RAM CPU SSD Bandwidth Price Purchase
2024 Chinese New Year 1G 1 Core 15G 2T/Month $10.99/Year Link
2024 Chinese New Year 1.5G 1 Core 25G 4T/Month $16.88/Year Link
2024 New Year 768M 1 Core 21G 1T/Month $11.49/Year Link
2024 New Year 2G 1 Core 35G 2.5T/Month $17.38/Year Link
2023 Black Friday 768M 1 Core 15G 1T/Month $10.18/Year Link
2023 Black Friday 2G 1 Core 30G 2.5T/Month $16.98/Year Link

You can also choose other VPS providers, but remember to back up your data. Data is priceless. Make sure to perform backups just in case, and keep it in mind.

Some Questions Regarding Domain Names

How to Enable HTTPS Encryption?

In general, HTTP requests accessed through ports are plaintext. If you need to use HTTPS encryption, it must be used in conjunction with the domain.

Where Did You Purchase Your Domain?

I purchased my domain from Namesilo, and the prices are quite reasonable. Feel free to give it a try if you're interested. Below is the link with an affiliate tag; you can remove it if you prefer. Additionally, there is a coupon code nriver that can save you $1 on your first domain purchase.

Domain Purchase Link

How to Apply for a Website Certificate?

As for website certificates, you can use the free acme.sh tool. For specific instructions, you can refer to the acme.sh documentation on certificate issuance.

Why my translation is not working?

If you have run the original version of the Trilium program and there is a cache of the English version in your system, please follow these steps:

  1. Close Trilium.
  2. On Windows, delete the directory C:\Users\Username\AppData\Roaming\Trilium Notes.
  3. On Linux, delete the directory ~/.config/Trilium Notes/.
  4. Restart Trilium, and it will be in your translated language.

Where is the Note Database?

Default Paths for Client Databases

  • Windows: C:\Users\Username\AppData\Roaming\trilium-data
  • Linux: /home/Username/.local/share/trilium-data
  • Mac: /Users/Username/Library/ApplicationSupport/trilium-data

Default Path for Server Database

  • Linux Server: /home/Username/trilium-data
  • Docker: In the trilium-data folder in the same directory as docker-compose.yml

How to Change the Database Location?

You can refer to the client's built-in trilium-portable.sh or trilium-portable.bat to run it in a portable manner. To change the database location, simply modify the database path in the file.

If you want to experience the latest original features, it is recommended to use this method.


⏳ Stargazers over time

Generated by caarlos0/starcharts.

Stargazers over time


💰 Donation

Hello! If you appreciate my creations, kindly consider backing me. Your support is greatly appreciated. Thank you!

Alipay:
Alipay

Wechat Pay:
Wechat Pay

Ko-fi:
Support Me on Ko-fi


🙏 Thanks

Thanks t**e for donating 20 CNY!

Thanks 1*0 for donating 8 CNY! Memo: 蜜雪冰城

Thanks **钧 for donating 38 CNY! Memo: 咖啡

Thanks *风 for donating 25 CNY!

Thanks **进 for donating 25 CNY!

Thanks *军 for donating 18 CNY! Memo: 七分甜

Thanks **逸 for donating 10 CNY!

Thanks **恩 for donating 30 CNY!

Thanks **莲 for donating 10 CNY!

Thanks **楷 for donating 5 CNY!

Thanks J*s for donating 50 CNY!

Thanks *记 for donating 10 CNY! Memo: 多谢大佬的辛勤付出

Thanks *睿 for donating 5 CNY! Memo: 感谢您的自动命名工具

Thanks *建 for donating 200 CNY! Memo: trilium

Thanks *称 for donating 10 CNY!

Thanks **逸 for donating 10 CNY! Memo: 大佬牛逼

Thanks *斌 for donating 10 CNY!

Thanks *僧 for donating 30 CNY! Memo: 加油,老哥!

Thanks *天 for donating 9 CNY!

Thanks *均 for donating 30 CNY! Memo: 翻译辛苦了,喝杯咖啡

Thanks A*s for donating 30 CNY!

Thanks **逸 for donating 20 CNY!

Thanks *臾 for donating 30 CNY!

Thanks *冰 for donating 10 CNY!

Thanks *遥 for donating 10 CNY! Memo: 感谢群主的翻译

Thanks **庆 for donating 10 CNY!

Thanks **逸 for donating 50 CNY!

Thanks **聪 for donating 10 CNY! Memo: 很大的帮助翻译家!爱来自**

Thanks *メ for donating 200 CNY!

Thanks **奇 for donating 20 CNY!

Thanks *磊 for donating 10 CNY!

Thanks *姆 for donating 5 CNY!

Thanks **锐 for donating 20 CNY! Memo: 感谢您的工作,请您喝杯咖啡

Thanks **行 for donating 10 CNY! Memo: 小葱白贡献绵薄之力

Thanks 鞠*M for donating 10 CNY! Memo: 感谢大佬,请喝水

Thanks *🐈 for donating 10 CNY!

Thanks *白 for donating 10 CNY! Memo: 小葱白献上

Thanks *白 for donating 5 CNY! Memo: 小葱白献上

Thanks *杜 for donating 20 CNY! Memo: 谢谢您的翻译

Thanks *伟 for donating 20 CNY!

Thanks *淼 for donating 10 CNY! Memo: 今天第一天下载使用,感觉发现新大陆,谢谢!(希望入群交流)

Thanks *落 for donating 10 CNY! Memo: 感谢长期的坚持♥

Thanks *F for donating 99 CNY! Memo: 感谢分享 希望深度合作 长期学习交流

Thanks *F for donating 200 CNY! Memo: Best wishes

Thanks F*g for donating 10 CNY!

Thanks **逸 for donating 30 CNY! Memo: 来杯奶茶,哈皮一下

Thanks *绿 for donating 20 CNY! Memo: 多谢,学生能力有限,尽一份心意

Thanks A* for donating 100 CNY! Memo: 非常感謝你寫這個小程式,捐贈了小小的心意給你及保重身體!

Thanks *户 for donating 20 CNY!

Thanks *孤 for donating 20 CNY! Memo: 请群主大大喝杯奶茶

Thanks X*H for donating 10 CNY!

Thanks **辉 for donating 20 CNY! Memo: 感谢大佬,辛苦了

Thanks *卫 for donating 50 CNY! Memo: 希望能保持更新

Thanks **鄂 for donating 10 CNY!

Thanks **幻 for donating 10 CNY!

Thanks C*W for donating 50 CNY!

Thanks *超 for donating 10 CNY!

Thanks *磊 for donating 30 CNY!

Thanks **龙 for donating 200 CNY!

Thanks for the greate IDE Pycharm from Jetbrains.

Jetbrains

trilium-translation's People

Contributors

akkuman avatar nriver avatar ryosga avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

trilium-translation's Issues

v.56.2存在文章编目问题

我是从v0.51.1版本升级到v0.56.2,在编辑文章目录时,无论是用手动快捷方式(##),还是功能选择标题方式,都无法正常显示目录。存在如下bug:
1、有时会在设置3个标题以上时会自动显示目录,多数时候设置再多的标题也不会显示目录;
2、在修改目录级别时存在错乱的问题,如:目录级别不正确;

如何备份本地数据?

如何备份本地数据?C:\Users\Administrator\AppData\Roaming,好似有2个文件夹,是该软件的数据么,有没有办法指定到某一路径下?

如何管理图片

感谢大佬提供的中文版本。
我的环境是Ubuntu 22.04 LTS x86_64(Py3.7.8) ,使用了宝塔和docker架设了trilium中文版。我在使用trilium的时候上传了一些图片,我现在不想要这些图片了,我该如何去删除?直接删除相关笔记的话,是否可以同时删除笔记里的图片和附件?谢谢了

中文文档

请问下汉化部分包括自带文档吗?

看示例图片自带文档已经汉化,但两个windows版本打开后的文档均为英文文档,删除了数据库进行初始化后默认文档仍旧为英文,是bug还是文档未汉化?

翻译修正:Copy/clone应为复制/克隆

嗨,有一个小问题,右键菜单里的Copy/clone翻译成复制/克隆会更精准一点,因为triliumCopy/clone里的Copy不是字面意义的copy而是一种引用,具体解释可以参考这个克隆笔记

我称这些为“clones”(克隆),但这有点误导性 - 没有原始和克隆的笔记 - 两个父类别中的笔记是相同的。

同样,Clone to建议翻译成克隆到:)

升级到新版本...进不去了

Trilium Notes设置
正在进行同步
同步已正确设置. 同步数据需要一些时间. 同步完成后会自动跳转到登录页.
未完成的同步项: 0

docker启动报错...

./node/bin/node[6]: ../src/node_platform.cc:61:std::unique_ptr node::WorkerThreadsTaskRunner::DelayedTaskScheduler::Start(): Assertion `(0) == (uv_thread_create(t.get(), start_thread, this))' failed.

1: 0xb08f10 node::Abort() [./node/bin/node]
2: 0xb08f8e [./node/bin/node]
3: 0xb7515e [./node/bin/node]
4: 0xb75226 node::NodePlatform::NodePlatform(int, v8::TracingController*) [./node/bin/node]
5: 0xacbf74 node::InitializeOncePerProcess(int, char**, node::InitializationSettingsFlags, node::ProcessFlags::Flags) [./node/bin/node]
6: 0xaccb59 node::Start(int, char**) [./node/bin/node]
7: 0x14ad719ead90 [/lib/x86_64-linux-gnu/libc.so.6]
8: 0x14ad719eae40 __libc_start_main [/lib/x86_64-linux-gnu/libc.so.6]
9: 0xa408ec [./node/bin/node]
Aborted

请求添加scoop下载方式

scoop是Windows下的一个命令行下载器

在scoop的extra bucket(软件仓库)中已有对zadam/trilium的支持,请问将来此仓库是否也能提供此下载方式

Trilium docker 是不是不支持 映射到宿主机通过NFS挂载的目录

如果宿主机的目录是通过NFS挂载的共享目录,trilium过几分钟就会报错,需要刷新浏览器重新登录;

弹窗:
Error when calling PUT notes/UtLliiX8PHN2: error - Unauthorized

log:
[session-file-store] will retry, error on last attempt: Error: ENOENT: no such file or directory, open '/root/trilium-data/sessions/cN8YbZR35_-nZDktfLwVuCje8odMMXnz.json'
PUT /api/notes/UtLliiX8PHN2 rejected with 401 Logged in session not found
JS Error: Error when calling PUT notes/UtLliiX8PHN2: error - Unauthorized

Stack: Error
at Object.N [as logError] (http://192.168.1.111:8080/app-dist/desktop.js:2:97436)
at Object.throwError (http://192.168.1.111:8080/app-dist/desktop.js:2:82914)
at c (http://192.168.1.111:8080/app-dist/desktop.js:2:79764)
at async Object.error (http://192.168.1.111:8080/app-dist/desktop.js:2:80072)

如果直接挂宿主机系统自带目录就不会出现这些问题

发现一处bug

单元格属性-将单元格文本对齐到中间
这个设置貌似是无效的

客户端 连接服务端问题

你好 服务端只能有一个, 我客户端已连接上测试用的服务端 ,想切回到正常使用的服务端 怎么操作? 我试着把客户端删掉重新安装,打开还是连接测试用的服务端 这个该怎么处理?

你们的代码块有高亮吗

看到宣传图里是有颜色高亮的,Mac版本发现用所有的主题,在代码块里不管什么编程语言都是没有高亮的是什么原因呢?

另外想咨询下: 一些markdown语法可以用 ```c++直接指定编程语言,在trilium里应该如何直接键盘指定呢

白屏

打开白花花一片,什么都没有
tR07bqCmx3

没法打开程序

执行trilium.exe之后没有任何反应 但是能用trilium-portable.bat脚本打开

archlinux的AUR脚本无法通过校验有效性通过

原因:第二次通过yay助手的时候之前下载的文件存在导致并没有重新获取下载
解决: PKGBUILD文件中source字段增加一个参数
source=("$pkgname-$pkgver.zip::https://github.com/Nriver/trilium-translation/releases/download/v$pkgver/trilium-cn-linux-x64.zip")
影响:这样会导致下载的文件名称改变,增加了版本号,也就不会因为文件名重复出现 “错误: 一个或多个文件没有通过有效性检查!”
结果:无报错成功安装升级

【问题】关于当前笔记显示其他笔记内容的问题

那个text类型的笔记是跟着0.56.1版本升级到0.56.2的。(个人电脑创建的笔记,跟着软件一同升级的数据,0.56.2)
那个book类型的笔记是在其他电脑上用旧版本0.56.1软件创建的,而且是以导入的方式导入到个人电脑中的。(其他电脑创建的笔记,软件并没有升级,还是0.56.1)

我点击第一个笔记(text),显示的内容是正常的,点击下一个笔记,这个笔记类型是书(book),也很正常,但是问题来了,当点击前一个笔记(text)时,内容却不是第一个笔记(text)的内容,而是另一个笔记书(book)的内容,这就很奇怪了?
而且我还测试了上一级目录,发现内容都是book笔记的内容。
这个bug影响非常严重

docker 应用版本:0.51.2 ,启动出现错误

./node/bin/node[6]: ../src/node_platform.cc:61:std::unique_ptr node::WorkerThreadsTaskRunner::DelayedTaskScheduler::Start(): Assertion `(0) == (uv_thread_create(t.get(), start_thread, this))' failed.
1: 0xb09980 node::Abort() [./node/bin/node]
2: 0xb099fe [./node/bin/node]
3: 0xb78f9e [./node/bin/node]
4: 0xb79066 node::NodePlatform::NodePlatform(int, v8::TracingController*) [./node/bin/node]
5: 0xaccf49 node::InitializeOncePerProcess(int, char**, node::InitializationSettingsFlags, node::ProcessFlags::Flags) [./node/bin/node]
6: 0xacd1f9 node::Start(int, char**) [./node/bin/node]
7: 0x7fe215850d90 [/lib/x86_64-linux-gnu/libc.so.6]
8: 0x7fe215850e40 __libc_start_main [/lib/x86_64-linux-gnu/libc.so.6]
9: 0xa4076c [./node/bin/node]
Aborted (core dumped)

docker 提示名字不允许 yml 文件 需要调整下

evan@192 我的个人文档 % docker-compose -f docker-compose.yml up -d
[+] Running 0/0
⠋ Container -trilium-cn-1 Creating 0.0s
Error response from daemon: Invalid container name (-trilium-cn-1), only [a-zA-Z0-9][a-zA-Z0-9_.-] are allowed

docker服务端不支持arm架构?

我在甲骨文云的A1服务器上,官方的原版docker是可以跑的,这个中文的服务端跑不了,提示
trilium-cn | standard_init_linux.go:228: exec user process caused: exec format error
应该是不支持arm架构。

yam文件 使用, 报错

evan@192 我的个人文档 % docker-compose up -d
yaml: line 27: mapping values are not allowed in this context

原因下载的yam 竟然是html 文件,下载的时候请注意

请问下这个是哪里出错了呢?

部署到了服务器上,
在写笔记的过程中,会卡住.
查看LOG文件,报如下错误.

17:17:16.290 JS Error: 未捕获的错误: 信息: Uncaught CKEditorError: Cannot read properties of null (reading '_source')
Read more: https://ckeditor.com/docs/ckeditor5/latest/framework/guides/support/error-codes.html#error-Cannot read properties of null (reading '_source'), URL: http://dormanter.duckdns.org:8081/#root/7EYObexys1Pm/fSiuGE1j7pyy-Nl8B, 行数: 5, 列数: 5908, 错误对象: {"name":"CKEditorError","context":{}}, 堆栈: TypeError: Cannot read properties of null (reading '_source')
    at new Es (<anonymous>:5:242091)
    at Ls (<anonymous>:5:249180)
    at Fs (<anonymous>:5:248681)
    at Gs.scrollToTheSelection (<anonymous>:5:252796)
    at Object.listenTo.priority (<anonymous>:5:535459)
    at Object.fire (<anonymous>:5:123360)
    at kn (<anonymous>:5:189271)
    at yn.fire (<anonymous>:5:188775)
    at o (<anonymous>:5:534089)
    at Object.<anonymous> (<anonymous>:5:534465)^M
Stack: Error
    at Object.v [as logError] (http://dormanter.duckdns.org:8081/app-dist/desktop.js:2:86771)
    at Ie.window.onerror (http://dormanter.duckdns.org:8081/app-dist/desktop.js:2:347915)
17:17:16.475 JS Error: 未捕获的错误: 信息: Uncaught CKEditorError: Cannot read properties of null (reading '_source')
Read more: https://ckeditor.com/docs/ckeditor5/latest/framework/guides/support/error-codes.html#error-Cannot read properties of null (reading '_source'), URL: http://dormanter.duckdns.org:8081/#root/7EYObexys1Pm/fSiuGE1j7pyy-Nl8B, 行数: 5, 列数: 5908, 错误对象: {"name":"CKEditorError","context":{}}, 堆栈: TypeError: Cannot read properties of null (reading '_source')
    at new Es (<anonymous>:5:242091)
    at Ls (<anonymous>:5:249180)
    at Fs (<anonymous>:5:248681)
    at Gs.scrollToTheSelection (<anonymous>:5:252796)
    at Object.listenTo.priority (<anonymous>:5:535459)
    at Object.fire (<anonymous>:5:123360)
    at kn (<anonymous>:5:189271)
    at yn.fire (<anonymous>:5:188775)
    at o (<anonymous>:5:534089)
    at Object.<anonymous> (<anonymous>:5:534465)^M
Stack: Error
    at Object.v [as logError] (http://dormanter.duckdns.org:8081/app-dist/desktop.js:2:86771)
    at Ie.window.onerror (http://dormanter.duckdns.org:8081/app-dist/desktop.js:2:347915)
17:17:16.793 JS Error: 未捕获的错误: 信息: Uncaught CKEditorError: Cannot read properties of null (reading '_source')

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.