diff --git a/addon/chrome.manifest b/addon/chrome.manifest deleted file mode 100644 index 713e1b0..0000000 --- a/addon/chrome.manifest +++ /dev/null @@ -1,3 +0,0 @@ -content __addonRef__ chrome/content/ -locale __addonRef__ en-US chrome/locale/en-US/ -locale __addonRef__ zh-CN chrome/locale/zh-CN/ diff --git a/addon/chrome/content/preferences.xhtml b/addon/chrome/content/preferences.xhtml index e2f433b..91da34f 100644 --- a/addon/chrome/content/preferences.xhtml +++ b/addon/chrome/content/preferences.xhtml @@ -1,13 +1,17 @@ + + + - + - &zotero.__addonRef__.pref.workspace.expandLevel.label; + - + - &zotero.__addonRef__.pref.sync.period.label; + - + - + @@ -64,6 +67,7 @@ diff --git a/addon/chrome/locale/en-US/addon.properties b/addon/chrome/locale/en-US/addon.properties deleted file mode 100644 index ccc4a90..0000000 --- a/addon/chrome/locale/en-US/addon.properties +++ /dev/null @@ -1,119 +0,0 @@ -pref.title=BNotes - -menuItem.setMainNote=As Workspace Note -menuItem.exportNote=Export Note - -menuEdit.insertTemplate=Insert Template to Workspace Note -menuEdit.exportTemplate=Export Template to File... -menuEdit.templateEditor=Template Editor -menuEdit.importTemplate=New Template from Clipboard - -menuTools.syncManager=Sync Manager - -menuAddNote.newMainNote=New Workspace Note -menuAddNote.newMainNote.confirmHead=Will create a new note in collection -menuAddNote.newMainNote.confirmTail=and set it the workspace note. Continue? -menuAddNote.newMainNote.enterNoteTitle=Enter new note title: -menuAddNote.newMainNote.openWorkspaceTab=Open note workspace now? -menuAddNote.newTemplateStandaloneNote=New Standalone Note from Template -menuAddNote.newTemplateItemNote=New Item Note from Template - -menuAddReaderNote.newTemplateNote=New Item Note from Template - -menuEditor.resizeImage=Resize Image - -templateEditor.title=Template Editor -templateEditor.templateName=Template Name -templateEditor.previewContainer=Preview -templateEditor.create=New -templateEditor.import=Import Note -templateEditor.more=More Templates -templateEditor.save=Save -templateEditor.delete=Delete -templateEditor.reset=Reset -templateEditor.help=Help - -tab.name=Note Workspace -tab.openInWindow=Drag and drop here to open workspace in new window - -workspaceWindow.name=Note Workspace - -export.title=Export Notes -export.options.linkMode=Linked Notes Mode -export.options.MD=MarkDown(.md) -export.options.Docx=MS Word(.docx) -export.options.PDF=PDF(.pdf) -export.options.mm=Mind Map -export.options.note=Zotero Note -export.embedLink=All Embeded in One Export -export.standaloneLink=Each Converted to Standalone Exports -export.keepLink=Keep Zotero Links(zotero://note/) -export.exportMD=Export MD File(s) -export.setAutoSync=Set Auto-Sync -export.withYAMLHeader=With YAML Header -export.exportDocx=Export Docx File -export.exportPDF=Export PDF File -export.exportFreeMind=Export FreeMind File -export.exportNote=Export to New Zotero Note Item -export.confirm=Export -export.cancel=Close -export.target=Target - -syncManager.title=Sync Manager -syncManager.refresh=Refresh -syncManager.sync=Sync -syncManager.syncDetail=Check and sync immedietly -syncManager.unSync=UnSync -syncManager.unSyncDetail=Remove selected notes from syncing list -syncManager.noteName=Note Name -syncManager.lastSync=Last Sync -syncManager.filePath=MarkDown Path - -syncInfo.syncTo=MarkDown Path -syncInfo.lastSync=Last Sync -syncInfo.sync=Sync -syncInfo.unSync=UnSync -syncInfo.reveal=Show in Folder -syncInfo.manager=Sync Manager -syncInfo.export=Export As... -syncInfo.cancel=Close - -fileInterface.sync=Sync to - -sync.start.hint=Note Auto-Sync is enabled every -sync.stop.hint=Note Auto-Sync is disabled -sync.running.hint.title=Note Syncing -sync.running.hint.check=Check Status -sync.running.hint.updateMD=Update MarkDown -sync.running.hint.updateNote=Update Note -sync.running.hint.diff=Confirm Merge -sync.running.hint.finish=Finish -sync.running.hint.synced=Synced -sync.running.hint.upToDate=Up To Date - -workspace.notesPane.hint=PDF NotePane is not accesible if no PDF files are opened. -workspace.switchOutline=Swith Outline Mode -workspace.saveOutlineImage=Save Image -workspace.saveOutlineFreeMind=Save MindMap - -editor.toolbar.main=Workspace Note -editor.toolbar.settings.title=Workspace Settings -editor.toolbar.settings.openWorkspace=Open Note Workspace -editor.toolbar.settings.setWorkspace=Set as Workspace Note -editor.toolbar.settings.previewInWorkspace=Preview in Workspace -editor.toolbar.settings.insertTemplate=Insert Template to Cursor Line -editor.toolbar.settings.copyLink=Copy Note Link -editor.toolbar.settings.openParent=Open Attachment -editor.toolbar.settings.export=Export Current Note... -editor.toolbar.settings.refreshSyncing=Sync Now -editor.toolbar.link.title=Link current note to workspace -editor.toolbar.link.popup.nodata=Workspace note is invalid - -templatePicker.itemData.info=are selected in library. Please choose the data source: -templatePicker.itemData.useLibrary=Use selected items in library -templatePicker.itemData.useCustom=Choose another... -templatePicker.itemData.title=Choose Item Template Data Source - -alert.notValidCollectionError=Please select a valid collection. -alert.notValidParentItemError=No valid parent item. -alert.notValidWorkspaceNote=Workspace note is not set. Create one? diff --git a/addon/chrome/locale/en-US/overlay.dtd b/addon/chrome/locale/en-US/overlay.dtd deleted file mode 100644 index daf9a8e..0000000 --- a/addon/chrome/locale/en-US/overlay.dtd +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/addon/chrome/locale/ru-RU/addon.properties b/addon/chrome/locale/ru-RU/addon.properties deleted file mode 100644 index b8eb266..0000000 --- a/addon/chrome/locale/ru-RU/addon.properties +++ /dev/null @@ -1,119 +0,0 @@ -pref.title=BNotes - -menuItem.setMainNote=Как заметка раб. пространства -menuItem.exportNote=Экспорт заметки - -menuEdit.insertTemplate=Вставить шаблон в заметку раб. пространства -menuEdit.exportTemplate=Экспорт шаблона в файл... -menuEdit.templateEditor=Редактор шаблонов -menuEdit.importTemplate=New Template from Clipboard - -menuTools.syncManager=Синк менеджер - -menuAddNote.newMainNote=Новая заметка раб. пространства -menuAddNote.newMainNote.confirmHead=Создать новую заметку в коллекции -menuAddNote.newMainNote.confirmTail=и установить её как заметку раб. пространства. Продолжить? -menuAddNote.newMainNote.enterNoteTitle=Ввести имя новой заметки: -menuAddNote.newMainNote.openWorkspaceTab=Открыть пространство заметок? -menuAddNote.newTemplateStandaloneNote=Новая отдельная заметка из шаблона -menuAddNote.newTemplateItemNote=Новая элементная заметка из шаблона - -menuAddReaderNote.newTemplateNote=Новая элементная заметка из шаблона - -menuEditor.resizeImage=Изменить размер изображения - -templateEditor.title=Редактор шаблонов -templateEditor.templateName=Имя шаблона -templateEditor.previewContainer=Предпросмотр -templateEditor.create=Новая -templateEditor.import=Импортировать заметку -templateEditor.more=Больше шаблонов -templateEditor.save=Сохранить -templateEditor.delete=Удалить -templateEditor.reset=Сброс -templateEditor.help=Помощь - -tab.name=Рабочее пространство заметок -tab.openInWindow=Перетащите сюда для открытия раб. пространства в новом окне - -workspaceWindow.name=Раб. пространство заметок - -export.title=Экспорт заметок -export.options.linkMode=Режим связанных заметок -export.options.MD=MarkDown(.md) -export.options.Docx=MS Word(.docx) -export.options.PDF=PDF(.pdf) -export.options.mm=Mind Map -export.options.note=Zotero Note -export.embedLink=Все внедрённые в одном экспорте -export.standaloneLink=Каждый конвертированный в отдельный экспорт -export.keepLink=Сохранять Zotero ссылки(zotero://note/) -export.exportMD=Экспорт MD файл(-ов) -export.setAutoSync=Установить Авто-синк -export.withYAMLHeader=С YAML заголовком -export.exportDocx=Экспорт Docx файл -export.exportPDF=Экспорт PDF файл -export.exportFreeMind=Экспорт FreeMind файл -export.exportNote=Экспорт в новый пункт Zotero Note -export.confirm=Экспорт -export.cancel=Закрыть -export.target=Цель - -syncManager.title=Синк Менеджер -syncManager.refresh=Обновить -syncManager.sync=Синк -syncManager.syncDetail=Проверить и синкнуть немедленно -syncManager.unSync=ДеСинк -syncManager.unSyncDetail=Удалить выделенные заметки из списка синхронизации -syncManager.noteName=Имя заметки -syncManager.lastSync=Последний Синк -syncManager.filePath=MarkDown путь - -syncInfo.syncTo=MarkDown путь -syncInfo.lastSync=Последний Синк -syncInfo.sync=Синк -syncInfo.unSync=ДеСинк -syncInfo.reveal=Показать в папке -syncInfo.manager=Синк Менеджер -syncInfo.export=Экспортировать как... -syncInfo.cancel=Закрыть - -fileInterface.sync=Синк to - -sync.start.hint=Авто-Синк заметок включен каждые -sync.stop.hint=Авто-Синк заметок отключен -sync.running.hint.title=Синхронизация заметок -sync.running.hint.check=Проверить статус -sync.running.hint.updateMD=Обновить MarkDown -sync.running.hint.updateNote=Обновить заметку -sync.running.hint.diff=Подтвердить слияние -sync.running.hint.finish=Финиш -sync.running.hint.synced=Синхронизировано -sync.running.hint.upToDate=Обновить - -workspace.notesPane.hint=PDF панель заметок недоступна если PDF файлы не открыты. -workspace.switchOutline=Переключить режим Набросок -workspace.saveOutlineImage=Сохранить изображение -workspace.saveOutlineFreeMind=Сохранить MindMap - -editor.toolbar.main=Заметка рабочего пространства -editor.toolbar.settings.title=Настройки рабочего пространства -editor.toolbar.settings.openWorkspace=Открыть пространство заметок -editor.toolbar.settings.setWorkspace=Установить как заметку раб. пространства -editor.toolbar.settings.previewInWorkspace=Предпросмотр в рабочем пространстве -editor.toolbar.settings.insertTemplate=Вставить шаблон в строку курсора -editor.toolbar.settings.copyLink=Скопировать ссылку заметки -editor.toolbar.settings.openParent=Открыть вложение -editor.toolbar.settings.export=Экспортировать текущую заметку... -editor.toolbar.settings.refreshSyncing=Синхронизировать сейчас -editor.toolbar.link.title=Ссылка текущей заметки в рабочее пространство -editor.toolbar.link.popup.nodata=Workspace note is invalid - -templatePicker.itemData.info=are selected in library. Please choose the data source: -templatePicker.itemData.useLibrary=Use selected items in library -templatePicker.itemData.useCustom=Choose another... -templatePicker.itemData.title=Choose Item Template Data Source - -alert.notValidCollectionError=Выберите валидную коллекцию. -alert.notValidParentItemError=Нет валидного родительского элемента. -alert.notValidWorkspaceNote=Заметка рабочего пространства не установлена. Создать? diff --git a/addon/chrome/locale/ru-RU/overlay.dtd b/addon/chrome/locale/ru-RU/overlay.dtd deleted file mode 100644 index f497e52..0000000 --- a/addon/chrome/locale/ru-RU/overlay.dtd +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/addon/chrome/locale/zh-CN/addon.properties b/addon/chrome/locale/zh-CN/addon.properties deleted file mode 100644 index 988bda9..0000000 --- a/addon/chrome/locale/zh-CN/addon.properties +++ /dev/null @@ -1,119 +0,0 @@ -pref.title=BNotes - -menuItem.setMainNote=设为工作区主笔记 -menuItem.exportNote=导出笔记 - -menuEdit.insertTemplate=插入模板到工作区笔记 -menuEdit.exportTemplate=导出模板到文件... -menuEdit.templateEditor=模板编辑器 -menuEdit.importTemplate=从剪贴板导入新模板 - -menuTools.syncManager=同步管理器 - -menuAddNote.newMainNote=新建工作区笔记 -menuAddNote.newMainNote.confirmHead=将在当前分类 -menuAddNote.newMainNote.confirmTail=下创建新笔记并将它设为工作区笔记。确认继续吗? -menuAddNote.newMainNote.enterNoteTitle=请输入新笔记的标题: -menuAddNote.newMainNote.openWorkspaceTab=现在打开笔记工作区吗? -menuAddNote.newTemplateStandaloneNote=从模板新建独立笔记 -menuAddNote.newTemplateItemNote=从模板新建条目子笔记 - -menuAddReaderNote.newTemplateNote=从模板新建条目子笔记 - -menuEditor.resizeImage=缩放图片 - -templateEditor.title=模板编辑器 -templateEditor.templateName=模板名称 -templateEditor.previewContainer=预览 -templateEditor.create=新建 -templateEditor.import=导入笔记 -templateEditor.more=更多模板 -templateEditor.save=保存 -templateEditor.delete=删除 -templateEditor.reset=重置 -templateEditor.help=帮助 - -tab.name=笔记工作区 -tab.openInWindow=拖放到此处以在新窗口打开 - -workspaceWindow.name=笔记工作区 - -export.title=导出笔记 -export.options.linkMode=链接笔记模式 -export.options.MD=MarkDown(.md) -export.options.Docx=MS Word(.docx) -export.options.PDF=PDF(.pdf) -export.options.mm=思维导图 -export.options.note=Zotero笔记 -export.embedLink=全部嵌入为一个导出 -export.standaloneLink=分别单独导出 -export.keepLink=保留Zotero链接(zotero://note/) -export.exportMD=导出MD文件 -export.setAutoSync=设置自动同步 -export.withYAMLHeader=带有YAML头 -export.exportDocx=导出Word文件 -export.exportPDF=导出PDF文件 -export.exportFreeMind=导出FreeMind文件 -export.exportNote=导出为Zotero笔记条目 -export.confirm=导出 -export.cancel=关闭 -export.target=目标 - -syncManager.title=同步管理 -syncManager.refresh=刷新 -syncManager.sync=同步 -syncManager.syncDetail=检查并立即同步 -syncManager.unSync=取消同步 -syncManager.unSyncDetail=从同步列表中移除选中的笔记 -syncManager.noteName=笔记名称 -syncManager.lastSync=最近同步 -syncManager.filePath=MarkDown路径 - -syncInfo.syncTo=MarkDown路径 -syncInfo.lastSync=最近同步 -syncInfo.sync=同步 -syncInfo.unSync=取消同步 -syncInfo.reveal=在文件夹中显示 -syncInfo.manager=同步管理 -syncInfo.export=导出为... -syncInfo.cancel=关闭 - -sync.start.hint=自动同步已启用, 间隔 -sync.stop.hint=自动同步已停止 -sync.running.hint.title=笔记同步 -sync.running.hint.check=检查状态 -sync.running.hint.updateMD=更新MarkDown -sync.running.hint.updateNote=更新笔记 -sync.running.hint.diff=确认合并 -sync.running.hint.finish=同步完成 -sync.running.hint.synced=已同步 -sync.running.hint.upToDate=已最新 - -fileInterface.sync=同步到 - -workspace.notesPane.hint=PDF笔记侧栏在没有PDF文件打开时不可访问. -workspace.switchOutline=切换大纲模式 -workspace.saveOutlineImage=保存图片 -workspace.saveOutlineFreeMind=保存思维导图 - -editor.toolbar.main=工作区笔记 -editor.toolbar.settings.title=工作区选项 -editor.toolbar.settings.openWorkspace=打开笔记工作区 -editor.toolbar.settings.setWorkspace=设为工作区笔记 -editor.toolbar.settings.previewInWorkspace=在工作区预览 -editor.toolbar.settings.insertTemplate=插入模板到光标行 -editor.toolbar.settings.copyLink=复制笔记链接 -editor.toolbar.settings.openParent=打开附件 -editor.toolbar.settings.export=导出当前笔记... -editor.toolbar.settings.refreshSyncing=立即同步 -editor.toolbar.link.title=链接当前笔记到工作区 -editor.toolbar.link.popup.nodata=工作区笔记不可用 - -templatePicker.itemData.info=在文库中被选中。请选择模板数据源: -templatePicker.itemData.useLibrary=使用文库中选中的条目 -templatePicker.itemData.useCustom=另作选择... -templatePicker.itemData.title=选择条目模板数据源 - -alert.notValidCollectionError=请选择一个有效的分类。 -alert.notValidParentItemError=无效的父条目。 -alert.notValidWorkspaceNote=工作区笔记未设置。创建一个吗? diff --git a/addon/chrome/locale/zh-CN/overlay.dtd b/addon/chrome/locale/zh-CN/overlay.dtd deleted file mode 100644 index 72401d2..0000000 --- a/addon/chrome/locale/zh-CN/overlay.dtd +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/addon/install.rdf b/addon/install.rdf deleted file mode 100644 index 3b73c4f..0000000 --- a/addon/install.rdf +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - zotero@chnm.gmu.edu - 5.0 - * - - - - - juris-m@juris-m.github.io - 5.0 - * - - - - diff --git a/addon/locale/en-US/addon.ftl b/addon/locale/en-US/addon.ftl new file mode 100644 index 0000000..8bfa041 --- /dev/null +++ b/addon/locale/en-US/addon.ftl @@ -0,0 +1,119 @@ +pref-title = BNotes + +menuItem-setMainNote = As Workspace Note +menuItem-exportNote = Export Note + +menuEdit-insertTemplate = Insert Template to Workspace Note +menuEdit-exportTemplate = Export Template to File... +menuEdit-templateEditor = Template Editor +menuEdit-importTemplate = New Template from Clipboard + +menuTools-syncManager = Sync Manager + +menuAddNote-newMainNote = New Workspace Note +menuAddNote-newMainNote-confirmHead = Will create a new note in collection +menuAddNote-newMainNote-confirmTail = and set it the workspace note. Continue? +menuAddNote-newMainNote-enterNoteTitle = Enter new note title: +menuAddNote-newMainNote-openWorkspaceTab = Open note workspace now? +menuAddNote-newTemplateStandaloneNote = New Standalone Note from Template +menuAddNote-newTemplateItemNote = New Item Note from Template + +menuAddReaderNote-newTemplateNote = New Item Note from Template + +menuEditor-resizeImage = Resize Image + +templateEditor-title = Template Editor +templateEditor-templateName = Template Name +templateEditor-previewContainer = Preview +templateEditor-create = New +templateEditor-import = Import Note +templateEditor-more = More Templates +templateEditor-save = Save +templateEditor-delete = Delete +templateEditor-reset = Reset +templateEditor-help = Help + +tab-name = Note Workspace +tab-openInWindow = Drag and drop here to open workspace in new window + +workspaceWindow-name = Note Workspace + +export-title = Export Notes +export-options-linkMode = Linked Notes Mode +export-options-MD = MarkDown(.md) +export-options-Docx = MS Word(.docx) +export-options-PDF = PDF(.pdf) +export-options-mm = Mind Map +export-options-note = Zotero Note +export-embedLink = All Embeded in One Export +export-standaloneLink = Each Converted to Standalone Exports +export-keepLink = Keep Zotero Links(zotero://note/) +export-exportMD = Export MD File(s) +export-setAutoSync = Set Auto-Sync +export-withYAMLHeader = With YAML Header +export-exportDocx = Export Docx File +export-exportPDF = Export PDF File +export-exportFreeMind = Export FreeMind File +export-exportNote = Export to New Zotero Note Item +export-confirm = Export +export-cancel = Close +export-target = Target + +syncManager-title = Sync Manager +syncManager-refresh = Refresh +syncManager-sync = Sync +syncManager-syncDetail = Check and sync immedietly +syncManager-unSync = UnSync +syncManager-unSyncDetail = Remove selected notes from syncing list +syncManager-noteName = Note Name +syncManager-lastSync = Last Sync +syncManager-filePath = MarkDown Path + +syncInfo-syncTo = MarkDown Path +syncInfo-lastSync = Last Sync +syncInfo-sync = Sync +syncInfo-unSync = UnSync +syncInfo-reveal = Show in Folder +syncInfo-manager = Sync Manager +syncInfo-export = Export As... +syncInfo-cancel = Close + +fileInterface-sync = Sync to + +sync-start-hint = Note Auto-Sync is enabled every +sync-stop-hint = Note Auto-Sync is disabled +sync-running-hint-title = Note Syncing +sync-running-hint-check = Check Status +sync-running-hint-updateMD = Update MarkDown +sync-running-hint-updateNote = Update Note +sync-running-hint-diff = Confirm Merge +sync-running-hint-finish = Finish +sync-running-hint-synced = Synced +sync-running-hint-upToDate = Up To Date + +workspace-notesPane-hint = PDF NotePane is not accesible if no PDF files are opened. +workspace-switchOutline = Swith Outline Mode +workspace-saveOutlineImage = Save Image +workspace-saveOutlineFreeMind = Save MindMap + +editor-toolbar-main = Workspace Note +editor-toolbar-settings-title = Workspace Settings +editor-toolbar-settings-openWorkspace = Open Note Workspace +editor-toolbar-settings-setWorkspace = Set as Workspace Note +editor-toolbar-settings-previewInWorkspace = Preview in Workspace +editor-toolbar-settings-insertTemplate = Insert Template to Cursor Line +editor-toolbar-settings-copyLink = Copy Note Link +editor-toolbar-settings-openParent = Open Attachment +editor-toolbar-settings-export = Export Current Note... +editor-toolbar-settings-refreshSyncing = Sync Now +editor-toolbar-link-title = Link current note to workspace +editor-toolbar-link-popup-nodata = Workspace note is invalid + +templatePicker-itemData-info = are selected in library. Please choose the data source: +templatePicker-itemData-useLibrary = Use selected items in library +templatePicker-itemData-useCustom = Choose another. +templatePicker-itemData-title = Choose Item Template Data Source + +alert-notValidCollectionError = Please select a valid collection. +alert-notValidParentItemError = No valid parent item. +alert-notValidWorkspaceNote = Workspace note is not set. Create one? diff --git a/addon/locale/en-US/preferences.ftl b/addon/locale/en-US/preferences.ftl new file mode 100644 index 0000000..d7fe3dc --- /dev/null +++ b/addon/locale/en-US/preferences.ftl @@ -0,0 +1,14 @@ +workspace-title = Workspace +workspace-expandLevel-label = Outline expand to heading level +sync-title = Sync +sync-period-label = Auto-sync period (seconds) +sync-manager = + .label = Open Sync Manager +template-title = Template +template-editor = + .label = Open Template Editor +annotation-title = PDF Annotation +annotation-autoAnnotation = + .label = Automatically add new annotations to workspace note +help = + .value = { $name } VERSION { $version } Build { $time } \ No newline at end of file diff --git a/addon/locale/ru-RU/addon.ftl b/addon/locale/ru-RU/addon.ftl new file mode 100644 index 0000000..81fb7a8 --- /dev/null +++ b/addon/locale/ru-RU/addon.ftl @@ -0,0 +1,119 @@ +pref-title=BNotes + +menuItem-setMainNote=Как заметка раб. пространства +menuItem-exportNote=Экспорт заметки + +menuEdit-insertTemplate=Вставить шаблон в заметку раб. пространства +menuEdit-exportTemplate=Экспорт шаблона в файл... +menuEdit-templateEditor=Редактор шаблонов +menuEdit-importTemplate=New Template from Clipboard + +menuTools-syncManager=Синк менеджер + +menuAddNote-newMainNote=Новая заметка раб. пространства +menuAddNote-newMainNote-confirmHead=Создать новую заметку в коллекции +menuAddNote-newMainNote-confirmTail=и установить её как заметку раб. пространства. Продолжить? +menuAddNote-newMainNote-enterNoteTitle=Ввести имя новой заметки: +menuAddNote-newMainNote-openWorkspaceTab=Открыть пространство заметок? +menuAddNote-newTemplateStandaloneNote=Новая отдельная заметка из шаблона +menuAddNote-newTemplateItemNote=Новая элементная заметка из шаблона + +menuAddReaderNote-newTemplateNote=Новая элементная заметка из шаблона + +menuEditor-resizeImage=Изменить размер изображения + +templateEditor-title=Редактор шаблонов +templateEditor-templateName=Имя шаблона +templateEditor-previewContainer=Предпросмотр +templateEditor-create=Новая +templateEditor-import=Импортировать заметку +templateEditor-more=Больше шаблонов +templateEditor-save=Сохранить +templateEditor-delete=Удалить +templateEditor-reset=Сброс +templateEditor-help=Помощь + +tab-name=Рабочее пространство заметок +tab-openInWindow=Перетащите сюда для открытия раб. пространства в новом окне + +workspaceWindow-name=Раб. пространство заметок + +export-title=Экспорт заметок +export-options-linkMode=Режим связанных заметок +export-options-MD=MarkDown(.md) +export-options-Docx=MS Word(.docx) +export-options-PDF=PDF(.pdf) +export-options-mm=Mind Map +export-options-note=Zotero Note +export-embedLink=Все внедрённые в одном экспорте +export-standaloneLink=Каждый конвертированный в отдельный экспорт +export-keepLink=Сохранять Zotero ссылки(zotero://note/) +export-exportMD=Экспорт MD файл(-ов) +export-setAutoSync=Установить Авто-синк +export-withYAMLHeader=С YAML заголовком +export-exportDocx=Экспорт Docx файл +export-exportPDF=Экспорт PDF файл +export-exportFreeMind=Экспорт FreeMind файл +export-exportNote=Экспорт в новый пункт Zotero Note +export-confirm=Экспорт +export-cancel=Закрыть +export-target=Цель + +syncManager-title=Синк Менеджер +syncManager-refresh=Обновить +syncManager-sync=Синк +syncManager-syncDetail=Проверить и синкнуть немедленно +syncManager-unSync=ДеСинк +syncManager-unSyncDetail=Удалить выделенные заметки из списка синхронизации +syncManager-noteName=Имя заметки +syncManager-lastSync=Последний Синк +syncManager-filePath=MarkDown путь + +syncInfo-syncTo=MarkDown путь +syncInfo-lastSync=Последний Синк +syncInfo-sync=Синк +syncInfo-unSync=ДеСинк +syncInfo-reveal=Показать в папке +syncInfo-manager=Синк Менеджер +syncInfo-export=Экспортировать как... +syncInfo-cancel=Закрыть + +fileInterface-sync=Синк to + +sync-start-hint=Авто-Синк заметок включен каждые +sync-stop-hint=Авто-Синк заметок отключен +sync-running-hint-title=Синхронизация заметок +sync-running-hint-check=Проверить статус +sync-running-hint-updateMD=Обновить MarkDown +sync-running-hint-updateNote=Обновить заметку +sync-running-hint-diff=Подтвердить слияние +sync-running-hint-finish=Финиш +sync-running-hint-synced=Синхронизировано +sync-running-hint-upToDate=Обновить + +workspace-notesPane-hint=PDF панель заметок недоступна если PDF файлы не открыты. +workspace-switchOutline=Переключить режим Набросок +workspace-saveOutlineImage=Сохранить изображение +workspace-saveOutlineFreeMind=Сохранить MindMap + +editor-toolbar-main=Заметка рабочего пространства +editor-toolbar-settings-title=Настройки рабочего пространства +editor-toolbar-settings-openWorkspace=Открыть пространство заметок +editor-toolbar-settings-setWorkspace=Установить как заметку раб. пространства +editor-toolbar-settings-previewInWorkspace=Предпросмотр в рабочем пространстве +editor-toolbar-settings-insertTemplate=Вставить шаблон в строку курсора +editor-toolbar-settings-copyLink=Скопировать ссылку заметки +editor-toolbar-settings-openParent=Открыть вложение +editor-toolbar-settings-export=Экспортировать текущую заметку... +editor-toolbar-settings-refreshSyncing=Синхронизировать сейчас +editor-toolbar-link-title=Ссылка текущей заметки в рабочее пространство +editor-toolbar-link-popup-nodata=Workspace note is invalid + +templatePicker-itemData-info=are selected in library. Please choose the data source: +templatePicker-itemData-useLibrary=Use selected items in library +templatePicker-itemData-useCustom=Choose another... +templatePicker-itemData-title=Choose Item Template Data Source + +alert-notValidCollectionError=Выберите валидную коллекцию. +alert-notValidParentItemError=Нет валидного родительского элемента. +alert-notValidWorkspaceNote=Заметка рабочего пространства не установлена. Создать? diff --git a/addon/locale/ru-RU/preferences.ftl b/addon/locale/ru-RU/preferences.ftl new file mode 100644 index 0000000..533f53e --- /dev/null +++ b/addon/locale/ru-RU/preferences.ftl @@ -0,0 +1,14 @@ +workspace-title = Рабочее пространство +workspace-expandLevel-label = Outline расширить до уровня заголовка +sync-title = Синк +sync-period-label = Авто-синк период (сек) +sync-manager = + .label = Открыть Синк менеджер +template-title = Шаблон +template-editor = + .label = Открыть редактор шаблонов +annotation-title = PDF Аннотация +annotation-autoAnnotation = + .label = Автодобавлять новые аннотации к заметкам раб.пространства +help = + .value = { $name } VERSION { $version } Build { $time } \ No newline at end of file diff --git a/addon/locale/zh-CN/addon.ftl b/addon/locale/zh-CN/addon.ftl new file mode 100644 index 0000000..8a3a9d3 --- /dev/null +++ b/addon/locale/zh-CN/addon.ftl @@ -0,0 +1,119 @@ +pref-title=BNotes + +menuItem-setMainNote=设为工作区主笔记 +menuItem-exportNote=导出笔记 + +menuEdit-insertTemplate=插入模板到工作区笔记 +menuEdit-exportTemplate=导出模板到文件... +menuEdit-templateEditor=模板编辑器 +menuEdit-importTemplate=从剪贴板导入新模板 + +menuTools-syncManager=同步管理器 + +menuAddNote-newMainNote=新建工作区笔记 +menuAddNote-newMainNote-confirmHead=将在当前分类 +menuAddNote-newMainNote-confirmTail=下创建新笔记并将它设为工作区笔记。确认继续吗? +menuAddNote-newMainNote-enterNoteTitle=请输入新笔记的标题: +menuAddNote-newMainNote-openWorkspaceTab=现在打开笔记工作区吗? +menuAddNote-newTemplateStandaloneNote=从模板新建独立笔记 +menuAddNote-newTemplateItemNote=从模板新建条目子笔记 + +menuAddReaderNote-newTemplateNote=从模板新建条目子笔记 + +menuEditor-resizeImage=缩放图片 + +templateEditor-title=模板编辑器 +templateEditor-templateName=模板名称 +templateEditor-previewContainer=预览 +templateEditor-create=新建 +templateEditor-import=导入笔记 +templateEditor-more=更多模板 +templateEditor-save=保存 +templateEditor-delete=删除 +templateEditor-reset=重置 +templateEditor-help=帮助 + +tab-name=笔记工作区 +tab-openInWindow=拖放到此处以在新窗口打开 + +workspaceWindow-name=笔记工作区 + +export-title=导出笔记 +export-options-linkMode=链接笔记模式 +export-options-MD=MarkDown(.md) +export-options-Docx=MS Word(.docx) +export-options-PDF=PDF(.pdf) +export-options-mm=思维导图 +export-options-note=Zotero笔记 +export-embedLink=全部嵌入为一个导出 +export-standaloneLink=分别单独导出 +export-keepLink=保留Zotero链接(zotero://note/) +export-exportMD=导出MD文件 +export-setAutoSync=设置自动同步 +export-withYAMLHeader=带有YAML头 +export-exportDocx=导出Word文件 +export-exportPDF=导出PDF文件 +export-exportFreeMind=导出FreeMind文件 +export-exportNote=导出为Zotero笔记条目 +export-confirm=导出 +export-cancel=关闭 +export-target=目标 + +syncManager-title=同步管理 +syncManager-refresh=刷新 +syncManager-sync=同步 +syncManager-syncDetail=检查并立即同步 +syncManager-unSync=取消同步 +syncManager-unSyncDetail=从同步列表中移除选中的笔记 +syncManager-noteName=笔记名称 +syncManager-lastSync=最近同步 +syncManager-filePath=MarkDown路径 + +syncInfo-syncTo=MarkDown路径 +syncInfo-lastSync=最近同步 +syncInfo-sync=同步 +syncInfo-unSync=取消同步 +syncInfo-reveal=在文件夹中显示 +syncInfo-manager=同步管理 +syncInfo-export=导出为--- +syncInfo-cancel=关闭 + +sync-start-hint=自动同步已启用, 间隔 +sync-stop-hint=自动同步已停止 +sync-running-hint-title=笔记同步 +sync-running-hint-check=检查状态 +sync-running-hint-updateMD=更新MarkDown +sync-running-hint-updateNote=更新笔记 +sync-running-hint-diff=确认合并 +sync-running-hint-finish=同步完成 +sync-running-hint-synced=已同步 +sync-running-hint-upToDate=已最新 + +fileInterface-sync=同步到 + +workspace-notesPane-hint=PDF笔记侧栏在没有PDF文件打开时不可访问- +workspace-switchOutline=切换大纲模式 +workspace-saveOutlineImage=保存图片 +workspace-saveOutlineFreeMind=保存思维导图 + +editor-toolbar-main=工作区笔记 +editor-toolbar-settings-title=工作区选项 +editor-toolbar-settings-openWorkspace=打开笔记工作区 +editor-toolbar-settings-setWorkspace=设为工作区笔记 +editor-toolbar-settings-previewInWorkspace=在工作区预览 +editor-toolbar-settings-insertTemplate=插入模板到光标行 +editor-toolbar-settings-copyLink=复制笔记链接 +editor-toolbar-settings-openParent=打开附件 +editor-toolbar-settings-export=导出当前笔记... +editor-toolbar-settings-refreshSyncing=立即同步 +editor-toolbar-link-title=链接当前笔记到工作区 +editor-toolbar-link-popup-nodata=工作区笔记不可用 + +templatePicker-itemData-info=在文库中被选中。请选择模板数据源: +templatePicker-itemData-useLibrary=使用文库中选中的条目 +templatePicker-itemData-useCustom=另作选择... +templatePicker-itemData-title=选择条目模板数据源 + +alert-notValidCollectionError=请选择一个有效的分类。 +alert-notValidParentItemError=无效的父条目。 +alert-notValidWorkspaceNote=工作区笔记未设置。创建一个吗? diff --git a/addon/locale/zh-CN/preferences.ftl b/addon/locale/zh-CN/preferences.ftl new file mode 100644 index 0000000..f6cbbe0 --- /dev/null +++ b/addon/locale/zh-CN/preferences.ftl @@ -0,0 +1,14 @@ +workspace-title = 工作区 +workspace-expandLevel-label = 大纲展开至标题层级 +sync-title = 同步 +sync-period-label = 自动同步周期 (秒) +sync-manager = + .label = 打开同步管理器 +template-title = 模板 +template-editor = + .label = 打开模板编辑器 +annotation-title = PDF批注 +annotation-autoAnnotation = + .label = 自动添加新批注到工作区笔记 +help = + .value = { $name } 版本 { $version } 构建 { $time } \ No newline at end of file diff --git a/scripts/build.mjs b/scripts/build.mjs index 5ff8cc6..8a69acc 100644 --- a/scripts/build.mjs +++ b/scripts/build.mjs @@ -9,6 +9,7 @@ import { mkdirSync, readdirSync, rmSync, + renameSync, } from "fs"; import { env, exit } from "process"; import replaceInFile from "replace-in-file"; @@ -146,15 +147,10 @@ async function main() { const optionsAddon = { files: [ - join(buildDir, "**/*.rdf"), - join(buildDir, "**/*.dtd"), - join(buildDir, "**/*.xul"), join(buildDir, "**/*.html"), join(buildDir, "**/*.xhtml"), join(buildDir, "**/*.json"), - join(buildDir, "addon/prejs"), - join(buildDir, "addon/chrome.manifest"), - join(buildDir, "addon/manifest.json"), + join(buildDir, "addon/prefs.js"), join(buildDir, "addon/bootstrap.js"), "update.json", "update.rdf", @@ -174,6 +170,30 @@ async function main() { console.log("[Build] Replace OK"); + // Walk the builds/addon/locale folder's sub folders and rename *.ftl to addonRef-*.ftl + const localeDir = join(buildDir, "addon/locale"); + const localeFolders = readdirSync(localeDir, { withFileTypes: true }) + .filter((dirent) => dirent.isDirectory()) + .map((dirent) => dirent.name); + + for (const localeSubFolder of localeFolders) { + const localeSubDir = join(localeDir, localeSubFolder); + const localeSubFiles = readdirSync(localeSubDir, { + withFileTypes: true, + }) + .filter((dirent) => dirent.isFile()) + .map((dirent) => dirent.name); + + for (const localeSubFile of localeSubFiles) { + if (localeSubFile.endsWith(".ftl")) { + renameSync( + join(localeSubDir, localeSubFile), + join(localeSubDir, `${config.addonRef}-${localeSubFile}`) + ); + } + } + } + console.log("[Build] Addon prepare OK"); zip.compressDir(join(buildDir, "addon"), join(buildDir, `${name}.xpi`), { diff --git a/src/addon.ts b/src/addon.ts index af6792c..8920fc2 100644 --- a/src/addon.ts +++ b/src/addon.ts @@ -31,7 +31,7 @@ class Addon { ztoolkit: MyToolkit; // ztoolkit: ZoteroToolkit; locale?: { - stringBundle: any; + current: any; }; prefs?: { window: Window; diff --git a/src/utils/locale.ts b/src/utils/locale.ts index 6027f2a..569c64b 100644 --- a/src/utils/locale.ts +++ b/src/utils/locale.ts @@ -1,23 +1,80 @@ import { config } from "../../package.json"; -export function initLocale() { +export { initLocale, getString }; + +/** + * Initialize locale data + */ +function initLocale() { + const l10n = new ( + typeof Localization === "undefined" + ? ztoolkit.getGlobal("Localization") + : Localization + )([`${config.addonRef}-addon.ftl`], true); addon.data.locale = { - stringBundle: Components.classes["@mozilla.org/intl/stringbundle;1"] - .getService(Components.interfaces.nsIStringBundleService) - .createBundle(`chrome://${config.addonRef}/locale/addon.properties`), + current: l10n, }; } -export function getString(localeString: string): string { - switch (localeString) { - case "alt": - return Zotero.isMac ? "⌥" : "Alt"; - case "ctrl": - return Zotero.isMac ? "⌘" : "Ctrl"; - } - try { - return addon.data.locale?.stringBundle.GetStringFromName(localeString); - } catch (e) { - return localeString; +/** + * Get locale string, see https://firefox-source-docs.mozilla.org/l10n/fluent/tutorial.html#fluent-translation-list-ftl + * @param localString ftl key + * @param options.branch branch name + * @param options.args args + * @example + * ```ftl + * # addon.ftl + * addon-static-example = This is default branch! + * .branch-example = This is a branch under addon-static-example! + * addon-dynamic-example = + { $count -> + [one] I have { $count } apple + *[other] I have { $count } apples + } + * ``` + * ```js + * getString("addon-static-example"); // This is default branch! + * getString("addon-static-example", { branch: "branch-example" }); // This is a branch under addon-static-example! + * getString("addon-dynamic-example", { args: { count: 1 } }); // I have 1 apple + * getString("addon-dynamic-example", { args: { count: 2 } }); // I have 2 apples + * ``` + */ +function getString(localeString: string): string; +function getString(localeString: string, branch: string): string; +function getString( + localeString: string, + options: { branch?: string | undefined; args?: Record } +): string; +function getString(...inputs: any[]) { + // Old .properties uses . while .ftl uses - + const localeString = (inputs[0] as string).replace(/\./g, "-"); + if (inputs.length === 1) { + return _getString(localeString); + } else if (inputs.length === 2) { + if (typeof inputs[1] === "string") { + return _getString(localeString, { branch: inputs[1] }); + } else { + return _getString(localeString, inputs[1]); + } + } else { + throw new Error("Invalid arguments"); + } +} + +function _getString( + localeString: string, + options: { branch?: string | undefined; args?: Record } = {} +): string { + const { branch, args } = options; + const pattern = addon.data.locale?.current.formatMessagesSync([ + { id: localeString, args }, + ])[0]; + if (!pattern) { + return localeString; + } + if (branch && pattern.attributes) { + return pattern.attributes[branch] || localeString; + } else { + return pattern.value || localeString; } } diff --git a/typing/global.d.ts b/typing/global.d.ts index 51e2f73..97559a3 100644 --- a/typing/global.d.ts +++ b/typing/global.d.ts @@ -30,3 +30,5 @@ declare const addon: import("../src/addon").default; declare const __env__: "production" | "development"; declare const ChromeUtils: any; + +declare class Localization {}