🐛 Improve importing .sy.zip https://github.com/siyuan-note/siyuan/issues/12825
This commit is contained in:
parent
5efce9b33e
commit
5c274f5c79
12 changed files with 17 additions and 12 deletions
|
@ -1380,7 +1380,7 @@
|
|||
"70": "Verarbeite [%s], bitte warten...",
|
||||
"71": "Fehler beim Einfügen der Asset-Datei, bitte Dokument erneut öffnen",
|
||||
"72": "Inhalt wurde in die Systemzwischenablage kopiert, bitte gehen Sie zu SiYuan, um einzufügen",
|
||||
"73": "Importieren, bitte warten...",
|
||||
"73": "Daten werden importiert...",
|
||||
"74": "Der Kernel ist nicht vollständig gestartet [%d%%], bitte versuchen Sie es später erneut",
|
||||
"75": "Zugriff auf die Datei fehlgeschlagen",
|
||||
"76": "Die Netzwerkverbindungsprüfung des Cloud-Speicherdienstanbieters ist abnormal, bitte überprüfen Sie die Netzwerkkonfiguration",
|
||||
|
|
|
@ -1380,7 +1380,7 @@
|
|||
"70": "Processing [%s], please wait...",
|
||||
"71": "Failed to insert asset file, please reopen the document",
|
||||
"72": "Content has been copied to the system clipboard, please go to SiYuan to paste",
|
||||
"73": "Importing, please wait...",
|
||||
"73": "Importing data...",
|
||||
"74": "The kernel has not been fully booted [%d%%], please try again later",
|
||||
"75": "Attempt to access file failed",
|
||||
"76": "The network connectivity verification of the cloud storage service provider is abnormal, please check the network configuration",
|
||||
|
|
|
@ -1380,7 +1380,7 @@
|
|||
"70": "Procesando [%s], por favor espere...",
|
||||
"71": "Fallo en la inserción del archivo de activos, por favor reabra el documento",
|
||||
"72": "El contenido se ha copiado en el portapapeles del sistema, por favor vaya a SiYuan para pegar",
|
||||
"73": "Importando, por favor espere...",
|
||||
"73": "Importando datos...",
|
||||
"74": "El kernel no ha sido arrancado completamente [%d%%], por favor, inténtelo de nuevo más tarde",
|
||||
"75": "Error al intentar acceder al archivo",
|
||||
"76": "La verificaci\u00f3n de conectividad de red del proveedor de servicios de almacenamiento en la nube es anormal, verifique la configuraci\u00f3n de red",
|
||||
|
|
|
@ -1380,7 +1380,7 @@
|
|||
"70": "Traitement de [%s], veuillez patienter...",
|
||||
"71": "L'insertion du fichier asset a échoué, veuillez rouvrir le document.",
|
||||
"72": "Le contenu a été copié dans le presse-papiers du système, veuillez vous rendre sur SiYuan pour le coller.",
|
||||
"73": "En cours d'importation, veuillez patienter...",
|
||||
"73": "Importation des données...",
|
||||
"74": "Le kernel n'a pas été complètement démarré [%d%%], veuillez réessayer plus tard.",
|
||||
"75": "La tentative d'accès au fichier a échoué",
|
||||
"76": "La vérification de la connectivité réseau du fournisseur de service de stockage cloud est anormale, veuillez vérifier la configuration réseau",
|
||||
|
|
|
@ -1380,7 +1380,7 @@
|
|||
"70": "מעבד [%s], אנא המתן...",
|
||||
"71": "נכשל בהכנסת קובץ נכס, אנא פתח מחדש את המסמך",
|
||||
"72": "התוכן הועתק ללוח המערכת, אנא עבור אל SiYuan להדביק",
|
||||
"73": "מייבא, אנא המתן...",
|
||||
"73": "מייבא נתונים...",
|
||||
"74": "הליבה לא הושלמה לחלוטין [%d%%], אנא נסה שוב מאוחר יותר",
|
||||
"75": "ניסיון גישה לקובץ נכשל",
|
||||
"76": "הווידוא על זמינות החיבור המתקן של ספק שירותי אחסון בענן לא תקין, אנא בדוק את הגדרות הרשת",
|
||||
|
|
|
@ -1380,7 +1380,7 @@
|
|||
"70": "Elaborazione [%s], attendere prego...",
|
||||
"71": "Impossibile inserire il file dell'asset, riapri il documento",
|
||||
"72": "Il contenuto è stato copiato negli appunti di sistema, vai su SiYuan per incollare",
|
||||
"73": "Importazione in corso, attendere prego...",
|
||||
"73": "Importazione dei dati in corso...",
|
||||
"74": "Il kernel non è stato avviato completamente [%d%%], riprova più tardi",
|
||||
"75": "Tentativo di accesso al file fallito",
|
||||
"76": "La verifica della connettività di rete del servizio di archiviazione cloud è anomala, controlla la configurazione della rete",
|
||||
|
|
|
@ -1380,7 +1380,7 @@
|
|||
"70": "[%s] を処理しています。お待ちください...",
|
||||
"71": "アセットファイルの挿入に失敗しました。ドキュメントを開きなおしてください",
|
||||
"72": "コンテンツがクリップボードにコピーされました。SiYuan に貼り付けてください",
|
||||
"73": "インポートしています。お待ちください...",
|
||||
"73": "データをインポート中...",
|
||||
"74": "カーネルの起動が完了していません [%d%%]。後でまた試してください",
|
||||
"75": "ファイルへのアクセスに失敗しました",
|
||||
"76": "クラウドストレージサービスプロバイダーのネットワーク接続検証の結果が異常です。ネットワーク設定を確認してください",
|
||||
|
|
|
@ -1380,7 +1380,7 @@
|
|||
"70": "Przetwarzanie [%s], proszę czekać...",
|
||||
"71": "Nie udało się wstawić pliku zasobu, proszę ponownie otworzyć dokument",
|
||||
"72": "Zawartość została skopiowana do systemowego schowka, proszę przejść do SiYuan, aby wkleić",
|
||||
"73": "Importowanie, proszę czekać...",
|
||||
"73": "Importowanie danych...",
|
||||
"74": "Jądro nie zostało w pełni uruchomione [%d%%], proszę spróbować ponownie później",
|
||||
"75": "Nie udało się uzyskać dostępu do pliku",
|
||||
"76": "Weryfikacja łączności sieciowej dostawcy usługi przechowywania w chmurze jest nieprawidłowa, proszę sprawdzić konfigurację sieci",
|
||||
|
|
|
@ -1380,7 +1380,7 @@
|
|||
"70": "Обработка [%s], пожалуйста, подождите...",
|
||||
"71": "Не удалось вставить файл ресурса, пожалуйста, повторно откройте документ",
|
||||
"72": "Содержимое было скопировано в буфер обмена системы, пожалуйста, перейдите в SiYuan для вставки",
|
||||
"73": "Импорт, пожалуйста, подождите...",
|
||||
"73": "Импорт данных...",
|
||||
"74": "Ядро еще не полностью запущено [%d%%], пожалуйста, попробуйте позже",
|
||||
"75": "Попытка доступа к файлу не удалась",
|
||||
"76": "Проверка сетевого подключения поставщика облачного хранилища аномальная, пожалуйста, проверьте сетевую конфигурацию",
|
||||
|
|
|
@ -1380,7 +1380,7 @@
|
|||
"70": "正在處理 [%s],請稍等...",
|
||||
"71": "插入資料檔失敗,請重新打開文檔",
|
||||
"72": "內容已經複製到系統剪貼簿,請到思源中進行貼上",
|
||||
"73": "正在導入,請稍等...",
|
||||
"73": "導入數據中...",
|
||||
"74": "kernel尚未完全啟動 [%d%%],請稍後再試",
|
||||
"75": "嘗試訪問資料檔失敗",
|
||||
"76": "雲端存儲服務提供商網絡連通性校驗異常,請檢查網絡配置",
|
||||
|
|
|
@ -1380,7 +1380,7 @@
|
|||
"70": "正在处理 [%s],请稍等...",
|
||||
"71": "插入资源文件失败,请重新打开文档",
|
||||
"72": "内容已经复制到系统剪切板,请到思源中进行粘贴",
|
||||
"73": "正在导入,请稍等...",
|
||||
"73": "导入数据中...",
|
||||
"74": "内核尚未完全启动 [%d%%],请稍后再试",
|
||||
"75": "尝试访问文件失败",
|
||||
"76": "云端存储服务提供商网络连通性校验异常,请检查网络配置",
|
||||
|
|
|
@ -147,7 +147,7 @@ func ImportSY(zipPath, boxID, toPath string) (err error) {
|
|||
trees := map[string]*parse.Tree{}
|
||||
|
||||
// 重新生成块 ID
|
||||
for _, syPath := range syPaths {
|
||||
for i, syPath := range syPaths {
|
||||
data, readErr := os.ReadFile(syPath)
|
||||
if nil != readErr {
|
||||
logging.LogErrorf("read .sy [%s] failed: %s", syPath, readErr)
|
||||
|
@ -176,10 +176,12 @@ func ImportSY(zipPath, boxID, toPath string) (err error) {
|
|||
tree.ID = tree.Root.ID
|
||||
tree.Path = filepath.ToSlash(strings.TrimPrefix(syPath, unzipRootPath))
|
||||
trees[tree.ID] = tree
|
||||
util.PushEndlessProgress(Conf.language(73) + " " + fmt.Sprintf(Conf.language(70), fmt.Sprintf("%d/%d", i+1, len(syPaths))))
|
||||
}
|
||||
|
||||
// 引用和嵌入指向重新生成的块 ID
|
||||
for _, tree := range trees {
|
||||
util.PushEndlessProgress(Conf.language(73) + " " + fmt.Sprintf(Conf.language(70), tree.Root.IALAttr("title")))
|
||||
ast.Walk(tree.Root, func(n *ast.Node, entering bool) ast.WalkStatus {
|
||||
if !entering {
|
||||
return ast.WalkContinue
|
||||
|
@ -269,6 +271,7 @@ func ImportSY(zipPath, boxID, toPath string) (err error) {
|
|||
|
||||
// 重新指向数据库属性值
|
||||
for _, tree := range trees {
|
||||
util.PushEndlessProgress(Conf.language(73) + " " + fmt.Sprintf(Conf.language(70), tree.Root.IALAttr("title")))
|
||||
ast.Walk(tree.Root, func(n *ast.Node, entering bool) ast.WalkStatus {
|
||||
if !entering || "" == n.ID {
|
||||
return ast.WalkContinue
|
||||
|
@ -362,6 +365,7 @@ func ImportSY(zipPath, boxID, toPath string) (err error) {
|
|||
|
||||
// 写回 .sy
|
||||
for _, tree := range trees {
|
||||
util.PushEndlessProgress(Conf.language(73) + " " + fmt.Sprintf(Conf.language(70), tree.Root.IALAttr("title")))
|
||||
syPath := filepath.Join(unzipRootPath, tree.Path)
|
||||
if "" == tree.Root.Spec {
|
||||
parse.NestedInlines2FlattedSpans(tree, false)
|
||||
|
@ -587,6 +591,7 @@ func ImportSY(zipPath, boxID, toPath string) (err error) {
|
|||
|
||||
treenode.IndexBlockTree(tree)
|
||||
sql.IndexTreeQueue(tree)
|
||||
util.PushEndlessProgress(Conf.language(73) + " " + fmt.Sprintf(Conf.language(70), tree.Root.IALAttr("title")))
|
||||
}
|
||||
|
||||
IncSync()
|
||||
|
|
Loading…
Add table
Reference in a new issue