Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: Improve i18n

Daniel2eff2abe3b03
diff --git a/app/electron/init.html b/app/electron/init.html
index 85aa59d39d..24ac7734c3 100644
--- a/app/electron/init.html
+++ b/app/electron/init.html
@@ -264,16 +264,16 @@
</style>
</head>
<body>
-<div id="zhCN" class="fn__flex-column">
+<div id="layout" class="fn__flex-column">
<div class="fn__flex-1"></div>
<img class="icon">
- <h2>思源笔记</h2>
- <div class="slogan">重构你的思维</div>
+ <h2 data-i18n="title"></h2>
+ <div class="slogan" data-i18n="slogan"></div>
<div class="fn__flex-1"></div>
<label class="b3-label">
<div>
- 🌐 外观语言
- <div class="b3-label__text">用户界面语言,后续可以在 <kbd>设置</kbd> - <kbd>外观</kbd> 中进行切换</div>
+ <span data-i18n="lang"></span>
+ <div class="b3-label__text" data-i18n-html="langDesc"></div>
</div>
<div class="fn__flex-1"></div>
<select class="b3-select lang">
@@ -302,79 +302,20 @@
</label>
<label class="b3-label">
<div>
- 🗂️ 工作空间
- <div class="b3-label__text"> 工作空间用于存放数据,后续可以在顶栏左上角的主菜单中进行切换</div>
+ <span data-i18n="workspace"></span>
+ <div class="b3-label__text" data-i18n="workspaceDesc"></div>
</div>
<div class="fn__flex-1"></div>
- <button class="b3-button fn__flex-center choosePath">选择</button>
+ <button class="b3-button fn__flex-center choosePath" data-i18n="selectBtn"></button>
</label>
<div class="fn__flex-1"></div>
<div class="fn__flex-1 notice">
- <span>⚠️ 请勿使用第三方同步盘同步数据,否则会导致运行异常和数据损坏</span>
+ <span data-i18n="notice"></span>
</div>
<div class="feedback">
- <span>❤️ <a href="https://ld246.com/article/1649901726096" target="_blank">求助反馈建议</a></span>
- <span>🏘️ <a href="https://ld246.com/article/1640266171309" target="_blank">用户社区汇总</a></span>
- <span>🔖 <a href="https://b3log.org/siyuan/download.html" target="_blank" class="version"></a></span>
- </div>
- <div class="fn__flex-1"></div>
-</div>
-<div class="fn__none fn__flex-column" id="enUS">
- <div class="fn__flex-1"></div>
- <img class="icon">
- <h2>SiYuan</h2>
- <div class="slogan">Refactor your thinking</div>
- <div class="fn__flex-1"></div>
- <label class="b3-label">
- <div>
- 🌐 Language
- <div class="b3-label__text">User interface language, which can be switched later in <kbd>Settings</kbd> -
- <kbd>Appearance</kbd>
- </div>
- </div>
- <div class="fn__flex-1"></div>
- <select class="b3-select lang">
- <option value="ar">العربية</option>
- <option value="de">Deutsch</option>
- <option value="en">English</option>
- <option value="es">Español</option>
- <option value="fr">Français</option>
- <option value="he">עברית</option>
- <option value="hi">हिन्दी</option>
- <option value="id">Bahasa Indonesia</option>
- <option value="it">Italiano</option>
- <option value="ja">日本語</option>
- <option value="ko">한국어</option>
- <option value="nl">Nederlands</option>
- <option value="pl">Polski</option>
- <option value="pt-BR">Português (Brasil)</option>
- <option value="ru">Русский</option>
- <option value="sk">Slovenčina</option>
- <option value="th">ไทย</option>
- <option value="tr">Türkçe</option>
- <option value="uk">Українська</option>
- <option value="zh-TW">繁體中文</option>
- <option value="zh-CN">简体中文</option>
- </select>
- </label>
- <label class="b3-label">
- <div>
- 🗂️ Workspace
- <div class="b3-label__text">The workspace is used to store data, which can be switched later in the top bar
- menu later
- </div>
- </div>
- <div class="fn__flex-1"></div>
- <button class="b3-button fn__flex-center choosePath">Select</button>
- </label>
- <div class="fn__flex-1"></div>
- <div class="fn__flex-1 notice">
- <span>⚠️ Do not use a third-party sync disk to sync data, otherwise it will cause abnormal operation and data damage</span>
- </div>
- <div class="feedback">
- <span>❤️ <a href="https://liuyun.io/article/1686530886208" target="_blank">Support and Feedback</a></span>
- <span>🏘️ <a href="https://liuyun.io/article/1687779743723" target="_blank">User community summary</a></span>
- <span>🔖 <a href="https://b3log.org/siyuan/en/download.html" target="_blank" class="version"></a></span>
+ <span>❤️ <a data-i18n-href="feedbackUrl" target="_blank" data-i18n="feedback"></a></span>
+ <span>🏘️ <a data-i18n-href="communityUrl" target="_blank" data-i18n="community"></a></span>
+ <span>🔖 <a data-i18n-href="downloadUrl" target="_blank" class="version"></a></span>
</div>
<div class="fn__flex-1"></div>
</div>
@@ -386,10 +327,6 @@
</svg>
<div class="drag"></div>
<script>
- const isChinese = (lang) => {
- return 'zh-CN' === lang || 'zh-TW' === lang
- }
-
const getSearch = (key) => {
if (window.location.search.indexOf('?') === -1) {
return ''
@@ -406,37 +343,381 @@
return value
}
+ // 多语言文案,直接写死在 HTML 中,支持 21 种语言
+ // 中文用 ld246.com,其他语言用 liuyun.io
+ const I18N = {
+ "zh-CN": {
+ title: "思源笔记", slogan: "重构你的思维", workspace: "🗂️ 工作空间",
+ workspaceDesc: "工作空间用于存放数据,后续可以在顶栏左上角的主菜单中进行切换",
+ selectBtn: "选择", lang: "🌐 外观语言",
+ langDesc: "用户界面语言,后续可以在 <kbd>设置</kbd> - <kbd>外观</kbd> 中进行切换",
+ notice: "⚠️ 请勿使用第三方同步盘同步数据,否则会导致运行异常和数据损坏",
+ feedback: "求助反馈建议", community: "用户社区汇总", download: "下载最新版",
+ feedbackUrl: "https://ld246.com/article/1649901726096",
+ communityUrl: "https://ld246.com/article/1640266171309",
+ downloadUrl: "https://b3log.org/siyuan/download.html",
+ msgPartitionRoot: "⚠️ 请勿在分区根路径上创建工作空间,请新建一个文件夹作为工作空间",
+ msgNotEmpty: "⚠️ 该文件夹包含了其他文件,请新建一个文件夹作为工作空间",
+ msgICloud: "⚠️ 该文件夹位于 iCloud 同步路径下,请更换其他路径",
+ msgCloudDrive: "⚠️ 文件夹路径不能包含 onedrive、dropbox、google drive、pcloud、nutstore、baidunetdisk、weiyun、坚果云、百度网盘和腾讯微云等字样,请更换其他路径",
+ msgConfirm: "⚠️ 请确认没有将工作空间设置在第三方同步盘路径下,否则会造成数据损坏(iCloud/OneDrive/Dropbox/Google Drive/坚果云/百度网盘/腾讯微云等),是否继续?",
+ },
+ "zh-TW": {
+ title: "思源筆記", slogan: "重構你的思維", workspace: "🗂️ 工作空間",
+ workspaceDesc: "工作空間用於存放資料,後續可以在頂欄左上角的主選單中進行切換",
+ selectBtn: "選擇", lang: "🌐 外觀語言",
+ langDesc: "使用者介面語言,後續可以在 <kbd>設定</kbd> - <kbd>外觀</kbd> 中進行切換",
+ notice: "⚠️ 請勿使用第三方同步盤同步資料,否則會導致執行異常和資料損壞",
+ feedback: "求助回饋建議", community: "使用者社群匯總", download: "下載最新版",
+ feedbackUrl: "https://ld246.com/article/1649901726096",
+ communityUrl: "https://ld246.com/article/1640266171309",
+ downloadUrl: "https://b3log.org/siyuan/download.html",
+ msgPartitionRoot: "⚠️ 請勿在分區根路徑上建立工作空間,請新增一個資料夾作為工作空間",
+ msgNotEmpty: "⚠️ 該資料夾包含了其他檔案,請新增一個資料夾作為工作空間",
+ msgICloud: "⚠️ 該資料夾位於 iCloud 同步路徑下,請更換其他路徑",
+ msgCloudDrive: "⚠️ 資料夾路徑不能包含 onedrive、dropbox、google drive、pcloud、nutstore、baidunetdisk、weiyun、堅果雲、百度網盤和騰訊微雲等字樣,請更換其他路徑",
+ msgConfirm: "⚠️ 請確認沒有將工作空間設定在第三方同步盤路徑下,否則會造成資料損壞(iCloud/OneDrive/Dropbox/Google Drive/堅果雲/百度網盤/騰訊微雲等),是否繼續?",
+ },
+ "en": {
+ title: "SiYuan", slogan: "Refactor your thinking", workspace: "🗂️ Workspace",
+ workspaceDesc: "The workspace is used to store data, which can be switched later in the top bar menu later",
+ selectBtn: "Select", lang: "🌐 Language",
+ langDesc: "User interface language, which can be switched later in <kbd>Settings</kbd> - <kbd>Appearance</kbd>",
+ notice: "⚠️ Do not use a third-party sync disk to sync data, otherwise it will cause abnormal operation and data damage",
+ feedback: "Support and Feedback", community: "User community summary", download: "Download",
+ feedbackUrl: "https://liuyun.io/article/1686530886208",
+ communityUrl: "https://liuyun.io/article/1687779743723",
+ downloadUrl: "https://b3log.org/siyuan/en/download.html",
+ msgPartitionRoot: "⚠️ Do not create the workspace in the partition root path, please create a new folder as the workspace",
+ msgNotEmpty: "⚠️ This folder contains other files, please create a new folder as the workspace",
+ msgICloud: "⚠️ This folder is under the iCloud sync path, please change another path",
+ msgCloudDrive: "⚠️ The folder path can not contain onedrive, dropbox, google drive, pcloud, nutstore, baidunetdisk, weiyun, etc., please change another path",
+ msgConfirm: "⚠️ Please confirm that the workspace is not set under the path of a third-party sync disk, otherwise it will cause data damage (iCloud/OneDrive/Dropbox/Google Drive/Nutstore/Baidu Netdisk/Tencent Weiyun, etc.), continue?",
+ },
+ "ar": {
+ title: "SiYuan", slogan: "أعد هيكلة تفكيرك", workspace: "🗂️ مساحة العمل",
+ workspaceDesc: "تُستخدم مساحة العمل لتخزين البيانات، ويمكن تبديلها لاحقًا من القائمة الرئيسية في الزاوية العلوية اليسرى",
+ selectBtn: "تحديد", lang: "🌐 اللغة",
+ langDesc: "لغة واجهة المستخدم، يمكن تبديلها لاحقًا في <kbd>الإعدادات</kbd> - <kbd>المظهر</kbd>",
+ notice: "⚠️ لا تستخدم قرص مزامنة تابع لجهة خارجية لمزامنة البيانات، وإلا فقد يؤدي ذلك إلى تشغيل غير طبيعي وتلف البيانات",
+ feedback: "الدعم والملاحظات", community: "ملخص مجتمع المستخدمين", download: "تحميل",
+ feedbackUrl: "https://liuyun.io/article/1686530886208",
+ communityUrl: "https://liuyun.io/article/1687779743723",
+ downloadUrl: "https://b3log.org/siyuan/en/download.html",
+ msgPartitionRoot: "⚠️ لا تنشئ مساحة العمل في المسار الجذري للقسم، يرجى إنشاء مجلد جديد كمساحة عمل",
+ msgNotEmpty: "⚠️ يحتوي هذا المجلد على ملفات أخرى، يرجى إنشاء مجلد جديد كمساحة عمل",
+ msgICloud: "⚠️ هذا المجلد ضمن مسار مزامنة iCloud، يرجى تغيير مسار آخر",
+ msgCloudDrive: "⚠️ لا يمكن أن يحتوي مسار المجلد على onedrive أو dropbox أو google drive أو pcloud أو nutstore أو baidunetdisk أو weiyun وغيرها، يرجى تغيير مسار آخر",
+ msgConfirm: "⚠️ يرجى تأكيد عدم تعيين مساحة العمل ضمن مسار قرص مزامنة تابع لجهة خارجية، وإلا فقد يتسبب ذلك في تلف البيانات (iCloud/OneDrive/Dropbox/Google Drive/Nutstore/Baidu Netdisk/Tencent Weiyun وغيرها)، هل تريد المتابعة؟",
+ },
+ "de": {
+ title: "SiYuan", slogan: "Strukturiere dein Denken", workspace: "🗂️ Arbeitsbereich",
+ workspaceDesc: "Der Arbeitsbereich dient zum Speichern von Daten und kann später im Hauptmenü der oberen Leiste gewechselt werden",
+ selectBtn: "Auswählen", lang: "🌐 Sprache",
+ langDesc: "Sprache der Benutzeroberfläche, die später in <kbd>Einstellungen</kbd> - <kbd>Erscheinungsbild</kbd> gewechselt werden kann",
+ notice: "⚠️ Verwende keine Sync-Festplatte eines Drittanbieters zum Synchronisieren von Daten, da dies zu Fehlfunktionen und Datenverlust führen kann",
+ feedback: "Support und Feedback", community: "Zusammenfassung der Benutzergemeinschaft", download: "Herunterladen",
+ feedbackUrl: "https://liuyun.io/article/1686530886208",
+ communityUrl: "https://liuyun.io/article/1687779743723",
+ downloadUrl: "https://b3log.org/siyuan/en/download.html",
+ msgPartitionRoot: "⚠️ Erstellen Sie den Arbeitsbereich nicht im Stammverzeichnis der Partition, erstellen Sie bitte einen neuen Ordner als Arbeitsbereich",
+ msgNotEmpty: "⚠️ Dieser Ordner enthält andere Dateien, erstellen Sie bitte einen neuen Ordner als Arbeitsbereich",
+ msgICloud: "⚠️ Dieser Ordner befindet sich unter dem iCloud-Synchronisierungspfad, bitte einen anderen Pfad wählen",
+ msgCloudDrive: "⚠️ Der Ordnerpfad darf nicht onedrive, dropbox, google drive, pcloud, nutstore, baidunetdisk, weiyun usw. enthalten, bitte einen anderen Pfad wählen",
+ msgConfirm: "⚠️ Bitte bestätigen Sie, dass der Arbeitsbereich nicht unter dem Pfad einer Sync-Festplatte eines Drittanbieters eingerichtet ist, da dies zu Datenbeschädigung führen kann (iCloud/OneDrive/Dropbox/Google Drive/Nutstore/Baidu Netdisk/Tencent Weiyun usw.), fortfahren?",
+ },
+ "es": {
+ title: "SiYuan", slogan: "Reestructura tu pensamiento", workspace: "🗂️ Espacio de trabajo",
+ workspaceDesc: "El espacio de trabajo se utiliza para almacenar datos, que se pueden cambiar más tarde en el menú principal de la barra superior",
+ selectBtn: "Seleccionar", lang: "🌐 Idioma",
+ langDesc: "Idioma de la interfaz de usuario, que se puede cambiar más tarde en <kbd>Ajustes</kbd> - <kbd>Apariencia</kbd>",
+ notice: "⚠️ No utilice un disco de sincronización de terceros para sincronizar datos, de lo contrario puede causar un funcionamiento anormal y daño en los datos",
+ feedback: "Soporte y comentarios", community: "Resumen de la comunidad de usuarios", download: "Descargar",
+ feedbackUrl: "https://liuyun.io/article/1686530886208",
+ communityUrl: "https://liuyun.io/article/1687779743723",
+ downloadUrl: "https://b3log.org/siyuan/en/download.html",
+ msgPartitionRoot: "⚠️ No cree el espacio de trabajo en la ruta raíz de la partición, cree una nueva carpeta como espacio de trabajo",
+ msgNotEmpty: "⚠️ Esta carpeta contiene otros archivos, cree una nueva carpeta como espacio de trabajo",
+ msgICloud: "⚠️ Esta carpeta está bajo la ruta de sincronización de iCloud, cambie a otra ruta",
+ msgCloudDrive: "⚠️ La ruta de la carpeta no puede contener onedrive, dropbox, google drive, pcloud, nutstore, baidunetdisk, weiyun, etc., cambie a otra ruta",
+ msgConfirm: "⚠️ Confirme que el espacio de trabajo no está configurado bajo la ruta de un disco de sincronización de terceros, de lo contrario causará daños en los datos (iCloud/OneDrive/Dropbox/Google Drive/Nutstore/Baidu Netdisk/Tencent Weiyun, etc.), ¿continuar?",
+ },
+ "fr": {
+ title: "SiYuan", slogan: "Restructurez votre pensée", workspace: "🗂️ Espace de travail",
+ workspaceDesc: "L'espace de travail est utilisé pour stocker des données, il peut être changé plus tard dans le menu principal de la barre supérieure",
+ selectBtn: "Sélectionner", lang: "🌐 Langue",
+ langDesc: "Langue de l'interface utilisateur, pouvant être modifiée ultérieurement dans <kbd>Paramètres</kbd> - <kbd>Apparence</kbd>",
+ notice: "⚠️ N'utilisez pas un disque de synchronisation tiers pour synchroniser les données, sinon cela entraînera un fonctionnement anormal et des dommages aux données",
+ feedback: "Assistance et commentaires", community: "Résumé de la communauté d'utilisateurs", download: "Télécharger",
+ feedbackUrl: "https://liuyun.io/article/1686530886208",
+ communityUrl: "https://liuyun.io/article/1687779743723",
+ downloadUrl: "https://b3log.org/siyuan/en/download.html",
+ msgPartitionRoot: "⚠️ Ne créez pas l'espace de travail dans le chemin racine de la partition, veuillez créer un nouveau dossier comme espace de travail",
+ msgNotEmpty: "⚠️ Ce dossier contient d'autres fichiers, veuillez créer un nouveau dossier comme espace de travail",
+ msgICloud: "⚠️ Ce dossier se trouve sous le chemin de synchronisation iCloud, veuillez changer de chemin",
+ msgCloudDrive: "⚠️ Le chemin du dossier ne peut pas contenir onedrive, dropbox, google drive, pcloud, nutstore, baidunetdisk, weiyun, etc., veuillez changer de chemin",
+ msgConfirm: "⚠️ Veuillez confirmer que l'espace de travail n'est pas défini sous le chemin d'un disque de synchronisation tiers, sinon cela causera des dommages aux données (iCloud/OneDrive/Dropbox/Google Drive/Nutstore/Baidu Netdisk/Tencent Weiyun, etc.), continuer ?",
+ },
+ "he": {
+ title: "SiYuan", slogan: "ארגן מחדש את החשיבה שלך", workspace: "🗂️ סביבת עבודה",
+ workspaceDesc: "סביבת העבודה משמשת לאחסון נתונים, ניתן להחליף אותה מאוחר יותר בתפריט הראשי בסרגל העליון",
+ selectBtn: "בחירה", lang: "🌐 שפה",
+ langDesc: "שפת ממשק המשתמש, ניתן להחליף מאוחר יותר ב-<kbd>הגדרות</kbd> - <kbd>מראה</kbd>",
+ notice: "⚠️ אל תשתמש בדיסק סנכרון של צד שלישי לסנכרון נתונים, אחרת זה עלול לגרום לפעולה לא תקינה ולנזק לנתונים",
+ feedback: "תמיכה ומשוב", community: "סיכום קהילת המשתמשים", download: "הורדה",
+ feedbackUrl: "https://liuyun.io/article/1686530886208",
+ communityUrl: "https://liuyun.io/article/1687779743723",
+ downloadUrl: "https://b3log.org/siyuan/en/download.html",
+ msgPartitionRoot: "⚠️ אל תיצור את סביבת העבודה בנתיב השורש של המחיצה, נא ליצור תיקייה חדשה כסביבת עבודה",
+ msgNotEmpty: "⚠️ תיקייה זו מכילה קבצים אחרים, נא ליצור תיקייה חדשה כסביבת עבודה",
+ msgICloud: "⚠️ תיקייה זו נמצאת תחת נתיב סנכרון iCloud, נא לשנות נתיב אחר",
+ msgCloudDrive: "⚠️ נתיב התיקייה אינו יכול להכיל onedrive, dropbox, google drive, pcloud, nutstore, baidunetdisk, weiyun וכו', נא לשנות נתיב אחר",
+ msgConfirm: "⚠️ נא לאשר שסביבת העבודה אינה מוגדרת תחת נתיב של דיסק סנכרון של צד שלישי, אחרת זה יגרום לנזק לנתונים (iCloud/OneDrive/Dropbox/Google Drive/Nutstore/Baidu Netdisk/Tencent Weiyun וכו'), להמשיך?",
+ },
+ "hi": {
+ title: "SiYuan", slogan: "अपनी सोच को पुनर्गठित करें", workspace: "🗂️ वर्कस्पेस",
+ workspaceDesc: "वर्कस्पेस का उपयोग डेटा संग्रहीत करने के लिए किया जाता है, जिसे बाद में शीर्ष बार मेन्यू में बदला जा सकता है",
+ selectBtn: "चुनें", lang: "🌐 भाषा",
+ langDesc: "उपयोगकर्ता इंटरफ़ेस भाषा, जिसे बाद में <kbd>सेटिंग्स</kbd> - <kbd>रूप</kbd> में बदला जा सकता है",
+ notice: "⚠️ डेटा को सिंक करने के लिए तृतीय-पक्ष सिंक डिस्क का उपयोग न करें, अन्यथा यह असामान्य संचालन और डेटा क्षति का कारण बनेगा",
+ feedback: "सहायता और प्रतिक्रिया", community: "उपयोगकर्ता समुदाय सारांश", download: "डाउनलोड",
+ feedbackUrl: "https://liuyun.io/article/1686530886208",
+ communityUrl: "https://liuyun.io/article/1687779743723",
+ downloadUrl: "https://b3log.org/siyuan/en/download.html",
+ msgPartitionRoot: "⚠️ वर्कस्पेस को पार्टीशन रूट पथ में न बनाएं, कृपया वर्कस्पेस के रूप में एक नया फ़ोल्डर बनाएं",
+ msgNotEmpty: "⚠️ इस फ़ोल्डर में अन्य फ़ाइलें हैं, कृपया वर्कस्पेस के रूप में एक नया फ़ोल्डर बनाएं",
+ msgICloud: "⚠️ यह फ़ोल्डर iCloud सिंक पथ के अंतर्गत है, कृपया कोई अन्य पथ बदलें",
+ msgCloudDrive: "⚠️ फ़ोल्डर पथ में onedrive, dropbox, google drive, pcloud, nutstore, baidunetdisk, weiyun आदि नहीं हो सकते, कृपया कोई अन्य पथ बदलें",
+ msgConfirm: "⚠️ कृपया पुष्टि करें कि वर्कस्पेस किसी तृतीय-पक्ष सिंक डिस्क के पथ के अंतर्गत सेट नहीं है, अन्यथा यह डेटा क्षति का कारण बनेगा (iCloud/OneDrive/Dropbox/Google Drive/Nutstore/Baidu Netdisk/Tencent Weiyun आदि), जारी रखें?",
+ },
+ "id": {
+ title: "SiYuan", slogan: "Restruktur pemikiran Anda", workspace: "🗂️ Ruang Kerja",
+ workspaceDesc: "Ruang kerja digunakan untuk menyimpan data, yang dapat dialihkan nanti di menu bilah atas",
+ selectBtn: "Pilih", lang: "🌐 Bahasa",
+ langDesc: "Bahasa antarmuka pengguna, yang dapat dialihkan nanti di <kbd>Pengaturan</kbd> - <kbd>Tampilan</kbd>",
+ notice: "⚠️ Jangan gunakan disk sinkronisasi pihak ketiga untuk menyinkronkan data, jika tidak akan menyebabkan operasi abnormal dan kerusakan data",
+ feedback: "Dukungan dan Umpan Balik", community: "Ringkasan komunitas pengguna", download: "Unduh",
+ feedbackUrl: "https://liuyun.io/article/1686530886208",
+ communityUrl: "https://liuyun.io/article/1687779743723",
+ downloadUrl: "https://b3log.org/siyuan/en/download.html",
+ msgPartitionRoot: "⚠️ Jangan membuat ruang kerja di jalur root partisi, silakan buat folder baru sebagai ruang kerja",
+ msgNotEmpty: "⚠️ Folder ini berisi file lain, silakan buat folder baru sebagai ruang kerja",
+ msgICloud: "⚠️ Folder ini berada di bawah jalur sinkronisasi iCloud, silakan ganti jalur lain",
+ msgCloudDrive: "⚠️ Jalur folder tidak boleh berisi onedrive, dropbox, google drive, pcloud, nutstore, baidunetdisk, weiyun, dll., silakan ganti jalur lain",
+ msgConfirm: "⚠️ Harap konfirmasi bahwa ruang kerja tidak diatur di bawah jalur disk sinkronisasi pihak ketiga, jika tidak itu akan menyebabkan kerusakan data (iCloud/OneDrive/Dropbox/Google Drive/Nutstore/Baidu Netdisk/Tencent Weiyun, dll.), lanjutkan?",
+ },
+ "it": {
+ title: "SiYuan", slogan: "Ristruttura il tuo pensiero", workspace: "🗂️ Spazio di lavoro",
+ workspaceDesc: "Lo spazio di lavoro viene utilizzato per memorizzare i dati, che può essere cambiato successivamente nel menu principale della barra superiore",
+ selectBtn: "Seleziona", lang: "🌐 Lingua",
+ langDesc: "Lingua dell'interfaccia utente, che può essere cambiata successivamente in <kbd>Impostazioni</kbd> - <kbd>Aspetto</kbd>",
+ notice: "⚠️ Non utilizzare un disco di sincronizzazione di terze parti per sincronizzare i dati, altrimenti causerà malfunzionamenti e danni ai dati",
+ feedback: "Supporto e feedback", community: "Riepilogo della community degli utenti", download: "Scarica",
+ feedbackUrl: "https://liuyun.io/article/1686530886208",
+ communityUrl: "https://liuyun.io/article/1687779743723",
+ downloadUrl: "https://b3log.org/siyuan/en/download.html",
+ msgPartitionRoot: "⚠️ Non creare lo spazio di lavoro nel percorso root della partizione, crea una nuova cartella come spazio di lavoro",
+ msgNotEmpty: "⚠️ Questa cartella contiene altri file, crea una nuova cartella come spazio di lavoro",
+ msgICloud: "⚠️ Questa cartella si trova nel percorso di sincronizzazione iCloud, si prega di cambiare un altro percorso",
+ msgCloudDrive: "⚠️ Il percorso della cartella non può contenere onedrive, dropbox, google drive, pcloud, nutstore, baidunetdisk, weiyun, ecc., si prega di cambiare un altro percorso",
+ msgConfirm: "⚠️ Si prega di confermare che lo spazio di lavoro non è impostato nel percorso di un disco di sincronizzazione di terze parti, altrimenti causerà danni ai dati (iCloud/OneDrive/Dropbox/Google Drive/Nutstore/Baidu Netdisk/Tencent Weiyun, ecc.), continuare?",
+ },
+ "ja": {
+ title: "SiYuan", slogan: "思考を再構築する", workspace: "🗂️ ワークスペース",
+ workspaceDesc: "ワークスペースはデータの保存に使用されます。後でトップバーのメインメニューで切り替えることができます",
+ selectBtn: "選択", lang: "🌐 言語",
+ langDesc: "ユーザーインターフェースの言語です。後で<kbd>設定</kbd> - <kbd>外観</kbd>で切り替えることができます",
+ notice: "⚠️ サードパーティの同期ディスクを使用してデータを同期しないでください。そうしないと、異常な動作やデータの破損が発生する可能性があります",
+ feedback: "サポートとフィードバック", community: "ユーザーコミュニティの概要", download: "ダウンロード",
+ feedbackUrl: "https://liuyun.io/article/1686530886208",
+ communityUrl: "https://liuyun.io/article/1687779743723",
+ downloadUrl: "https://b3log.org/siyuan/en/download.html",
+ msgPartitionRoot: "⚠️ パーティションのルートパスにワークスペースを作成しないでください。ワークスペースとして新しいフォルダを作成してください",
+ msgNotEmpty: "⚠️ このフォルダには他のファイルが含まれています。ワークスペースとして新しいフォルダを作成してください",
+ msgICloud: "⚠️ このフォルダはiCloud同期パスの下にあります。別のパスに変更してください",
+ msgCloudDrive: "⚠️ フォルダパスにonedrive、dropbox、google drive、pcloud、nutstore、baidunetdisk、weiyunなどは含められません。別のパスに変更してください",
+ msgConfirm: "⚠️ ワークスペースがサードパーティの同期ディスクのパスの下に設定されていないことを確認してください。そうでないとデータの破損が発生する可能性があります(iCloud/OneDrive/Dropbox/Google Drive/Nutstore/Baidu Netdisk/Tencent Weiyunなど)。続行しますか?",
+ },
+ "ko": {
+ title: "SiYuan", slogan: "당신의 사고를 재구성하세요", workspace: "🗂️ 워크스페이스",
+ workspaceDesc: "워크스페이스는 데이터를 저장하는 데 사용되며, 나중에 상단 표시줄 메뉴에서 전환할 수 있습니다",
+ selectBtn: "선택", lang: "🌐 언어",
+ langDesc: "사용자 인터페이스 언어이며, 나중에 <kbd>설정</kbd> - <kbd>외관</kbd>에서 전환할 수 있습니다",
+ notice: "⚠️ 타사 동기화 디스크를 사용하여 데이터를 동기화하지 마세요. 그렇지 않으면 비정상적인 작동과 데이터 손상이 발생할 수 있습니다",
+ feedback: "지원 및 피드백", community: "사용자 커뮤니티 요약", download: "다운로드",
+ feedbackUrl: "https://liuyun.io/article/1686530886208",
+ communityUrl: "https://liuyun.io/article/1687779743723",
+ downloadUrl: "https://b3log.org/siyuan/en/download.html",
+ msgPartitionRoot: "⚠️ 파티션 루트 경로에 워크스페이스를 만들지 마세요. 워크스페이스로 새 폴더를 만드세요",
+ msgNotEmpty: "⚠️ 이 폴더에는 다른 파일이 포함되어 있습니다. 워크스페이스로 새 폴더를 만드세요",
+ msgICloud: "⚠️ 이 폴더는 iCloud 동기화 경로 아래에 있습니다. 다른 경로로 변경하세요",
+ msgCloudDrive: "⚠️ 폴더 경로에 onedrive, dropbox, google drive, pcloud, nutstore, baidunetdisk, weiyun 등이 포함될 수 없습니다. 다른 경로로 변경하세요",
+ msgConfirm: "⚠️ 워크스페이스가 타사 동기화 디스크 경로 아래에 설정되지 않았는지 확인하세요. 그렇지 않으면 데이터 손상이 발생합니다(iCloud/OneDrive/Dropbox/Google Drive/Nutstore/Baidu Netdisk/Tencent Weiyun 등). 계속하시겠습니까?",
+ },
+ "nl": {
+ title: "SiYuan", slogan: "Herstructureer je denken", workspace: "🗂️ Werkruimte",
+ workspaceDesc: "De werkruimte wordt gebruikt om gegevens op te slaan, die later kan worden gewisseld in het hoofdmenu van de bovenste balk",
+ selectBtn: "Selecteren", lang: "🌐 Taal",
+ langDesc: "Taal van de gebruikersinterface, die later kan worden gewisseld in <kbd>Instellingen</kbd> - <kbd>Weergave</kbd>",
+ notice: "⚠️ Gebruik geen synchronisatieschijf van derden om gegevens te synchroniseren, anders leidt dit tot abnormale werking en gegevensbeschadiging",
+ feedback: "Ondersteuning en feedback", community: "Overzicht van gebruikersgemeenschap", download: "Downloaden",
+ feedbackUrl: "https://liuyun.io/article/1686530886208",
+ communityUrl: "https://liuyun.io/article/1687779743723",
+ downloadUrl: "https://b3log.org/siyuan/en/download.html",
+ msgPartitionRoot: "⚠️ Maak de werkruimte niet in het hoofdpad van de partitie, maak een nieuwe map als werkruimte",
+ msgNotEmpty: "⚠️ Deze map bevat andere bestanden, maak een nieuwe map als werkruimte",
+ msgICloud: "⚠️ Deze map bevindt zich onder het iCloud-synchronisatiepad, wijzig een ander pad",
+ msgCloudDrive: "⚠️ Het mappad kan geen onedrive, dropbox, google drive, pcloud, nutstore, baidunetdisk, weiyun, etc. bevatten, wijzig een ander pad",
+ msgConfirm: "⚠️ Bevestig dat de werkruimte niet is ingesteld onder het pad van een synchronisatieschijf van derden, anders veroorzaakt dit gegevensbeschadiging (iCloud/OneDrive/Dropbox/Google Drive/Nutstore/Baidu Netdisk/Tencent Weiyun, etc.), doorgaan?",
+ },
+ "pl": {
+ title: "SiYuan", slogan: "Zrestrukturyzuj swoje myślenie", workspace: "🗂️ Obszar roboczy",
+ workspaceDesc: "Obszar roboczy służy do przechowywania danych, które można później przełączyć w głównym menu górnego paska",
+ selectBtn: "Wybierz", lang: "🌐 Język",
+ langDesc: "Język interfejsu użytkownika, który można później przełączyć w <kbd>Ustawieniach</kbd> - <kbd>Wygląd</kbd>",
+ notice: "⚠️ Nie używaj dysku synchronizacji innej firmy do synchronizacji danych, w przeciwnym razie doprowadzi to do nieprawidłowego działania i uszkodzenia danych",
+ feedback: "Wsparcie i opinie", community: "Podsumowanie społeczności użytkowników", download: "Pobierz",
+ feedbackUrl: "https://liuyun.io/article/1686530886208",
+ communityUrl: "https://liuyun.io/article/1687779743723",
+ downloadUrl: "https://b3log.org/siyuan/en/download.html",
+ msgPartitionRoot: "⚠️ Nie twórz obszaru roboczego w ścieżce głównej partycji, utwórz nowy folder jako obszar roboczy",
+ msgNotEmpty: "⚠️ Ten folder zawiera inne pliki, utwórz nowy folder jako obszar roboczy",
+ msgICloud: "⚠️ Ten folder znajduje się w ścieżce synchronizacji iCloud, zmień inną ścieżkę",
+ msgCloudDrive: "⚠️ Ścieżka folderu nie może zawierać onedrive, dropbox, google drive, pcloud, nutstore, baidunetdisk, weiyun itd., zmień inną ścieżkę",
+ msgConfirm: "⚠️ Potwierdź, że obszar roboczy nie jest ustawiony w ścieżce dysku synchronizacji innej firmy, w przeciwnym razie spowoduje to uszkodzenie danych (iCloud/OneDrive/Dropbox/Google Drive/Nutstore/Baidu Netdisk/Tencent Weiyun itd.), kontynuować?",
+ },
+ "pt-BR": {
+ title: "SiYuan", slogan: "Restruture seu pensamento", workspace: "🗂️ Espaço de trabalho",
+ workspaceDesc: "O espaço de trabalho é usado para armazenar dados, que pode ser alterado posteriormente no menu principal da barra superior",
+ selectBtn: "Selecionar", lang: "🌐 Idioma",
+ langDesc: "Idioma da interface do usuário, que pode ser alterado posteriormente em <kbd>Configurações</kbd> - <kbd>Aparência</kbd>",
+ notice: "⚠️ Não use um disco de sincronização de terceiros para sincronizar dados, caso contrário, causará operação anormal e danos aos dados",
+ feedback: "Suporte e Feedback", community: "Resumo da comunidade de usuários", download: "Baixar",
+ feedbackUrl: "https://liuyun.io/article/1686530886208",
+ communityUrl: "https://liuyun.io/article/1687779743723",
+ downloadUrl: "https://b3log.org/siyuan/en/download.html",
+ msgPartitionRoot: "⚠️ Não crie o espaço de trabalho no caminho raiz da partição, crie uma nova pasta como espaço de trabalho",
+ msgNotEmpty: "⚠️ Esta pasta contém outros arquivos, crie uma nova pasta como espaço de trabalho",
+ msgICloud: "⚠️ Esta pasta está sob o caminho de sincronização do iCloud, altere para outro caminho",
+ msgCloudDrive: "⚠️ O caminho da pasta não pode conter onedrive, dropbox, google drive, pcloud, nutstore, baidunetdisk, weiyun, etc., altere para outro caminho",
+ msgConfirm: "⚠️ Confirme que o espaço de trabalho não está definido sob o caminho de um disco de sincronização de terceiros, caso contrário causará danos aos dados (iCloud/OneDrive/Dropbox/Google Drive/Nutstore/Baidu Netdisk/Tencent Weiyun, etc.), continuar?",
+ },
+ "ru": {
+ title: "SiYuan", slogan: "Реструктурируйте своё мышление", workspace: "🗂️ Рабочее пространство",
+ workspaceDesc: "Рабочее пространство используется для хранения данных, его можно переключить позже в главном меню верхней панели",
+ selectBtn: "Выбрать", lang: "🌐 Язык",
+ langDesc: "Язык интерфейса пользователя, который можно переключить позже в <kbd>Настройках</kbd> - <kbd>Внешний вид</kbd>",
+ notice: "⚠️ Не используйте сторонний диск синхронизации для синхронизации данных, иначе это приведёт к неправильной работе и повреждению данных",
+ feedback: "Поддержка и обратная связь", community: "Сводка сообщества пользователей", download: "Скачать",
+ feedbackUrl: "https://liuyun.io/article/1686530886208",
+ communityUrl: "https://liuyun.io/article/1687779743723",
+ downloadUrl: "https://b3log.org/siyuan/en/download.html",
+ msgPartitionRoot: "⚠️ Не создавайте рабочее пространство в корневом пути раздела, создайте новую папку в качестве рабочего пространства",
+ msgNotEmpty: "⚠️ Эта папка содержит другие файлы, создайте новую папку в качестве рабочего пространства",
+ msgICloud: "⚠️ Эта папка находится по пути синхронизации iCloud, измените другой путь",
+ msgCloudDrive: "⚠️ Путь к папке не может содержать onedrive, dropbox, google drive, pcloud, nutstore, baidunetdisk, weiyun и т. д., измените другой путь",
+ msgConfirm: "⚠️ Подтвердите, что рабочее пространство не настроено по пути стороннего диска синхронизации, иначе это приведёт к повреждению данных (iCloud/OneDrive/Dropbox/Google Drive/Nutstore/Baidu Netdisk/Tencent Weiyun и т. д.), продолжить?",
+ },
+ "sk": {
+ title: "SiYuan", slogan: "Reštrukturalizujte svoje myslenie", workspace: "🗂️ Pracovný priestor",
+ workspaceDesc: "Pracovný priestor sa používa na ukladanie údajov, ktoré sa dá neskôr prepnúť v hlavnej ponuke hornej lišty",
+ selectBtn: "Vybrať", lang: "🌐 Jazyk",
+ langDesc: "Jazyk používateľského rozhrania, ktorý možno neskôr prepnúť v <kbd>Nastaveniach</kbd> - <kbd>Vzhľad</kbd>",
+ notice: "⚠️ Nepoužívajte synchronizačný disk tretej strany na synchronizáciu údajov, inak to spôsobí abnormálnu prevádzku a poškodenie údajov",
+ feedback: "Podpora a spätná väzba", community: "Súhrn komunity používateľov", download: "Stiahnuť",
+ feedbackUrl: "https://liuyun.io/article/1686530886208",
+ communityUrl: "https://liuyun.io/article/1687779743723",
+ downloadUrl: "https://b3log.org/siyuan/en/download.html",
+ msgPartitionRoot: "⚠️ Nevytvárajte pracovný priestor v koreňovej ceste oddielu, vytvorte nový priečinok ako pracovný priestor",
+ msgNotEmpty: "⚠️ Tento priečinok obsahuje iné súbory, vytvorte nový priečinok ako pracovný priestor",
+ msgICloud: "⚠️ Tento priečinok je pod cestou synchronizácie iCloud, zmeňte inú cestu",
+ msgCloudDrive: "⚠️ Cesta k priečinku nemôže obsahovať onedrive, dropbox, google drive, pcloud, nutstore, baidunetdisk, weiyun atď., zmeňte inú cestu",
+ msgConfirm: "⚠️ Potvrďte, že pracovný priestor nie je nastavený pod cestou synchronizačného disku tretej strany, inak to spôsobí poškodenie údajov (iCloud/OneDrive/Dropbox/Google Drive/Nutstore/Baidu Netdisk/Tencent Weiyun atď.), pokračovať?",
+ },
+ "th": {
+ title: "SiYuan", slogan: "ปรับโครงสร้างความคิดของคุณ", workspace: "🗂️ พื้นที่ทำงาน",
+ workspaceDesc: "พื้นที่ทำงานใช้สำหรับจัดเก็บข้อมูล ซึ่งสามารถสลับได้ในภายหลังในเมนูหลักของแถบด้านบน",
+ selectBtn: "เลือก", lang: "🌐 ภาษา",
+ langDesc: "ภาษาของอินเทอร์เฟซผู้ใช้ ซึ่งสามารถสลับได้ในภายหลังใน <kbd>การตั้งค่า</kbd> - <kbd>ลักษณะ</kbd>",
+ notice: "⚠️ อย่าใช้ดิสก์ซิงค์ของบุคคลที่สามในการซิงค์ข้อมูล มิฉะนั้นจะทำให้การทำงานผิดปกติและข้อมูลเสียหาย",
+ feedback: "การสนับสนุนและข้อเสนอแนะ", community: "สรุปชุมชนผู้ใช้", download: "ดาวน์โหลด",
+ feedbackUrl: "https://liuyun.io/article/1686530886208",
+ communityUrl: "https://liuyun.io/article/1687779743723",
+ downloadUrl: "https://b3log.org/siyuan/en/download.html",
+ msgPartitionRoot: "⚠️ อย่าสร้างพื้นที่ทำงานในเส้นทางรูทของพาร์ติชัน โปรดสร้างโฟลเดอร์ใหม่เป็นพื้นที่ทำงาน",
+ msgNotEmpty: "⚠️ โฟลเดอร์นี้มีไฟล์อื่น ๆ โปรดสร้างโฟลเดอร์ใหม่เป็นพื้นที่ทำงาน",
+ msgICloud: "⚠️ โฟลเดอร์นี้อยู่ภายใต้เส้นทางซิงค์ iCloud โปรดเปลี่ยนเส้นทางอื่น",
+ msgCloudDrive: "⚠️ เส้นทางโฟลเดอร์ไม่สามารถมี onedrive, dropbox, google drive, pcloud, nutstore, baidunetdisk, weiyun ฯลฯ ได้ โปรดเปลี่ยนเส้นทางอื่น",
+ msgConfirm: "⚠️ โปรดยืนยันว่าพื้นที่ทำงานไม่ได้ตั้งไว้ภายใต้เส้นทางของดิสก์ซิงค์ของบุคคลที่สาม มิฉะนั้นจะทำให้ข้อมูลเสียหาย (iCloud/OneDrive/Dropbox/Google Drive/Nutstore/Baidu Netdisk/Tencent Weiyun ฯลฯ) ดำเนินการต่อ?",
+ },
+ "tr": {
+ title: "SiYuan", slogan: "Düşüncenizi yeniden yapılandırın", workspace: "🗂️ Çalışma alanı",
+ workspaceDesc: "Çalışma alanı verileri depolamak için kullanılır, daha sonra üst çubuk menüsünde değiştirilebilir",
+ selectBtn: "Seç", lang: "🌐 Dil",
+ langDesc: "Kullanıcı arayüzü dili, daha sonra <kbd>Ayarlar</kbd> - <kbd>Görünüm</kbd> bölümünde değiştirilebilir",
+ notice: "⚠️ Verileri senkronize etmek için üçüncü taraf bir senkronizasyon diski kullanmayın, aksi takdirde anormal çalışmaya ve veri hasarına neden olur",
+ feedback: "Destek ve Geri Bildirim", community: "Kullanıcı topluluğu özeti", download: "İndir",
+ feedbackUrl: "https://liuyun.io/article/1686530886208",
+ communityUrl: "https://liuyun.io/article/1687779743723",
+ downloadUrl: "https://b3log.org/siyuan/en/download.html",
+ msgPartitionRoot: "⚠️ Çalışma alanını bölüm kök yolunda oluşturmayın, çalışma alanı olarak yeni bir klasör oluşturun",
+ msgNotEmpty: "⚠️ Bu klasör başka dosyalar içeriyor, çalışma alanı olarak yeni bir klasör oluşturun",
+ msgICloud: "⚠️ Bu klasör iCloud eşzamanlama yolunun altında, lütfen başka bir yol değiştirin",
+ msgCloudDrive: "⚠️ Klasör yolu onedrive, dropbox, google drive, pcloud, nutstore, baidunetdisk, weiyun vb. içeremez, lütfen başka bir yol değiştirin",
+ msgConfirm: "⚠️ Çalışma alanının üçüncü taraf eşzamanlama diskinin yolu altında ayarlanmadığını onaylayın, aksi takdirde veri hasarına neden olur (iCloud/OneDrive/Dropbox/Google Drive/Nutstore/Baidu Netdisk/Tencent Weiyun vb.), devam edilsin mi?",
+ },
+ "uk": {
+ title: "SiYuan", slogan: "Реструктуруйте своє мислення", workspace: "🗂️ Робочий простір",
+ workspaceDesc: "Робочий простір використовується для зберігання даних, який пізніше можна змінити в головному меню верхньої панелі",
+ selectBtn: "Вибрати", lang: "🌐 Мова",
+ langDesc: "Мова інтерфейсу користувача, яку пізніше можна змінити в <kbd>Налаштуваннях</kbd> - <kbd>Вигляд</kbd>",
+ notice: "⚠️ Не використовуйте сторонній диск синхронізації для синхронізації даних, інакше це призведе до ненормальної роботи та пошкодження даних",
+ feedback: "Підтримка та зворотний зв'язок", community: "Огляд спільноти користувачів", download: "Завантажити",
+ feedbackUrl: "https://liuyun.io/article/1686530886208",
+ communityUrl: "https://liuyun.io/article/1687779743723",
+ downloadUrl: "https://b3log.org/siyuan/en/download.html",
+ msgPartitionRoot: "⚠️ Не створюйте робочий простір у кореневому шляху розділу, створіть нову папку як робочий простір",
+ msgNotEmpty: "⚠️ Ця папка містить інші файли, створіть нову папку як робочий простір",
+ msgICloud: "⚠️ Ця папка знаходиться під шляхом синхронізації iCloud, змініть інший шлях",
+ msgCloudDrive: "⚠️ Шлях до папки не може містити onedrive, dropbox, google drive, pcloud, nutstore, baidunetdisk, weiyun тощо, змініть інший шлях",
+ msgConfirm: "⚠️ Підтвердьте, що робочий простір не налаштований під шляхом стороннього диска синхронізації, інакше це спричинить пошкодження даних (iCloud/OneDrive/Dropbox/Google Drive/Nutstore/Baidu Netdisk/Tencent Weiyun тощо), продовжити?",
+ },
+ }
+
let currentLang = decodeURIComponent(getSearch('lang'))
- const setLang = (lang) => {
- if (isChinese(lang)) {
- document.title = `思源笔记 v${getSearch('v')}`
- document.getElementById('zhCN').classList.remove('fn__none')
- document.getElementById('enUS').classList.add('fn__none')
- } else {
- document.title = `SiYuan v${getSearch('v')}`
- document.getElementById('zhCN').classList.add('fn__none')
- document.getElementById('enUS').classList.remove('fn__none')
- }
+
+ // 应用指定语言的文案到 DOM
+ const applyLang = (lang) => {
+ const langData = I18N[lang] || I18N["en"]
+ document.title = `${langData.title} v${getSearch('v')}`
+ document.querySelectorAll('[data-i18n]').forEach(item => {
+ const key = item.getAttribute('data-i18n')
+ if (langData[key]) {
+ item.textContent = langData[key]
+ }
+ })
+ document.querySelectorAll('[data-i18n-html]').forEach(item => {
+ const key = item.getAttribute('data-i18n-html')
+ if (langData[key]) {
+ item.innerHTML = langData[key]
+ }
+ })
+ document.querySelectorAll('[data-i18n-href]').forEach(item => {
+ const key = item.getAttribute('data-i18n-href')
+ if (langData[key]) {
+ item.href = langData[key]
+ }
+ })
currentLang = lang
}
- setLang(currentLang)
-
- document.querySelectorAll('.version').forEach(item => {
- item.textContent = `v${getSearch('v')}`
- })
+ applyLang(currentLang)
- document.querySelectorAll('.icon').forEach(item => {
- item.src = decodeURIComponent(`${getSearch('icon')}`)
- })
+ document.querySelector('.version').textContent = `v${getSearch('v')}`
+ document.querySelector('.icon').src = decodeURIComponent(`${getSearch('icon')}`)
- document.querySelectorAll('.lang').forEach(item => {
- item.value = currentLang
- item.addEventListener('change', () => {
- document.querySelectorAll('.lang').forEach(item1 => {
- item1.value = item.value
- })
- setLang(item.value)
- })
+ document.querySelector('.lang').value = currentLang
+ document.querySelector('.lang').addEventListener('change', (event) => {
+ applyLang(event.target.value)
})
if (process.platform === 'darwin') {
@@ -452,86 +733,64 @@
ipcRenderer.send("siyuan-cmd", "minimize");
})
- document.querySelectorAll('.choosePath').forEach((item) => {
- item.addEventListener('click', async () => {
- const path = require('path')
- const fs = require('fs')
+ document.querySelector('.choosePath').addEventListener('click', async () => {
+ const langData = I18N[currentLang] || I18N["en"]
+ const path = require('path')
+ const fs = require('fs')
- let defaultWorkspace = path.join(decodeURIComponent(getSearch('home')), "SiYuan")
- if ("darwin" === process.platform) {
- // Change the initial workspace path to ~/Library/Application Support/SiYuan on macOS https://github.com/siyuan-note/siyuan/issues/17095
- defaultWorkspace = path.join(decodeURIComponent(getSearch('home')), "Library", "Application Support", "SiYuan")
- }
- if (!fs.existsSync(defaultWorkspace)) {
- fs.mkdirSync(defaultWorkspace, {mode: 0o755, recursive: true})
- }
+ let defaultWorkspace = path.join(decodeURIComponent(getSearch('home')), "SiYuan")
+ if ("darwin" === process.platform) {
+ // Change the initial workspace path to ~/Library/Application Support/SiYuan on macOS https://github.com/siyuan-note/siyuan/issues/17095
+ defaultWorkspace = path.join(decodeURIComponent(getSearch('home')), "Library", "Application Support", "SiYuan")
+ }
+ if (!fs.existsSync(defaultWorkspace)) {
+ fs.mkdirSync(defaultWorkspace, {mode: 0o755, recursive: true})
+ }
- const {ipcRenderer} = require('electron')
- const result = await ipcRenderer.invoke("siyuan-get", {
- cmd: "showOpenDialog",
- defaultPath: defaultWorkspace,
- properties: ['openDirectory', 'createDirectory'],
- });
+ const {ipcRenderer} = require('electron')
+ const result = await ipcRenderer.invoke("siyuan-get", {
+ cmd: "showOpenDialog",
+ defaultPath: defaultWorkspace,
+ properties: ['openDirectory', 'createDirectory'],
+ });
- if (result.canceled) {
- return
- }
- const initPath = result.filePaths[0]
+ if (result.canceled) {
+ return
+ }
+ const initPath = result.filePaths[0]
- if (isPartitionRootPath(initPath)) {
- let msg = '⚠️ Do not create the workspace in the partition root path, please create a new folder as the workspace'
- if (isChinese(currentLang)) {
- msg = '⚠️ 请勿在分区根路径上创建工作空间,请新建一个文件夹作为工作空间'
- }
- alert(msg)
- return
- }
+ if (isPartitionRootPath(initPath)) {
+ alert(langData.msgPartitionRoot)
+ return
+ }
- if (!isWorkspaceDir(initPath) && !isEmptyDir(initPath)) {
- let msg = '⚠️ This folder contains other files, please create a new folder as the workspace'
- if (isChinese(currentLang)) {
- msg = '⚠️ 该文件夹包含了其他文件,请新建一个文件夹作为工作空间'
- }
- alert(msg)
- return
- }
+ if (!isWorkspaceDir(initPath) && !isEmptyDir(initPath)) {
+ alert(langData.msgNotEmpty)
+ return
+ }
- if (isICloudPath(initPath)) {
- let msg = '⚠️ This folder is under the iCloud sync path, please change another path'
- if (isChinese(currentLang)) {
- msg = '⚠️ 该文件夹位于 iCloud 同步路径下,请更换其他路径'
- }
- alert(msg)
- return
- }
+ if (isICloudPath(initPath)) {
+ alert(langData.msgICloud)
+ return
+ }
- if (isCloudDrivePath(initPath)) {
- let msg = '⚠️ The folder path can not contain onedrive, dropbox, google drive, pcloud, nutstore, baidunetdisk, weiyun,坚果云,百度网盘 and 腾讯微云, etc., please change another path'
- if (isChinese(currentLang)) {
- msg = '⚠️ 文件夹路径不能包含 onedrive、dropbox、google drive、pcloud、nutstore、baidunetdisk、weiyun、坚果云、百度网盘和腾讯微云等字样,请更换其他路径'
- }
- alert(msg)
- return
- }
- let msg = '⚠️ Please confirm that the workspace is not set under the path of a third-party sync disk, otherwise it will cause data damage (iCloud/OneDrive/Dropbox/Google Drive/Nutstore/Baidu Netdisk/Tencent Weiyun, etc.), continue?'
- if (isChinese(currentLang)) {
- msg = '⚠️ 请确认没有将工作空间设置在第三方同步盘路径下,否则会造成数据损坏(iCloud/OneDrive/Dropbox/Google Drive/坚果云/百度网盘/腾讯微云等),是否继续?'
- }
- if (!confirm(msg)) {
- return
- }
- if (!fs.existsSync(initPath)) {
- fs.mkdirSync(initPath, {mode: 0o755, recursive: true})
- }
- ipcRenderer.send('siyuan-first-init', {
- workspace: initPath,
- lang: document.querySelector('.lang').value
- })
+ if (isCloudDrivePath(initPath)) {
+ alert(langData.msgCloudDrive)
+ return
+ }
+ if (!confirm(langData.msgConfirm)) {
+ return
+ }
+ if (!fs.existsSync(initPath)) {
+ fs.mkdirSync(initPath, {mode: 0o755, recursive: true})
+ }
+ ipcRenderer.send('siyuan-first-init', {
+ workspace: initPath,
+ lang: document.querySelector('.lang').value
})
})
const isPartitionRootPath = (absPath) => {
- const path = require('path')
const parsedPath = path.parse(absPath)
return parsedPath.root === absPath
}
@@ -548,8 +807,6 @@
}
const isWorkspaceDir = (absPath) => {
- const path = require('path');
- const fs = require('fs');
const conf = path.join(absPath, 'conf', 'conf.json');
let data;
try {
@@ -576,7 +833,6 @@
}
// macOS 端对工作空间放置在 iCloud 路径下做检查 https://github.com/siyuan-note/siyuan/issues/7747
- const path = require('path')
const homePath = decodeURIComponent(getSearch('home'))
const absPathLower = absPath.toLowerCase()
const iCloudRoot = path.join(homePath, 'Library', 'Mobile Documents')
@@ -601,7 +857,6 @@
return false
}
- const path = require('path')
const absPathLower = absPath.toLowerCase()
const iCloudRoot = path.join(homePath, 'Library', 'Mobile Documents')
if (absPathLower.startsWith(iCloudRoot.toLowerCase())) {
@@ -634,7 +889,6 @@
return files
}
- const path = require('path')
for (const f of dirFiles) {
let stat = fs.lstatSync(dir + path.sep + f)
if (stat.isSymbolicLink()) {