From 62da0426ff94b30704107b7548477225fee39b69 Mon Sep 17 00:00:00 2001 From: ruifontes Date: Tue, 30 May 2023 17:12:31 +0100 Subject: [PATCH] Version 2023.05.30 - Redesigned dialog windows; - Translations added and updated; - Added possibility to move to selected line. --- 2023.5.30.json | 29 + _template_addon_release.json | 29 + addon/GlobalPlugins/frequentText/__init__.py | 771 +++++++++---------- addon/GlobalPlugins/frequentText/update.py | 154 ---- addon/doc/es/readme.md | 10 +- addon/doc/pt_BR/readme.md | 10 +- addon/doc/pt_PT/readme.md | 10 +- addon/locale/ar/LC_MESSAGES/nvda.po | 220 ++++++ addon/locale/es/LC_MESSAGES/nvda.po | 178 ++--- addon/locale/pt_BR/LC_MESSAGES/nvda.po | 179 +++-- addon/locale/pt_PT/LC_MESSAGES/nvda.po | 176 ++--- addon/locale/sr/LC_MESSAGES/nvda.po | 156 ++-- addon/locale/tr/LC_MESSAGES/nvda.po | 241 ++++++ buildVars.py | 10 +- readme.md | 15 +- sconstruct | 232 ++++-- 16 files changed, 1401 insertions(+), 1019 deletions(-) create mode 100644 2023.5.30.json create mode 100644 _template_addon_release.json delete mode 100644 addon/GlobalPlugins/frequentText/update.py create mode 100644 addon/locale/ar/LC_MESSAGES/nvda.po create mode 100644 addon/locale/tr/LC_MESSAGES/nvda.po diff --git a/2023.5.30.json b/2023.5.30.json new file mode 100644 index 0000000..2cfa192 --- /dev/null +++ b/2023.5.30.json @@ -0,0 +1,29 @@ +{ + "addonId": "frequentText", + "displayName": "Regists blocks of text frequently used", + "URL": "", + "description": "Stores and make possible the entry of frequently used blocks of text. Command: Windows+F12.", + "sha256": "700a5e7618d223339aa1392b7b5030564f38ea6b4f4c91b5e53ee52a0c73a370", + "homepage": "https://github.com/ruifontes/frequentText", + "addonVersionName": "2023.05.30", + "addonVersionNumber": { + "major": 2023, + "minor": 5, + "patch": 30 + }, + "minNVDAVersion": { + "major": 2021, + "minor": 1, + "patch": 0 + }, + "lastTestedVersion": { + "major": 2023, + "minor": 1, + "patch": 0 + }, + "channel": "stable", + "publisher": "", + "sourceURL": "https://github.com/ruifontes/frequentText", + "license": "GPL 2", + "licenseURL": "https://www.gnu.org/licenses/old-licenses/gpl-2.0.html" +} \ No newline at end of file diff --git a/_template_addon_release.json b/_template_addon_release.json new file mode 100644 index 0000000..c6d3a5f --- /dev/null +++ b/_template_addon_release.json @@ -0,0 +1,29 @@ +{ + "addonId": "easyAddonTech.XYZ", + "addonVersionNumber": { + "major": 21, + "minor": 6, + "patch": 0 + }, + "addonVersionName": "21.06", + "displayName": "My addon", + "publisher": "easyAddonTech", + "description": "Makes doing XYZ easier", + "homepage": "https://github.com/nvaccess/addon-datastore", + "minNVDAVersion": { + "major": 2019, + "minor": 3, + "patch": 0 + }, + "lastTestedVersion": { + "major": 2020, + "minor": 4, + "patch": 0 + }, + "channel": "beta", + "URL": "https://github.com/nvaccess/addon-datastore/releases/download/v0.1.0/myAddon.nvda-addon", + "sha256": "69D84CA8899800A5575CE31798293CD4FEBAB1D734A07C2E51E56A28E0DF8C82", + "sourceURL": "https://github.com/nvaccess/addon-datastore/", + "license": "GPL v2", + "licenseURL": "https://github.com/nvaccess/addon-datastore/license.MD" +} diff --git a/addon/GlobalPlugins/frequentText/__init__.py b/addon/GlobalPlugins/frequentText/__init__.py index 7cfb783..092a58c 100644 --- a/addon/GlobalPlugins/frequentText/__init__.py +++ b/addon/GlobalPlugins/frequentText/__init__.py @@ -1,437 +1,391 @@ #-*- coding: utf-8 -*- # frequentText add-on for NVDA. -# written by Rui Fontes and Ângelo Abrantes # Regists, manage and allow to paste frequently used blocks of text # Shortcut: WINDOWS+F12 +# written by Rui Fontes , Ângelo Abrantes and Abel Passos do Nascimento Jr. +# Copyright (C) 2020-2023 Rui Fontes +# This file is covered by the GNU General Public License. +# See the file COPYING for more details. + +# Import the necessary modules +import globalPluginHandler +import globalVars import os -import gui -import wx +import core import api +import wx +import gui from keyboardHandler import KeyboardInputGesture from configobj import ConfigObj import time import watchdog -import globalPluginHandler from scriptHandler import script import addonHandler -# For update process -from . update import * -# For translation process + +# To start the translation process addonHandler.initTranslation() # Global vars _ffIniFile = os.path.join(os.path.dirname(__file__), "frequentText.ini") -Catg = "" -dictBlocks = {} -defCatg = "" +config = ConfigObj(_ffIniFile, list_values = True, encoding = "utf-8") +defCatg = 0 +category = 0 + +def listCategories(): + listCatgs = config.keys() + return listCatgs + +def listTextBlocks(catg): + listCatgs = listCategories() + listBlocks = [] + Catg = catg + catg = listCatgs[Catg] + dictBlocks = config[catg] + keys = dictBlocks.keys() + keys.sort() + for item in keys: + k = item + listBlocks.append(k) + return listBlocks, dictBlocks + +# To avoid use on secure screens +if globalVars.appArgs.secure: + # Override the global plugin to disable it. + GlobalPlugin = globalPluginHandler.GlobalPlugin class GlobalPlugin(globalPluginHandler.GlobalPlugin): def __init__(self): super(globalPluginHandler.GlobalPlugin, self).__init__() self.dialog = None - # To allow waiting end of network tasks - core.postNvdaStartup.register(self.networkTasks) - - def networkTasks(self): - # Calling the update process... - _MainWindows = Initialize() - _MainWindows.start() - - def terminate(self): - core.postNvdaStartup.unregister(self.networkTasks) - - def readConfig(self): - global Catg - if not os.path.isfile(_ffIniFile): - return None - config = ConfigObj(_ffIniFile, list_values = True, encoding = "utf-8") - blocks = config[Catg] - total = len(blocks.keys()) - if not total: - return None - if not len(blocks.keys()): - blocks = None - return blocks @script( - # For translators: Message to be announced during Keyboard Help - description = _("Opens a dialog box to registe, manage and paste frequent blocks of text."), - # For translators: Name of the section in "Input gestures" dialog. - category = _("Text editing"), - gesture = "kb:WINDOWS+f12", - allowInSleepMode = True) + # Translators: Message to be announced during Keyboard Help + description = _("Opens a dialog box to registe, manage and paste frequent blocks of text."), + # Translators: Name of the section in "Input gestures" dialog. + category = _("Text editing"), + gesture = "kb:WINDOWS+f12", + allowInSleepMode = True) def script_startFrequentText(self, gesture): - self.showFrequentTextCatgsDialog(self) - - def showFrequentTextCatgsDialog (self, listCatgs): - # Displays the categories list dialog box. - config = ConfigObj(_ffIniFile, list_values = True, encoding = "utf-8") - listCatgs = config.keys() - # Translators: Title of categories list dialog box. - self.dialog = FrequentTextCatgsDialog(gui.mainFrame, _("Frequent text"), listCatgs) - self.dialog.updateCatgs(listCatgs, 0) - - if not self.dialog.IsShown(): - gui.mainFrame.prePopup() - self.dialog.Show() - self.dialog.CentreOnScreen() - gui.mainFrame.postPopup() - - def showFrequentTextDialog(self, dictBlocks): - # Displays the blocks list dialog box. - config = ConfigObj(_ffIniFile, list_values = True, encoding = "utf-8") - dictBlocks = config[Catg] - # Translators: Title of Blocks list dialog boxes. - self.dialog = FrequentTextDialog(gui.mainFrame, _("Frequent text"), dictBlocks) - self.dialog.updateBlocks(dictBlocks, 0) - - if not self.dialog.IsShown(): - gui.mainFrame.prePopup() - self.dialog.Show() - self.dialog.CentreOnScreen() - gui.mainFrame.postPopup() + # Invoke the corresponding dialog + gui.mainFrame._popupSettingsDialog(FrequentTextCatgsDialog) @script( - # For translators: Message to be announced during Keyboard Help - description = _("Opens a dialog box with the text blocks of first or default category"), - # For translators: Name of the section in "Input gestures" dialog. - category = _("Text editing"), - gesture = "kb:Control+WINDOWS+f12", - allowInSleepMode = True) + # Ttranslators: Message to be announced during Keyboard Help + description = _("Opens a dialog box with the text blocks of first or default category"), + # Translators: Name of the section in "Input gestures" dialog. + category = _("Text editing"), + gesture = "kb:Control+WINDOWS+f12", + allowInSleepMode = True) def script_startFrequentTextDefault(self, gesture): - global Catg, defCatg - config = ConfigObj(_ffIniFile, list_values = True, encoding = "utf-8") - listCatgs = config.keys() - if defCatg == "": - Catg = listCatgs[0] + # Invoke the corresponding dialog + global defCatg, category + print(str(category) + " " + str(defCatg)) + if defCatg == 0: + category = 0 else: - Catg = defCatg - self.showFrequentTextDialog(self) + category = defCatg + print(str(category) + " " + str(defCatg)) + gui.mainFrame._popupSettingsDialog(FrequentTextDialog) def terminate (self): if self.dialog is not None: self.dialog.Destroy() -# To avoid use on secure screens -if globalVars.appArgs.secure: - # Override the global plugin to disable it. - GlobalPlugin = globalPluginHandler.GlobalPlugin - - class FrequentTextCatgsDialog(wx.Dialog): + def __init__(self, *args, **kwds): + kwds["style"] = kwds.get("style", 0) | wx.DEFAULT_DIALOG_STYLE + wx.Dialog.__init__(self, *args, **kwds) + self.title = _("Frequent text") + if not os.path.isfile(_ffIniFile): + with open(_ffIniFile, "w") as file: + pass + self.listCatgs = listCategories() - def __init__(self, parent, title, listCatgs): - self.title = title - self.listCatgs = listCatgs - self.dialogActive = False - super(FrequentTextCatgsDialog, self).__init__(parent, title=title) - # Create interface - mainSizer = wx.BoxSizer(wx.VERTICAL) - tasksSizer = wx.BoxSizer(wx.VERTICAL) - tasksSizer1 = wx.BoxSizer(wx.VERTICAL) - # Create a label and a list view for categories list. - # Label is above the list view. + sizer_1 = wx.BoxSizer(wx.VERTICAL) + + # Create a label and a list view for categories list. Label is above the list view. # Translators: Label the list view that contains the categories - tasksLabel = wx.StaticText(self, -1, label = _("Categories list")) - tasksSizer.Add(tasksLabel) + listLabel = wx.StaticText(self, wx.ID_ANY, _("Categories list")) + sizer_1.Add(listLabel, 0, 0, 0) - # create a list view. - self.listBoxCatgs = wx.ListCtrl(self, size=(800, 250), style = wx.LC_REPORT | wx.BORDER_SUNKEN | wx.LC_SORT_ASCENDING) - tasksSizer.Add(self.listBoxCatgs, proportion=8) + self.CatgsList = wx.ListBox(self, wx.ID_ANY, choices=self.listCatgs, style=wx.LB_SINGLE | wx.LB_SORT) + self.CatgsList.SetFocus() + if len(self.listCatgs) != 0: + self.CatgsList.SetSelection(0) + sizer_1.Add(self.CatgsList, 0, 0, 0) - # Create buttons. - # Buttons are in a horizontal row - buttonsSizer = wx.BoxSizer(wx.HORIZONTAL) + sizer_2 = wx.StdDialogButtonSizer() + sizer_1.Add(sizer_2, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.ALL, 4) - showButtonID = wx.Window.NewControlId() - # Translators: Button Label to show the entries in the selected category - self.showButton = wx.Button(self, showButtonID, _("&Show entries")) - buttonsSizer.Add (self.showButton) + # Translators: Button Label to show the entries of a category + self.showButton = wx.Button(self, wx.ID_ANY, _("&Show entries")) + if len(self.listCatgs) != 0: + self.showButton.SetDefault() + sizer_2.Add(self.showButton, 0, 0, 0) - addButtonID = wx.Window.NewControlId() # Translators: Button Label to add a new category - self.addButton = wx.Button(self, addButtonID, _("&Add")) - buttonsSizer.Add (self.addButton) + self.addButton = wx.Button(self, wx.ID_ANY, _("&Add")) + if len(self.listCatgs) == 0: + self.addButton.SetDefault() + sizer_2.Add(self.addButton, 0, 0, 0) - renameButtonID = wx.Window.NewControlId() # Translators: Button Label that renames the name of the selected block. - self.renameButton = wx.Button(self, renameButtonID, _("Re&name")) - buttonsSizer.Add (self.renameButton) + self.renameButton = wx.Button(self, wx.ID_ANY, _("Re&name")) + sizer_2.Add(self.renameButton, 0, 0, 0) - setAsDefaultButtonID = wx.Window.NewControlId() # Translators: Button Label to set the selected category as default - self.setAsDefaultButton = wx.Button(self, setAsDefaultButtonID, _("Set &category as default")) - buttonsSizer.Add (self.setAsDefaultButton) + self.setAsDefaultButton = wx.Button(self, wx.ID_ANY, _("Set &category as default")) + sizer_2.Add(self.setAsDefaultButton, 0, 0, 0) - removeButtonID = wx.Window.NewControlId() - # Translators: Button Label that removes the selected block. - self.removeButton = wx.Button (self, removeButtonID, _("&Remove")) - buttonsSizer.Add (self.removeButton) + # Translators: Button Label that removes the selected category. + self.removeButton = wx.Button(self, wx.ID_ANY, _("&Remove")) + sizer_2.Add(self.removeButton, 0, 0, 0) - # Translators: Button Label that closes the add-on. - cancelButton = wx.Button(self, wx.ID_CANCEL, _("&Close")) - buttonsSizer.Add(cancelButton) + self.button_CLOSE = wx.Button(self, wx.ID_CLOSE, "") + sizer_2.AddButton(self.button_CLOSE) if len(self.listCatgs) == 0: - buttonsSizer.Hide(self.showButton) - buttonsSizer.Hide(self.renameButton) - buttonsSizer.Hide(self.setAsDefaultButton) - buttonsSizer.Hide(self.removeButton) - - tasksSizer.Add(buttonsSizer) - mainSizer.Add(tasksSizer) - - # Bind the buttons. - self.Bind(wx.EVT_BUTTON, self.onShow, id = showButtonID) - self.Bind(wx.EVT_BUTTON, self.onAdd, id = addButtonID) - self.Bind(wx.EVT_BUTTON, self.onRename, id = renameButtonID) - self.Bind(wx.EVT_BUTTON, self.onSetAsDefault, id = setAsDefaultButtonID) - self.Bind(wx.EVT_BUTTON, self.onRemove, id = removeButtonID) - self.listBoxCatgs.Bind(wx.EVT_KEY_DOWN, self.onKeyPress) - mainSizer.Fit(self) - self.SetSizer(mainSizer) + self.showButton.Hide() + self.renameButton.Hide() + self.setAsDefaultButton.Hide() + self.removeButton.Hide() + + sizer_2.Realize() + + self.SetSizer(sizer_1) + sizer_1.Fit(self) + + self.SetEscapeId(self.button_CLOSE.GetId()) + + self.Layout() + self.Centre() + + self.Bind(wx.EVT_BUTTON, self.onShow, self.showButton) + self.Bind(wx.EVT_BUTTON, self.onAdd, self.addButton) + self.Bind(wx.EVT_BUTTON, self.onRename, self.renameButton) + self.Bind(wx.EVT_BUTTON, self.onSetAsDefault, self.setAsDefaultButton) + self.Bind(wx.EVT_BUTTON, self.onRemove, self.removeButton) + self.CatgsList.Bind(wx.EVT_KEY_DOWN, self.onKeyPress) + + def onShow(self, evt): + index = self.CatgsList.GetSelection() + catgIDX = self.listCatgs.index(self.CatgsList.GetString(index)) + self.Close() + global category + category = catgIDX + gui.mainFrame._popupSettingsDialog(FrequentTextDialog) + #return def onAdd (self, evt): # Add a new category evt.Skip() # Translators: Message dialog box to add a name to a new category - dlg = wx.TextEntryDialog(gui.mainFrame, _("Enter a name for the category"), self.title) - dlg.SetValue("") - if dlg.ShowModal() == wx.ID_OK: - nameCatg = dlg.GetValue() - nameCatg = nameCatg.upper() - - if nameCatg != "": - if self.listBoxCatgs.FindItem (0, nameCatg) != -1: - # Translators: Announcement that the category name already exists in the list. - gui.messageBox (_("There is already a category with this name!"), self.title) - self.onAdd(evt) - return - else: - #Saving the category - config = ConfigObj(_ffIniFile, list_values = True, encoding = "utf-8") - config[nameCatg] = {} - config.write() - # Puts the focus on the inserted category - listCatgs = config.keys() - self.updateCatgs(listCatgs, 0) - idx = self.listBoxCatgs.FindItem(0, nameCatg) - self.listBoxCatgs.Focus(idx) - self.listBoxCatgs.Select(idx) - self.listBoxCatgs.SetFocus() - # Redraw the dialog box to adapt the buttons - if len(listCatgs) == 1: - self.Close() - GlobalPlugin.showFrequentTextCatgsDialog(self, listCatgs) + nameCatg = wx.GetTextFromUser(_("Enter a name for the category"), self.title).strip().upper() + if nameCatg != "": + if nameCatg in self.listCatgs: + # Translators: Announcement that the category name already exists in the list. + wx.MessageBox (_("There is already a category with this name!"), self.title) + self.onAdd(evt) + return + else: + # Saving the category + config[nameCatg] = {} + config.write() + # Update the list of categories and the listbox + self.listCatgs = config.keys() + self.CatgsList.Set(self.listCatgs) + # Place the focus on the inserted category + idx = self.CatgsList.FindString(nameCatg) + self.CatgsList.SetSelection(idx) + self.CatgsList.SetFocus() + # Redraw the dialog box to adapt the buttons + if len(self.listCatgs) == 1: + self.Destroy() + gui.mainFrame._popupSettingsDialog(FrequentTextCatgsDialog) return else: - dlg.Destroy() + return def onRename(self, evt): # Renames the selected category evt.Skip() - index = self.listBoxCatgs.GetFocusedItem() - nameCatg = self.listBoxCatgs.GetItemText(index) + index = self.CatgsList.GetSelection() + nameCatg = self.CatgsList.GetString(index) self.dialogActive = True # Translators: Message dialog to rename the category newKeyCatg = wx.GetTextFromUser(_("Enter a new name for %s") %nameCatg, self.title).strip().upper() if newKeyCatg != "": - if self.listBoxCatgs.FindItem(0, newKeyCatg) == -1: + if newKeyCatg not in self.listCatgs: # update the dictionaries - config = ConfigObj(_ffIniFile, list_values = True, encoding = "utf-8") config.rename(nameCatg, newKeyCatg) config.write() + # Update the list of categories and the listbox self.listCatgs = config.keys() - listCatgs = config.keys() - # update the list view. - self.updateCatgs(listCatgs, index) - idx = self.listBoxCatgs.FindItem(0, newKeyCatg) - self.listBoxCatgs.Focus(idx) - self.listBoxCatgs.Select(idx) - self.listBoxCatgs.SetFocus() + self.CatgsList.Set(self.listCatgs) + # Place the focus on the inserted category + idx = self.CatgsList.FindString(newKeyCatg) + self.CatgsList.SetSelection(idx) + self.CatgsList.SetFocus() return - else: - gui.messageBox (_("There is already a category with this name!"), self.title) + else: + wx.MessageBox (_("There is already a category with this name!"), self.title) self.dialogActive = False def onSetAsDefault(self, evt): # Set the selected category as default evt.Skip() - global defCatg, listCatgs - index = self.listBoxCatgs.GetFocusedItem() - defCatg = self.listBoxCatgs.GetItemText(index) - self.listBoxCatgs.Focus(index) - self.listBoxCatgs.Select(index) - self.listBoxCatgs.SetFocus() + global defCatg + index = self.CatgsList.GetSelection() + defCatg = self.listCatgs.index(self.CatgsList.GetString(index)) + # Return focus to the listbox + self.CatgsList.SetFocus() + return def onRemove (self, evt): # Removes the selected category evt.Skip() - index = self.listBoxCatgs.GetFocusedItem() - nameCatg = self.listBoxCatgs.GetItemText(index) + index = self.CatgsList.GetSelection() + nameCatg = self.CatgsList.GetString(index) self.dialogActive = True - # Translators: Message dialog box to remove the selected category - if gui.messageBox(_("Are you sure you want to remove %s?") %nameCatg, self.title, style=wx.ICON_QUESTION|wx.YES_NO) == wx.YES: - config = ConfigObj(_ffIniFile, list_values = True, encoding = "utf-8") + # Translators: Message asking if user wants to remove the selected category + if wx.MessageBox(_("Are you sure you want to remove %s?") %nameCatg, self.title, style=wx.ICON_QUESTION|wx.YES_NO) == wx.YES: config.__delitem__(nameCatg) config.write() - self.listBoxCatgs.DeleteItem(index) - if self.listBoxCatgs.GetItemCount(): - self.listBoxCatgs.Select(self.listBoxCatgs.GetFocusedItem()) + # Update the list of categories and the listbox + self.listCatgs = config.keys() + self.CatgsList.Set(self.listCatgs) + # If list box have itens, select the first + if len(self.listCatgs) != 0: + self.CatgsList.SetSelection(0) self.dialogActive = False - self.listBoxCatgs.SetFocus() + self.CatgsList.SetFocus() return else: - self.Close() - GlobalPlugin.showFrequentTextCatgsDialog(self, self.listCatgs) + self.Destroy() + gui.mainFrame._popupSettingsDialog(FrequentTextCatgsDialog) def onKeyPress(self, evt): # Sets enter key to show the entries and delete to remove it. evt.Skip() keycode = evt.GetKeyCode() - if keycode == wx.WXK_RETURN and self.listBoxCatgs.GetItemCount(): + print(str(keycode)) + if keycode == wx.WXK_RETURN and self.CatgsList.GetCount(): self.onShow(evt) - elif keycode == wx.WXK_RETURN and not self.listBoxCatgs.GetItemCount(): + elif keycode == wx.WXK_RETURN and self.CatgsList.GetCount() == 0: self.onAdd(evt) - elif keycode == wx.WXK_DELETE and self.listBoxCatgs.GetItemCount(): + elif keycode == wx.WXK_DELETE and self.CatgsList.GetCount(): self.onRemove(evt) - def onShow(self, evt): - global Catg - index = self.listBoxCatgs.GetFocusedItem() - Catg = self.listBoxCatgs.GetItemText(index) - self.Close() - GlobalPlugin.showFrequentTextDialog(self, dictBlocks) - return - - def updateCatgs(self, listCatgs, index): - config = ConfigObj(_ffIniFile, list_values = True) - listCatgs = config.keys() - self.listBoxCatgs.ClearAll() - # Translators: Title of the column of the list view. - self.listBoxCatgs.InsertColumn(0, _("Name")) - self.listBoxCatgs.SetColumnWidth (0,250) - if listCatgs == None: - return - x = 0 - while x <= len(listCatgs)-1: - listCatgs[x] - self.listBoxCatgs.Append([listCatgs[x]]) - x = x+1 - self.listBoxCatgs.Select(0) - self.listBoxCatgs.Focus(0) - class FrequentTextDialog(wx.Dialog): + def __init__(self, *args, **kwds): + kwds["style"] = kwds.get("style", 0) | wx.DEFAULT_DIALOG_STYLE + wx.Dialog.__init__(self, *args, **kwds) + self.title = _("Frequent text") + self.category = category + print(str(self.category)) + self.listCatgs = config.keys() + self.catg = category + catg = self.listCatgs[self.catg] + self.listBlocks, self.dictBlocks = listTextBlocks(self.catg) + + sizer_1 = wx.BoxSizer(wx.VERTICAL) - def __init__(self, parent, title, dictBlocks): - self.title = title - self.dictBlocks = dictBlocks - self.dialogActive = False - super(FrequentTextDialog, self).__init__(parent, title=title) - # Create interface - mainSizer = wx.BoxSizer(wx.VERTICAL) - tasksSizer = wx.BoxSizer(wx.VERTICAL) - tasksSizer1 = wx.BoxSizer(wx.VERTICAL) - # Create a label and a list view for Frequent Text list. + # Create a label and a list view for categories list. # Label is above the list view. - # Translators: Label the list view that contains the Blocks. - tasksLabel = wx.StaticText(self, -1, label = _("List of text blocks of %s category") %Catg) - tasksSizer.Add(tasksLabel) + # Translators: Label the list view that contains the categories + listLabel = wx.StaticText(self, wx.ID_ANY, _("List of text blocks of %s category") %catg) + sizer_1.Add(listLabel, 0, 0, 0) - # create a list view. - self.listBox = wx.ListCtrl(self, size=(800, 250), style = wx.LC_REPORT | wx.BORDER_SUNKEN | wx.LC_SORT_ASCENDING) - tasksSizer.Add(self.listBox, proportion=8) + self.BlocksList = wx.ListBox(self, wx.ID_ANY, choices=self.listBlocks, style=wx.LB_SINGLE | wx.LB_SORT) + self.BlocksList.SetFocus() + if len(self.listBlocks) != 0: + self.BlocksList.SetSelection(0) + sizer_1.Add(self.BlocksList, 0, 0, 0) - # Create buttons. - # Buttons are in a horizontal row - buttonsSizer = wx.BoxSizer(wx.HORIZONTAL) + sizer_2 = wx.StdDialogButtonSizer() + sizer_1.Add(sizer_2, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.ALL, 4) - addButtonID = wx.Window.NewControlId() - # Translators: Button Label to add a new block. - self.addButton = wx.Button(self, addButtonID, _("&Add")) - buttonsSizer.Add (self.addButton) + # Translators: Button Label to add a new category + self.addButton = wx.Button(self, wx.ID_ANY, _("&Add")) + if len(self.listBlocks) == 0: + self.addButton.SetDefault() + sizer_2.Add(self.addButton, 0, 0, 0) - pasteButtonID = wx.Window.NewControlId() # Translators: Button Label that paste the block to the edit box. - self.pasteButton = wx.Button (self, pasteButtonID, _("&Paste")) - buttonsSizer.Add(self.pasteButton) + self.pasteButton = wx.Button(self, wx.ID_ANY, _("&Paste")) + if len(self.listBlocks) != 0: + self.pasteButton.SetDefault() + sizer_2.Add(self.pasteButton, 0, 0, 0) - renameButtonID = wx.Window.NewControlId() # Translators: Button Label that renames the name of the selected block. - self.renameButton = wx.Button(self, renameButtonID, _("Re&name")) - buttonsSizer.Add (self.renameButton) + self.renameButton = wx.Button(self, wx.ID_ANY, _("Re&name")) + sizer_2.Add(self.renameButton, 0, 0, 0) - changeButtonID = wx.Window.NewControlId() # Translators: Button Label that change the blocks of text. - self.changeButton = wx.Button(self, changeButtonID, _("&Change blocks")) - buttonsSizer.Add (self.changeButton) + self.changeButton = wx.Button(self, wx.ID_ANY, _("&Change blocks")) + sizer_2.Add(self.changeButton, 0, 0, 0) - moveButtonID = wx.Window.NewControlId() - # Translators: Label for btton to move the selected block to other category. - self.moveButton = wx.Button (self, moveButtonID, _("&Move")) - buttonsSizer.Add (self.moveButton) + # Translators: Label for button to move the selected block to other category. + self.moveButton = wx.Button(self, wx.ID_ANY, _("&Move")) + sizer_2.Add(self.moveButton, 0, 0, 0) - removeButtonID = wx.Window.NewControlId() # Translators: Button Label that removes the selected block. - self.removeButton = wx.Button (self, removeButtonID, _("&Remove")) - buttonsSizer.Add (self.removeButton) + self.removeButton = wx.Button(self, wx.ID_ANY, _("&Remove")) + sizer_2.Add(self.removeButton, 0, 0, 0) - goBackButtonID = wx.Window.NewControlId() # Translators: Label for button to go back to categories list. - self.goBackButton = wx.Button (self, goBackButtonID, _("&Back to categories")) - buttonsSizer.Add (self.goBackButton) - - # Translators: Button Label that closes the add-on. - cancelButton = wx.Button(self, wx.ID_CANCEL, _("&Close")) - buttonsSizer.Add(cancelButton) - - if len(dictBlocks) == 0: - buttonsSizer.Hide(self.pasteButton) - buttonsSizer.Hide(self.renameButton) - buttonsSizer.Hide(self.changeButton) - buttonsSizer.Hide(self.moveButton) - buttonsSizer.Hide(self.removeButton) - - tasksSizer.Add(buttonsSizer) - mainSizer.Add(tasksSizer) - - # Bind the buttons. - self.Bind(wx.EVT_BUTTON, self.onAdd, id = addButtonID) - self.Bind (wx.EVT_BUTTON, self.onPaste, id = pasteButtonID ) - self.Bind(wx.EVT_BUTTON, self.onRename, id = renameButtonID) - self.Bind(wx.EVT_BUTTON, self.onChangeBlocks, id = changeButtonID) - self.Bind(wx.EVT_BUTTON, self.onMove, id = moveButtonID) - self.Bind(wx.EVT_BUTTON, self.onRemove, id = removeButtonID) - self.Bind(wx.EVT_BUTTON, self.goBack, id = goBackButtonID) - self.listBox.Bind(wx.EVT_KEY_DOWN, self.onKeyPress) - mainSizer.Fit(self) - self.SetSizer(mainSizer) + self.goBackButton = wx.Button(self, wx.ID_ANY, _("&Back to categories")) + sizer_2.Add(self.goBackButton, 0, 0, 0) - def onAdd (self, evt): + self.button_CLOSE = wx.Button(self, wx.ID_CLOSE, "") + sizer_2.AddButton(self.button_CLOSE) + + if self.BlocksList.GetCount() == 0: + self.pasteButton.Hide() + self.renameButton.Hide() + self.changeButton.Hide() + self.moveButton.Hide() + self.removeButton.Hide() + + sizer_2.Realize() + + self.SetSizer(sizer_1) + sizer_1.Fit(self) + + self.SetEscapeId(self.button_CLOSE.GetId()) + + self.Layout() + self.Centre() + + self.Bind(wx.EVT_BUTTON, self.onAdd, self.addButton) + self.Bind(wx.EVT_BUTTON, self.onPaste, self.pasteButton) + self.Bind(wx.EVT_BUTTON, self.onRename, self.renameButton) + self.Bind(wx.EVT_BUTTON, self.onChangeBlocks, self.changeButton) + self.Bind(wx.EVT_BUTTON, self.onMove, self.moveButton) + self.Bind(wx.EVT_BUTTON, self.onRemove, self.removeButton) + self.Bind(wx.EVT_BUTTON, self.onGoBack, self.goBackButton) + self.BlocksList.Bind(wx.EVT_KEY_DOWN, self.onKeyPress) + + def onAdd(self, evt): # Add a new block of text. evt.Skip() # Translators: Message dialog box to add a name to a new block. - dlg = wx.TextEntryDialog(gui.mainFrame, _("Enter a name for the block"), self.title) - dlg.SetValue("") - if dlg.ShowModal() == wx.ID_OK: - name = dlg.GetValue() - name = name.upper() - - if name != "": - if self.listBox.FindItem (0, name) != -1: - # Translators: Announcement that the block name already exists in the list. - gui.messageBox (_("There is already a block with this name!"), self.title) - self.onAdd(evt) - return - else: - self._addBlock(name) + name = wx.GetTextFromUser(_("Enter a name for the block"), self.title).strip().upper() + if name != "": + if name in self.listBlocks: + # Translators: Announcement that the block name already exists in the list. + wx.MessageBox (_("There is already a block with this name!"), self.title) + self.onAdd(evt) + return + else: + self._addBlock(name) else: - dlg.Destroy() + self.BlocksList.SetFocus() def _addBlock(self, name): # Translators: Message dialog box to add a new block of text. @@ -449,33 +403,38 @@ def _addBlock(self, name): return # Saving the block - config = ConfigObj(_ffIniFile, list_values=True, encoding = "utf-8") - if Catg in config.sections: - blocks = config[Catg] + catg = self.listCatgs[self.catg] + if catg in config.sections: + blocks = config[catg] blocks.__setitem__(name, newBlock) else: - config[Catg] = {name:newBlock} + config[catg] = {name:newBlock} config.write() - self.listBox.Append([name]) - newIndex = self.listBox.FindItem(0,name) + # Update listBlocks e blocksList + self.listBlocks, self.dictBlocks = listTextBlocks(self.catg) + self.BlocksList.Set(self.listBlocks) # Puts the focus on the inserted block. - self.listBox.Focus (newIndex) - self.listBox.Select(newIndex) - self.listBox.SetFocus() - # Redraw the dialog box to adapt the buttons - self.Close() - GlobalPlugin.showFrequentTextDialog(self, dictBlocks) + idx = self.BlocksList.FindString(name) + self.BlocksList.SetSelection(idx) + self.BlocksList.SetFocus() + if self.BlocksList.GetCount() == 1: + self.pasteButton.Show() + self.renameButton.Show() + self.changeButton.Show() + self.moveButton.Show() + self.removeButton.Show() return - def onPaste (self, evt): + def onPaste(self, evt): # Simulates typing the block of text in the edit area. self.Hide() evt.Skip() - config = ConfigObj(_ffIniFile, list_values = True, encoding = "utf-8") - blocks = config[Catg] - index=self.listBox.GetFocusedItem() - name = self.listBox.GetItemText(index) - paste = blocks[name] + # Get the name of selected block + name = self.BlocksList.GetString(self.BlocksList.GetSelection()) + # Get blocks list and blocks dictionary of the category + blocks, dictBlocks = listTextBlocks(self.catg) + # Gets the selected block contents + paste = dictBlocks[name] pasteStr = "\r\n".join(paste) if len(paste) >= 2: pasteStr += "\r\n" @@ -494,7 +453,7 @@ def onPaste (self, evt): KeyboardInputGesture.fromName("Control+v").send() else: api.copyToClip(pasteStr) - time.sleep(0.1) + time.sleep(0.01) api.processPendingEvents(False) focus = api.getFocusObject() if focus.windowClassName == "ConsoleWindowClass": @@ -504,48 +463,48 @@ def onPaste (self, evt): else: KeyboardInputGesture.fromName("Control+v").send() core.callLater(300, lambda: api.copyToClip(clipboardBackup)) + self.Destroy() def onRename(self, evt): # Renames the selected block. evt.Skip() - index=self.listBox.GetFocusedItem() - name = self.listBox.GetItemText(index) + index=self.BlocksList.GetSelection() + name = self.BlocksList.GetString(index) + catg = self.listCatgs[self.catg] self.dialogActive = True # Translators: Message dialog to rename the block of text. newKey = wx.GetTextFromUser(_("Enter a new name for %s") %name, self.title).strip().upper() if newKey != "": - if self.listBox.FindItem(0, newKey) == -1: - config = ConfigObj(_ffIniFile, list_values=True, encoding = "utf-8") - blocks = config[Catg] - paste = blocks[name] + if newKey not in self.listBlocks: + # Save the new name + blocks = config[catg] # update the dictionary. blocks.rename(name, newKey) config.write() - - # update the list view. - keys = blocks.keys() - keys.sort() - newIndex = keys.index (newKey) - self.updateBlocks (blocks, newIndex) - self.listBox.SetFocus() - + # Update listBlocks e blocksList + self.listBlocks, self.dictBlocks = listTextBlocks(self.catg) + self.BlocksList.Set(self.listBlocks) + # Puts the focus on the inserted block. + idx = self.BlocksList.FindString(newKey) + self.BlocksList.SetSelection(idx) + self.BlocksList.SetFocus() else: gui.messageBox (_("There is already a block with this name!"), self.title) self.dialogActive = False def onChangeBlocks(self, evt): evt.Skip() - index=self.listBox.GetFocusedItem() - name = self.listBox.GetItemText(index) - config = ConfigObj(_ffIniFile, list_values=True, encoding = "utf-8") - blocks = config[Catg] + index=self.BlocksList.GetSelection() + name = self.BlocksList.GetString(index) + catg = self.listCatgs[self.catg] + self.dialogActive = True + blocks = config[catg] paste = blocks[name] oldBlock = "" for x in range(len(paste)): oldBlock += ("%s \n")%paste[x] x = x+1 self.dialogActive = True - # Translators: Message dialog box to change a block of text. dlg = wx.TextEntryDialog(gui.mainFrame, _("Change the block of text as you want and press Tab to Ok button and Enter to confirm"), self.title, style = wx.OK | wx.CANCEL | wx.TE_MULTILINE) dlg.SetValue(oldBlock) @@ -554,115 +513,105 @@ def onChangeBlocks(self, evt): else: dlg.Destroy() return - if nBlock != "": changeBlock = nBlock.split("\n") else: dlg.Destroy() return - # update the dictionary. blocks.__delitem__(name) blocks.__setitem__(name, changeBlock) config.write() + # Update listBlocks e blocksList + self.listBlocks, self.dictBlocks = listTextBlocks(self.catg) + self.BlocksList.Set(self.listBlocks) + # Puts the focus on the inserted block. + idx = self.BlocksList.FindString(name) + self.BlocksList.SetSelection(idx) + self.BlocksList.SetFocus() - # update the list view. - keys = blocks.keys() - keys.sort() - newIndex = keys.index (name) - self.updateBlocks (blocks, newIndex) - self.listBox.SetFocus() - - def onMove (self, evt): + def onMove(self, evt): # Moves the selected block to other category. evt.Skip() - config = ConfigObj(_ffIniFile, list_values=True, encoding = "utf-8") - index=self.listBox.GetFocusedItem() - name = self.listBox.GetItemText(index) - blocks = config[Catg] + index=self.BlocksList.GetSelection() + name = self.BlocksList.GetString(index) + catg = self.listCatgs[self.catg] + blocks = config[catg] textBlock = blocks[name] self.dialogActive = True # Translators: Message dialog box to move the selected block to other category. - newCatg = wx.GetTextFromUser(_("If you really want to move %s from %s category, enter the name of the new, already existing, category") %(name, Catg), self.title).strip().upper() + newCatg = wx.GetTextFromUser(_("If you really want to move %s from %s category, enter the name of the new, already existing, category") %(name, catg), self.title).strip().upper() if newCatg != "": listCatgs = config.keys() if str(newCatg) in listCatgs: blocks = config[newCatg] blocks.__setitem__ (name, textBlock) - blocks = config[Catg] + blocks = config[catg] blocks.__delitem__(name) config.write() - self.listBox.DeleteItem(index) - if self.listBox.GetItemCount(): - self.listBox.Select(self.listBox.GetFocusedItem()) - self.dialogActive = False - self.listBox.SetFocus() + # Update listBlocks e blocksList + self.listBlocks, self.dictBlocks = listTextBlocks(self.catg) + self.BlocksList.Set(self.listBlocks) + # Put focus on the blocks list and in the first block. + if self.BlocksList.GetCount(): + self.BlocksList.Select(0) + elif self.BlocksList.GetCount() == 0: + self.pasteButton.Hide() + self.renameButton.Hide() + self.changeButton.Hide() + self.moveButton.Hide() + self.removeButton.Hide() + self.BlocksList.SetFocus() else: # Translators: Announcement that the category does not exists. gui.messageBox (_("There is no such category!"), self.title) self.onMove(evt) else: self.onMove() - # Redraw the dialog box to adapt the buttons - self.Close() - GlobalPlugin.showFrequentTextDialog(self, dictBlocks) - def onRemove (self, evt): + def onRemove(self, evt): # Removes the selected block. evt.Skip() self.removeItem() - def removeItem (self): + def removeItem(self): # Removes the selected block. - index=self.listBox.GetFocusedItem() - name = self.listBox.GetItemText(index) + index=self.BlocksList.GetSelection() + name = self.BlocksList.GetString(index) + catg = self.listCatgs[self.catg] self.dialogActive = True # Translators: Message dialog box to remove the selected block. if gui.messageBox(_("Are you sure you want to remove %s?") %name, self.title, style=wx.ICON_QUESTION|wx.YES_NO) == wx.YES: - config = ConfigObj(_ffIniFile, list_values=True, encoding = "utf-8") - blocks = config[Catg] + blocks = config[catg] blocks.__delitem__(name) config.write() - self.listBox.DeleteItem(index) - if self.listBox.GetItemCount(): - self.listBox.Select(self.listBox.GetFocusedItem()) + self.BlocksList.Delete(index) + # Adapt the show/hide state of buttons + if self.BlocksList.GetCount() > 0: + self.BlocksList.Select(0) + elif self.BlocksList.GetCount() == 0: + self.pasteButton.Hide() + self.renameButton.Hide() + self.changeButton.Hide() + self.moveButton.Hide() + self.removeButton.Hide() self.dialogActive = False - self.listBox.SetFocus() - # Redraw the dialog box to adapt the buttons - self.Close() - GlobalPlugin.showFrequentTextDialog(self, dictBlocks) + self.BlocksList.SetFocus() - def goBack(self, evt): + def onGoBack(self, evt): # Returns to categories list dialog evt.Skip() - config = ConfigObj(_ffIniFile, list_values = True, encoding = "utf-8") - listCatgs = config.keys() self.Close() - GlobalPlugin.showFrequentTextCatgsDialog(self, listCatgs) + gui.mainFrame._popupSettingsDialog(FrequentTextCatgsDialog) def onKeyPress(self, evt): # Sets enter key to paste the text and delete to remove it. evt.Skip() keycode = evt.GetKeyCode() - if keycode == wx.WXK_RETURN and self.listBox.GetItemCount(): + if keycode == wx.WXK_RETURN and self.BlocksList.GetCount(): self.onPaste(evt) - elif keycode == wx.WXK_RETURN and not self.listBox.GetItemCount(): + elif keycode == wx.WXK_RETURN and not self.BlocksList.GetCount(): self.onAdd(evt) - elif keycode == wx.WXK_DELETE and self.listBox.GetItemCount(): + elif keycode == wx.WXK_DELETE and self.BlocksList.GetCount(): self.removeItem() - def updateBlocks(self, dictBlocks, index): - self.listBox.ClearAll() - # Translators: Title of the column of the list view. - self.listBox.InsertColumn(0, _("Name")) - self.listBox.SetColumnWidth (0,250) - if dictBlocks == None: - return - keys = dictBlocks.keys() - keys.sort() - for item in keys: - k = item - self.listBox.Append ([k]) - self.listBox.Focus(index) - self.listBox.Select(index) - diff --git a/addon/GlobalPlugins/frequentText/update.py b/addon/GlobalPlugins/frequentText/update.py deleted file mode 100644 index 7b8e0bd..0000000 --- a/addon/GlobalPlugins/frequentText/update.py +++ /dev/null @@ -1,154 +0,0 @@ -# -*- coding: UTF-8 -*- -# Copyright (C) 2021 Rui Fontes and Ângelo Abrantes -# Update add-ons module based on the work of several add-on authors -# This file is covered by the GNU General Public License. -# -# You just need to place this module in the appModule or globalPlugin folder and include in the __init__.py file in the import section: -""" -# For update process -from . update import * -""" -# and in the def __init__(self): -""" - _MainWindows = Initialize() - _MainWindows.start() -""" - -# import the necessary modules. -import ui -import wx -import os -import globalVars -import addonHandler -import addonHandler.addonVersionCheck -import winsound -from threading import Thread -import urllib.request -import json -import config -import gui -from gui.settingsDialogs import NVDASettingsDialog, SettingsPanel -from gui import guiHelper -import core -import shutil - -# For translation -addonHandler.initTranslation() - -def getOurAddon(): - for addon in addonHandler.getAvailableAddons(): - if str(os.path.dirname(__file__).split("\\")[-1:]).replace("[", "").replace("\'", "").replace("]", "") == addon.manifest['name']: - return addon - -ourAddon = getOurAddon() -bundle = getOurAddon() - -def initConfiguration(): - confspec = { - "isUpgrade": "boolean(default=True)", - } - config.conf.spec[ourAddon.manifest["name"]] = confspec - -def getConfig(key): - value = config.conf[str(ourAddon.manifest["name"])][key] - return value - -def setConfig(key, value): - try: - config.conf.profiles[0][ourAddon.manifest["name"]][key] = value - except: - config.conf[ourAddon.manifest["name"]][key] = value - -initConfiguration() -shouldUpdate = getConfig("isUpgrade") -urlRepos = "https://api.github.com/repos/ruifontes/"+ourAddon.manifest["name"]+"/releases" -urlName = "" -urlN = "" -directory = "" - - -class Initialize(Thread): - # Creating the constructor of the newly created GlobalPlugin class. - def __init__(self): - # Call of the constructor of the parent class. - super(Initialize, self).__init__() - # Add a section in NVDA configurations panel - NVDASettingsDialog.categoryClasses.append(AddOnPanel) - self.daemon = True - wx.CallAfter(AddonFlow.upgradeVerify) - - -class AddonFlow(Thread): - def __init__(self): - super(AddonFlow, self).__init__() - self.daemon = True - - def upgradeVerify(): - if globalVars.appArgs.secure or config.isAppX or globalVars.appArgs.launcher: - AddonFlow.doNothing() - if shouldUpdate == True: - p = urllib.request.Request(urlRepos) - r = urllib.request.urlopen(p).read() - githubApi = json.loads(r.decode('utf-8')) - if githubApi[0]["tag_name"] != ourAddon.manifest["version"]: - # Translators: Message dialog box to ask user if wants to update. - if gui.messageBox(_("It is available a new version of this add-on.\n Do you want to update?"), ourAddon.manifest["summary"], style=wx.ICON_QUESTION|wx.YES_NO) == wx.YES: - AddonFlow.download() - else: - AddonFlow.doNothing() - - def download(): - global urlName, urlN, directory, bundle - p = urllib.request.Request(urlRepos) - r = urllib.request.urlopen(p).read() - githubApi = json.loads(r.decode('utf-8')) - urlName = githubApi[0]['assets'][0]['browser_download_url'] - urlN = str(urlName.split("/")[-1:]).replace("[", "").replace("\'", "").replace("]", "") - directory = os.path.join(globalVars.appArgs.configPath, "updates") - if os.path.exists(directory) == False: - os.mkdir(directory) - file = os.path.join(directory, urlN) - opener = urllib.request.build_opener() - opener.addheaders = [('User-agent', 'Mozilla/5.0')] - urllib.request.install_opener(opener) - urllib.request.urlretrieve(urlName, file) - bundle = addonHandler.AddonBundle(file) - if bundle.manifest["name"] == ourAddon.manifest['name']: - AddonFlow.checkCompatibility() - AddonFlow.doNothing() - - def checkCompatibility(): - if addonHandler.addonVersionCheck.isAddonCompatible(ourAddon): - AddonFlow.install() # because is compatible - else: # because is incompatible - # Translators: Message dialog box to inform user that the add-on is not compatible - gui.messageBox(_("This new version of this add-on is not compatible with your version of NVDA.\n The update process will be terminated."), ourAddon.manifest["summary"], style=wx.ICON_WARNING) - AddonFlow.doNothing() - - def install(): - ourAddon.requestRemove() # To remove the old version - addonHandler.installAddonBundle(bundle) # to install the new version - shutil.rmtree(directory, ignore_errors=True) # to delete the downloads folder - core.restart() # to restart NVDA - - def doNothing(): - pass - - -class AddOnPanel(SettingsPanel): - title = ourAddon.manifest["summary"] - - def makeSettings(self, sizer): - helper=guiHelper.BoxSizerHelper(self, sizer=sizer) - # Translators: Checkbox name in the configuration dialog - self.shouldUpdateChk = helper.addItem(wx.CheckBox(self, label=_("Check for updates at startup"))) - self.shouldUpdateChk .Bind(wx.EVT_CHECKBOX, self.onChk) - self.shouldUpdateChk .Value = shouldUpdate - - def onSave(self): - setConfig("isUpgrade", self.shouldUpdateChk.Value) - - def onChk(self, event): - shouldUpdate = self.shouldUpdateChk.Value - - diff --git a/addon/doc/es/readme.md b/addon/doc/es/readme.md index ac790c5..d4b775f 100644 --- a/addon/doc/es/readme.md +++ b/addon/doc/es/readme.md @@ -3,7 +3,7 @@ ## Información * Autores: Rui Fontes, Ângelo Abrantes y Abel Passos Júnior, basado en el trabajo de Marcos António de Oliveira -* Actualizado el 31/05/2022 +* Actualizado el 30/05/2023 * Descargar [versión estable] [1] * Compatibilidad: NVDA versión 2021.1 y posteriores @@ -31,10 +31,4 @@ Para pegar el bloque de texto en un campo de edición, simplemente seleccione el En las opciones del complemento también puede cambiar el nombre, cambiar el contenido, pasar a otra categoría, eliminar el bloque de texto o volver al diálogo de categorías. -## Actualización automática - -Este complemento incluye una función de actualización automática. -La comprobación de una nueva versión se ejecutará cada vez que se cargue NVDA. -Si no quieres esto, ve a NVDA, Preferencias, Opciones y en la categoría de complementos desmarca la casilla. - -[1]: https://github.com/ruifontes/frequentText/releases/download/2022.05/frequentText-2022.05.nvda-addon +[1]: https://github.com/ruifontes/frequentText/releases/download/2023.05.30/frequentText-2023.05.30.nvda-addon diff --git a/addon/doc/pt_BR/readme.md b/addon/doc/pt_BR/readme.md index 27cb6d3..70147c0 100644 --- a/addon/doc/pt_BR/readme.md +++ b/addon/doc/pt_BR/readme.md @@ -3,7 +3,7 @@ ## Informações * Autores: Rui Fontes, Ângelo Abrantes e Abel Passos Júnior, baseado no trabalho de Marcos António de Oliveira -* Actualizado em 31/05/2022 +* Actualizado em 30/05/2023 * Descarregar a [versão estável][1] * Compatibilidade: NVDA versão 2021.1 e seguintes @@ -32,10 +32,4 @@ Para colar o bloco de texto num campo de edição, seleccione o bloco e pression Na caixa de diálogo da lista de blocos também pode renomear, alterar o conteúdo, mudar de categoria, eliminar um bloco de texto, ou voltar para a caixa de diálogo das categorias. -## Atualização automática - -Este extra inclui um recurso de atualização automática. -A verificação de existência de nova versão será executada cada vez que o NVDA é carregado. -Se não desejar que isso aconteça, vá ao menu do NVDA, Preferências, Configurações e na categoria do extra desmarque a caixa de verificação. - -[1]: https://github.com/ruifontes/frequentText/releases/download/2022.05/frequentText-2022.05.nvda-addon +[1]: https://github.com/ruifontes/frequentText/releases/download/2023.05.30/frequentText-2023.05.30.nvda-addon diff --git a/addon/doc/pt_PT/readme.md b/addon/doc/pt_PT/readme.md index 399c631..23ff63a 100644 --- a/addon/doc/pt_PT/readme.md +++ b/addon/doc/pt_PT/readme.md @@ -3,7 +3,7 @@ ## Informações * Autores: Rui Fontes, Ângelo Abrantes e Abel Passos Júnior, baseados no trabalho de Marcos António de Oliveira -* Actualizado em 31/05/2022 +* Actualizado em 30/05/2023 * Descarregar a [versão estável][1] * Compatibilidade: NVDA versão 2021.1 e seguintes @@ -32,10 +32,4 @@ Para colar o bloco de texto num campo de edição, seleccione o bloco e pression Na caixa de diálogo da lista de blocos também pode renomear, alterar o conteúdo, mudar de categoria ou eliminar um bloco de texto, ou voltar para a caixa de diálogo das categorias. -## Atualização automática - -Este extra inclui um recurso de atualização automática. -A verificação de existência de nova versão será executada cada vez que o NVDA é carregado. -Se não desejar que isso aconteça, vá ao menu do NVDA, Preferências, Configurações e na categoria do extra desmarque a caixa de verificação. - -[1]: https://github.com/ruifontes/frequentText/releases/download/2022.05/frequentText-2022.05.nvda-addon +[1]: https://github.com/ruifontes/frequentText/releases/download/2023.05.30/frequentText-2023.05.30.nvda-addon diff --git a/addon/locale/ar/LC_MESSAGES/nvda.po b/addon/locale/ar/LC_MESSAGES/nvda.po new file mode 100644 index 0000000..3500991 --- /dev/null +++ b/addon/locale/ar/LC_MESSAGES/nvda.po @@ -0,0 +1,220 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the 'frequentText' package. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: 'frequentText' '21.08'\n" +"Report-Msgid-Bugs-To: 'nvda-translations@groups.io'\n" +"POT-Creation-Date: 2023-05-29 02:00+0100\n" +"PO-Revision-Date: 2023-05-29 02:03+0100\n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: ar\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=6; plural=(n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 " +"&& n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5);\n" +"X-Generator: Poedit 3.3.1\n" + +#. Translators: Message to be announced during Keyboard Help +#: addon\globalPlugins\frequentText\__init__.py:65 +msgid "" +"Opens a dialog box to registe, manage and paste frequent blocks of text." +msgstr "فتح نافذة إضافة وإدارة ولصق الجمل النصية المتكررة." + +#. Translators: Name of the section in "Input gestures" dialog. +#: addon\globalPlugins\frequentText\__init__.py:67 +#: addon\globalPlugins\frequentText\__init__.py:78 +msgid "Text editing" +msgstr "تحرير النص" + +#. Ttranslators: Message to be announced during Keyboard Help +#: addon\globalPlugins\frequentText\__init__.py:76 +msgid "Opens a dialog box with the text blocks of first or default category" +msgstr "فتح نافذة نصوص التصنيف الأول أو التصنيف الافتراضي" + +#: addon\globalPlugins\frequentText\__init__.py:101 +#: addon\globalPlugins\frequentText\__init__.py:288 +msgid "Frequent text" +msgstr "النصوص المتكررة" + +#. Create a label and a list view for categories list. Label is above the list view. +#. Translators: Label the list view that contains the categories +#: addon\globalPlugins\frequentText\__init__.py:111 +msgid "Categories list" +msgstr "قائمة التصنيفات" + +#. Translators: Button Label to show the entries of a category +#: addon\globalPlugins\frequentText\__init__.py:124 +msgid "&Show entries" +msgstr "إ&ظهار المدخلات" + +#. Translators: Button Label to add a new category +#: addon\globalPlugins\frequentText\__init__.py:130 +#: addon\globalPlugins\frequentText\__init__.py:314 +msgid "&Add" +msgstr "&إضافة" + +#. Translators: Button Label that renames the name of the selected block. +#: addon\globalPlugins\frequentText\__init__.py:136 +#: addon\globalPlugins\frequentText\__init__.py:326 +msgid "Re&name" +msgstr "إعادة &تسمية" + +#. Translators: Button Label to set the selected category as default +#: addon\globalPlugins\frequentText\__init__.py:140 +msgid "Set &category as default" +msgstr "تعيين التصنيف كا&فتراضي" + +#. Translators: Button Label that removes the selected category. +#. Translators: Button Label that removes the selected block. +#: addon\globalPlugins\frequentText\__init__.py:144 +#: addon\globalPlugins\frequentText\__init__.py:338 +msgid "&Remove" +msgstr "إ&زالة" + +#. Translators: Message dialog box to add a name to a new category +#: addon\globalPlugins\frequentText\__init__.py:186 +msgid "Enter a name for the category" +msgstr "أدخل اسم التصنيف" + +#. Translators: Announcement that the category name already exists in the list. +#: addon\globalPlugins\frequentText\__init__.py:190 +#: addon\globalPlugins\frequentText\__init__.py:235 +msgid "There is already a category with this name!" +msgstr "يوجد تصنيف بهذا الإسم" + +#. Translators: Message dialog to rename the category +#. Translators: Message dialog to rename the block of text. +#: addon\globalPlugins\frequentText\__init__.py:219 +#: addon\globalPlugins\frequentText\__init__.py:476 +#, python-format +msgid "Enter a new name for %s" +msgstr "أدخل الإسم الجديد لـ %s" + +#. Translators: Message asking if user wants to remove the selected category +#. Translators: Message dialog box to remove the selected block. +#: addon\globalPlugins\frequentText\__init__.py:255 +#: addon\globalPlugins\frequentText\__init__.py:584 +#, python-format +msgid "Are you sure you want to remove %s?" +msgstr "هل تريد إزالة %s?" + +#. Create a label and a list view for categories list. +#. Label is above the list view. +#. Translators: Label the list view that contains the categories +#: addon\globalPlugins\frequentText\__init__.py:301 +#, python-format +msgid "List of text blocks of %s category" +msgstr "قائمة الجمل النصية لتصنيف %s" + +#. Translators: Button Label that paste the block to the edit box. +#: addon\globalPlugins\frequentText\__init__.py:320 +msgid "&Paste" +msgstr "&لسق" + +#. Translators: Button Label that change the blocks of text. +#: addon\globalPlugins\frequentText\__init__.py:330 +msgid "&Change blocks" +msgstr "&تغيير الجملة" + +#. Translators: Label for button to move the selected block to other category. +#: addon\globalPlugins\frequentText\__init__.py:334 +msgid "&Move" +msgstr "&نقل" + +#. Translators: Label for button to go back to categories list. +#: addon\globalPlugins\frequentText\__init__.py:342 +msgid "&Back to categories" +msgstr "العودة إلى الت&صنيفات" + +#. Translators: Message dialog box to add a name to a new block. +#: addon\globalPlugins\frequentText\__init__.py:378 +msgid "Enter a name for the block" +msgstr "أدخل إسم الجملة النصية" + +#. Translators: Announcement that the block name already exists in the list. +#: addon\globalPlugins\frequentText\__init__.py:382 +#: addon\globalPlugins\frequentText\__init__.py:492 +msgid "There is already a block with this name!" +msgstr "توجد جملة نصية بهذا الإسم" + +#. Translators: Message dialog box to add a new block of text. +#: addon\globalPlugins\frequentText\__init__.py:392 +msgid "Enter the block of text" +msgstr "أكتب نص الجملة النصية" + +#. Translators: Message dialog box to change a block of text. +#: addon\globalPlugins\frequentText\__init__.py:509 +msgid "" +"Change the block of text as you want and press Tab to Ok button and Enter to " +"confirm" +msgstr "" +"قم بتغيير محتوى الجملة النصية إلى ما تريد, اضغط على tab إلى زر OK, ثم اضغط " +"Enter" + +#. Translators: Message dialog box to move the selected block to other category. +#: addon\globalPlugins\frequentText\__init__.py:543 +#, python-format +msgid "" +"If you really want to move %s from %s category, enter the name of the new, " +"already existing, category" +msgstr "" +"إذا كنت تريد نقل الجملة %s إلى التصنيف %s أدخل إسم التصنيف الذي تريد نقل " +"الجملة إليه" + +#. Translators: Announcement that the category does not exists. +#: addon\globalPlugins\frequentText\__init__.py:567 +msgid "There is no such category!" +msgstr "هذا التصنيف غير موجود!" + +#. Add-on summary, usually the user visible name of the addon. +#. Translators: Summary for this add-on +#. to be shown on installation and add-on information found in Add-ons Manager. +#: buildVars.py:23 +msgid "Regists blocks of text frequently used" +msgstr "تساعدك هذه الإضافة في الاحتفاظ بالجمل النصية التي تستخدمها بكثرة" + +#. Add-on description +#. Translators: Long description to be shown for this add-on on add-on information from add-ons manager +#: buildVars.py:26 +msgid "" +"Stores and make possible the entry of frequently used blocks of text. " +"Command: Windows+F12." +msgstr "" +"حفظ وتخزين الجمل النصية التي تستخدمها بكثرة. لفتح نافذة الإضافة, اضغط " +"windows+f12." + +#. Author(s) +#: buildVars.py:30 +msgid "" +"Rui Fontes , Ângelo Abrantes and Abel Passos Júnior" +msgstr "" + +#~ msgid "&Close" +#~ msgstr "إ&غلاق" + +#~ msgid "Name" +#~ msgstr "الإسم" + +#~ msgid "" +#~ "It is available a new version of this add-on.\n" +#~ " Do you want to update?" +#~ msgstr "" +#~ "يوجد إصدار جديد من هذه الإضافة.\n" +#~ " هل تريد التحديث؟" + +#~ msgid "" +#~ "This new version of this add-on is not compatible with your version of " +#~ "NVDA.\n" +#~ " The update process will be terminated." +#~ msgstr "" +#~ "هذا الإصدار من الإضافة غير متوافق مع الإصدار الذي تستخدمه من NVDA.\n" +#~ " سيتم إنهاء عملية التحديث." + +#~ msgid "Check for updates at startup" +#~ msgstr "البحث عن التحديثات عند تشغيل NVDA" diff --git a/addon/locale/es/LC_MESSAGES/nvda.po b/addon/locale/es/LC_MESSAGES/nvda.po index 1cfa495..8584c29 100644 --- a/addon/locale/es/LC_MESSAGES/nvda.po +++ b/addon/locale/es/LC_MESSAGES/nvda.po @@ -7,166 +7,151 @@ msgid "" msgstr "" "Project-Id-Version: 'frequentText' '1.0'\n" "Report-Msgid-Bugs-To: 'nvda-translations@groups.io'\n" -"POT-Creation-Date: 2021-08-09 02:06+0100\n" -"PO-Revision-Date: 2021-08-09 02:13+0100\n" -"Last-Translator: Rui Fontes \n" +"POT-Creation-Date: 2023-05-29 02:00+0100\n" +"PO-Revision-Date: 2023-05-29 02:04+0100\n" +"Last-Translator: Rui Fontes \n" "Language-Team: \n" "Language: es_419\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 3.0\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Poedit 3.3.1\n" -#. For translators: Message to be announced during Keyboard Help -#: addon\globalPlugins\frequentText\__init__.py:53 +#. Translators: Message to be announced during Keyboard Help +#: addon\globalPlugins\frequentText\__init__.py:65 msgid "" "Opens a dialog box to registe, manage and paste frequent blocks of text." msgstr "" "Se abre un diálogo para registrar, administrar y pegar bloques de texto " "frecuentes." -#. For translators: Name of the section in "Input gestures" dialog. -#: addon\globalPlugins\frequentText\__init__.py:55 -#: addon\globalPlugins\frequentText\__init__.py:93 +#. Translators: Name of the section in "Input gestures" dialog. +#: addon\globalPlugins\frequentText\__init__.py:67 +#: addon\globalPlugins\frequentText\__init__.py:78 msgid "Text editing" msgstr "Edición de textos" -#. Translators: Title of categories list dialog box. -#. Translators: Title of Blocks list dialog boxes. -#: addon\globalPlugins\frequentText\__init__.py:66 -#: addon\globalPlugins\frequentText\__init__.py:80 -msgid "Frequent text" -msgstr "Texto Frecuente." - -#. For translators: Message to be announced during Keyboard Help -#: addon\globalPlugins\frequentText\__init__.py:91 +#. Ttranslators: Message to be announced during Keyboard Help +#: addon\globalPlugins\frequentText\__init__.py:76 msgid "Opens a dialog box with the text blocks of first or default category" msgstr "" "Abre un cuadro de diálogo con los bloques de texto de la primera categoría o " "de la categoría por defecto" -#. Create a label and a list view for categories list. -#. Label is above the list view. +#: addon\globalPlugins\frequentText\__init__.py:101 +#: addon\globalPlugins\frequentText\__init__.py:288 +msgid "Frequent text" +msgstr "Texto Frecuente." + +#. Create a label and a list view for categories list. Label is above the list view. #. Translators: Label the list view that contains the categories -#: addon\globalPlugins\frequentText\__init__.py:125 +#: addon\globalPlugins\frequentText\__init__.py:111 msgid "Categories list" msgstr "Lista de categorías." -#. Translators: Button Label to show the entries in the selected category -#: addon\globalPlugins\frequentText\__init__.py:138 +#. Translators: Button Label to show the entries of a category +#: addon\globalPlugins\frequentText\__init__.py:124 msgid "&Show entries" msgstr "&Mostrar entradas" #. Translators: Button Label to add a new category -#. Translators: Button Label to add a new block. -#: addon\globalPlugins\frequentText\__init__.py:143 -#: addon\globalPlugins\frequentText\__init__.py:343 +#: addon\globalPlugins\frequentText\__init__.py:130 +#: addon\globalPlugins\frequentText\__init__.py:314 msgid "&Add" msgstr "&Añadir" #. Translators: Button Label that renames the name of the selected block. -#: addon\globalPlugins\frequentText\__init__.py:148 -#: addon\globalPlugins\frequentText\__init__.py:353 +#: addon\globalPlugins\frequentText\__init__.py:136 +#: addon\globalPlugins\frequentText\__init__.py:326 msgid "Re&name" msgstr "Re&nombrar" #. Translators: Button Label to set the selected category as default -#: addon\globalPlugins\frequentText\__init__.py:153 +#: addon\globalPlugins\frequentText\__init__.py:140 msgid "Set &category as default" msgstr "Establecer &categoría por defecto" +#. Translators: Button Label that removes the selected category. #. Translators: Button Label that removes the selected block. -#: addon\globalPlugins\frequentText\__init__.py:158 -#: addon\globalPlugins\frequentText\__init__.py:368 +#: addon\globalPlugins\frequentText\__init__.py:144 +#: addon\globalPlugins\frequentText\__init__.py:338 msgid "&Remove" msgstr "&Remover" -#. Translators: Button Label that closes the add-on. -#: addon\globalPlugins\frequentText\__init__.py:162 -#: addon\globalPlugins\frequentText\__init__.py:377 -msgid "&Close" -msgstr "&Cerrar" - #. Translators: Message dialog box to add a name to a new category -#: addon\globalPlugins\frequentText\__init__.py:188 +#: addon\globalPlugins\frequentText\__init__.py:186 msgid "Enter a name for the category" msgstr "Introoduce un nombre para la categoría" #. Translators: Announcement that the category name already exists in the list. -#: addon\globalPlugins\frequentText\__init__.py:197 -#: addon\globalPlugins\frequentText\__init__.py:245 +#: addon\globalPlugins\frequentText\__init__.py:190 +#: addon\globalPlugins\frequentText\__init__.py:235 msgid "There is already a category with this name!" msgstr "Ya existe una categoría con este nombre!" #. Translators: Message dialog to rename the category #. Translators: Message dialog to rename the block of text. -#: addon\globalPlugins\frequentText\__init__.py:227 -#: addon\globalPlugins\frequentText\__init__.py:502 +#: addon\globalPlugins\frequentText\__init__.py:219 +#: addon\globalPlugins\frequentText\__init__.py:476 #, python-format msgid "Enter a new name for %s" msgstr "Introduce un nuevo nombre para %s" -#. Translators: Message dialog box to remove the selected category +#. Translators: Message asking if user wants to remove the selected category #. Translators: Message dialog box to remove the selected block. -#: addon\globalPlugins\frequentText\__init__.py:265 -#: addon\globalPlugins\frequentText\__init__.py:608 +#: addon\globalPlugins\frequentText\__init__.py:255 +#: addon\globalPlugins\frequentText\__init__.py:584 #, python-format msgid "Are you sure you want to remove %s?" msgstr "Estás seguro que quieres eliminar %s?" -#. Translators: Title of the column of the list view. -#: addon\globalPlugins\frequentText\__init__.py:303 -#: addon\globalPlugins\frequentText\__init__.py:644 -msgid "Name" -msgstr "Nombre" - -#. Create a label and a list view for Frequent Text list. +#. Create a label and a list view for categories list. #. Label is above the list view. -#. Translators: Label the list view that contains the Blocks. -#: addon\globalPlugins\frequentText\__init__.py:330 +#. Translators: Label the list view that contains the categories +#: addon\globalPlugins\frequentText\__init__.py:301 #, python-format msgid "List of text blocks of %s category" msgstr "Lista de bloques de texto para la categoría% s." #. Translators: Button Label that paste the block to the edit box. -#: addon\globalPlugins\frequentText\__init__.py:348 +#: addon\globalPlugins\frequentText\__init__.py:320 msgid "&Paste" msgstr "&Pegar" #. Translators: Button Label that change the blocks of text. -#: addon\globalPlugins\frequentText\__init__.py:358 +#: addon\globalPlugins\frequentText\__init__.py:330 msgid "&Change blocks" msgstr "hacer &cambios en los bloques" -#. Translators: Label for btton to move the selected block to other category. -#: addon\globalPlugins\frequentText\__init__.py:363 +#. Translators: Label for button to move the selected block to other category. +#: addon\globalPlugins\frequentText\__init__.py:334 msgid "&Move" msgstr "&Mover" #. Translators: Label for button to go back to categories list. -#: addon\globalPlugins\frequentText\__init__.py:373 +#: addon\globalPlugins\frequentText\__init__.py:342 msgid "&Back to categories" msgstr "&Volver a las categorías" #. Translators: Message dialog box to add a name to a new block. -#: addon\globalPlugins\frequentText\__init__.py:406 +#: addon\globalPlugins\frequentText\__init__.py:378 msgid "Enter a name for the block" msgstr "Introduce un nombre para el bloque" #. Translators: Announcement that the block name already exists in the list. -#: addon\globalPlugins\frequentText\__init__.py:415 -#: addon\globalPlugins\frequentText\__init__.py:520 +#: addon\globalPlugins\frequentText\__init__.py:382 +#: addon\globalPlugins\frequentText\__init__.py:492 msgid "There is already a block with this name!" msgstr "Ya existe un bloque con ese nombre!" #. Translators: Message dialog box to add a new block of text. -#: addon\globalPlugins\frequentText\__init__.py:425 +#: addon\globalPlugins\frequentText\__init__.py:392 msgid "Enter the block of text" msgstr "Introduce el texto" #. Translators: Message dialog box to change a block of text. -#: addon\globalPlugins\frequentText\__init__.py:537 +#: addon\globalPlugins\frequentText\__init__.py:509 msgid "" "Change the block of text as you want and press Tab to Ok button and Enter to " "confirm" @@ -175,7 +160,7 @@ msgstr "" "confirmar " #. Translators: Message dialog box to move the selected block to other category. -#: addon\globalPlugins\frequentText\__init__.py:573 +#: addon\globalPlugins\frequentText\__init__.py:543 #, python-format msgid "" "If you really want to move %s from %s category, enter the name of the new, " @@ -185,37 +170,10 @@ msgstr "" "categoría ya existente" #. Translators: Announcement that the category does not exists. -#: addon\globalPlugins\frequentText\__init__.py:589 +#: addon\globalPlugins\frequentText\__init__.py:567 msgid "There is no such category!" msgstr "No existe esa categoría!" -#. Translators: Message dialog box to ask user if wants to update. -#: addon\globalPlugins\frequentText\update.py:95 -msgid "" -"It is available a new version of this add-on.\n" -" Do you want to update?" -msgstr "" -"Está disponible una nueva versión de este complemento.\n" -" ¿Desea actualizarlo?" - -#. because is compatible -#. because is incompatible -#. Translators: Message dialog box to inform user that the add-on is not compatible -#: addon\globalPlugins\frequentText\update.py:125 -msgid "" -"This new version of this add-on is not compatible with your version of " -"NVDA.\n" -" The update process will be terminated." -msgstr "" -"La nueva versión de este complemento no es compatible con tu versión de " -"NVDA.\n" -" El proceso de actualización se terminará." - -#. Translators: Checkbox name in the configuration dialog -#: addon\globalPlugins\frequentText\update.py:144 -msgid "Check for updates at startup" -msgstr "Comprobar las actualizaciones al inicio" - #. Add-on summary, usually the user visible name of the addon. #. Translators: Summary for this add-on #. to be shown on installation and add-on information found in Add-ons Manager. @@ -233,6 +191,40 @@ msgstr "" "Almacena y hace posible la entrada de texto usado con frecuencia. Comando: " "Windows+F12." +#. Author(s) +#: buildVars.py:30 +msgid "" +"Rui Fontes , Ângelo Abrantes and Abel Passos Júnior" +msgstr "" +"Rui Fontes , Ângelo Abrantes y Abel Passos Júnior" + +#~ msgid "&Close" +#~ msgstr "&Cerrar" + +#~ msgid "Name" +#~ msgstr "Nombre" + +#~ msgid "" +#~ "It is available a new version of this add-on.\n" +#~ " Do you want to update?" +#~ msgstr "" +#~ "Está disponible una nueva versión de este complemento.\n" +#~ " ¿Desea actualizarlo?" + +#~ msgid "" +#~ "This new version of this add-on is not compatible with your version of " +#~ "NVDA.\n" +#~ " The update process will be terminated." +#~ msgstr "" +#~ "La nueva versión de este complemento no es compatible con tu versión de " +#~ "NVDA.\n" +#~ " El proceso de actualización se terminará." + +#~ msgid "Check for updates at startup" +#~ msgstr "Comprobar las actualizaciones al inicio" + #, python-format #~ msgid "" #~ "Please wait\n" diff --git a/addon/locale/pt_BR/LC_MESSAGES/nvda.po b/addon/locale/pt_BR/LC_MESSAGES/nvda.po index 870018e..aa62acd 100644 --- a/addon/locale/pt_BR/LC_MESSAGES/nvda.po +++ b/addon/locale/pt_BR/LC_MESSAGES/nvda.po @@ -2,168 +2,153 @@ msgid "" msgstr "" "Project-Id-Version: FrequentText\n" "Report-Msgid-Bugs-To: 'nvda-translations@groups.io'\n" -"POT-Creation-Date: 2021-08-09 02:06+0100\n" -"PO-Revision-Date: 2021-08-09 02:14+0100\n" -"Last-Translator: Rui Fontes \n" +"POT-Creation-Date: 2023-05-29 02:00+0100\n" +"PO-Revision-Date: 2023-05-29 02:05+0100\n" +"Last-Translator: Rui Fontes \n" "Language-Team: Equipa portuguesa do NVDA\n" "Language: pt\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 3.0\n" -"X-Poedit-Basepath: ../../../GlobalPlugins\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 3.3.1\n" +"X-Poedit-Basepath: ../../../GlobalPlugins\n" "X-Poedit-SourceCharset: UTF-8\n" "X-Poedit-SearchPath-0: .\n" -#. For translators: Message to be announced during Keyboard Help -#: addon\globalPlugins\frequentText\__init__.py:53 +#. Translators: Message to be announced during Keyboard Help +#: addon\globalPlugins\frequentText\__init__.py:65 msgid "" "Opens a dialog box to registe, manage and paste frequent blocks of text." msgstr "" "Abre uma janela para registar, gerir e selecionar os blocos a colar no texto." -#. For translators: Name of the section in "Input gestures" dialog. -#: addon\globalPlugins\frequentText\__init__.py:55 -#: addon\globalPlugins\frequentText\__init__.py:93 +#. Translators: Name of the section in "Input gestures" dialog. +#: addon\globalPlugins\frequentText\__init__.py:67 +#: addon\globalPlugins\frequentText\__init__.py:78 msgid "Text editing" msgstr "Edição de texto" -#. Translators: Title of categories list dialog box. -#. Translators: Title of Blocks list dialog boxes. -#: addon\globalPlugins\frequentText\__init__.py:66 -#: addon\globalPlugins\frequentText\__init__.py:80 -msgid "Frequent text" -msgstr "Texto frequente" - -#. For translators: Message to be announced during Keyboard Help -#: addon\globalPlugins\frequentText\__init__.py:91 +#. Ttranslators: Message to be announced during Keyboard Help +#: addon\globalPlugins\frequentText\__init__.py:76 msgid "Opens a dialog box with the text blocks of first or default category" msgstr "" "Abre uma janela com os blocos de texto da primeira categoria ou da categoria " "padrão" -#. Create a label and a list view for categories list. -#. Label is above the list view. +#: addon\globalPlugins\frequentText\__init__.py:101 +#: addon\globalPlugins\frequentText\__init__.py:288 +msgid "Frequent text" +msgstr "Texto frequente" + +#. Create a label and a list view for categories list. Label is above the list view. #. Translators: Label the list view that contains the categories -#: addon\globalPlugins\frequentText\__init__.py:125 +#: addon\globalPlugins\frequentText\__init__.py:111 msgid "Categories list" msgstr "Lista de categorias" -#. Translators: Button Label to show the entries in the selected category -#: addon\globalPlugins\frequentText\__init__.py:138 +#. Translators: Button Label to show the entries of a category +#: addon\globalPlugins\frequentText\__init__.py:124 msgid "&Show entries" msgstr "&Mostrar Entradas" #. Translators: Button Label to add a new category -#. Translators: Button Label to add a new block. -#: addon\globalPlugins\frequentText\__init__.py:143 -#: addon\globalPlugins\frequentText\__init__.py:343 +#: addon\globalPlugins\frequentText\__init__.py:130 +#: addon\globalPlugins\frequentText\__init__.py:314 msgid "&Add" msgstr "&Adicionar" #. Translators: Button Label that renames the name of the selected block. -#: addon\globalPlugins\frequentText\__init__.py:148 -#: addon\globalPlugins\frequentText\__init__.py:353 +#: addon\globalPlugins\frequentText\__init__.py:136 +#: addon\globalPlugins\frequentText\__init__.py:326 msgid "Re&name" msgstr "&Renomear" #. Translators: Button Label to set the selected category as default -#: addon\globalPlugins\frequentText\__init__.py:153 +#: addon\globalPlugins\frequentText\__init__.py:140 msgid "Set &category as default" msgstr "Definir &categoria como padrão" +#. Translators: Button Label that removes the selected category. #. Translators: Button Label that removes the selected block. -#: addon\globalPlugins\frequentText\__init__.py:158 -#: addon\globalPlugins\frequentText\__init__.py:368 +#: addon\globalPlugins\frequentText\__init__.py:144 +#: addon\globalPlugins\frequentText\__init__.py:338 msgid "&Remove" msgstr "&Eliminar" -#. Translators: Button Label that closes the add-on. -#: addon\globalPlugins\frequentText\__init__.py:162 -#: addon\globalPlugins\frequentText\__init__.py:377 -msgid "&Close" -msgstr "&Fechar" - #. Translators: Message dialog box to add a name to a new category -#: addon\globalPlugins\frequentText\__init__.py:188 +#: addon\globalPlugins\frequentText\__init__.py:186 msgid "Enter a name for the category" msgstr "Introduza um nome para a categoria." #. Translators: Announcement that the category name already exists in the list. -#: addon\globalPlugins\frequentText\__init__.py:197 -#: addon\globalPlugins\frequentText\__init__.py:245 +#: addon\globalPlugins\frequentText\__init__.py:190 +#: addon\globalPlugins\frequentText\__init__.py:235 msgid "There is already a category with this name!" msgstr "Já existe uma categoria com este nome!" #. Translators: Message dialog to rename the category #. Translators: Message dialog to rename the block of text. -#: addon\globalPlugins\frequentText\__init__.py:227 -#: addon\globalPlugins\frequentText\__init__.py:502 +#: addon\globalPlugins\frequentText\__init__.py:219 +#: addon\globalPlugins\frequentText\__init__.py:476 #, python-format msgid "Enter a new name for %s" msgstr "Introduza um novo nome para %s" -#. Translators: Message dialog box to remove the selected category +#. Translators: Message asking if user wants to remove the selected category #. Translators: Message dialog box to remove the selected block. -#: addon\globalPlugins\frequentText\__init__.py:265 -#: addon\globalPlugins\frequentText\__init__.py:608 +#: addon\globalPlugins\frequentText\__init__.py:255 +#: addon\globalPlugins\frequentText\__init__.py:584 #, python-format msgid "Are you sure you want to remove %s?" msgstr "Tem a certeza que quer eliminar %s da lista de blocos?" -#. Translators: Title of the column of the list view. -#: addon\globalPlugins\frequentText\__init__.py:303 -#: addon\globalPlugins\frequentText\__init__.py:644 -msgid "Name" -msgstr "Nome" - -#. Create a label and a list view for Frequent Text list. +#. Create a label and a list view for categories list. #. Label is above the list view. -#. Translators: Label the list view that contains the Blocks. -#: addon\globalPlugins\frequentText\__init__.py:330 +#. Translators: Label the list view that contains the categories +#: addon\globalPlugins\frequentText\__init__.py:301 #, python-format msgid "List of text blocks of %s category" msgstr "Lista de blocos de texto da categoria %s" #. Translators: Button Label that paste the block to the edit box. -#: addon\globalPlugins\frequentText\__init__.py:348 +#: addon\globalPlugins\frequentText\__init__.py:320 msgid "&Paste" msgstr "&Colar" #. Translators: Button Label that change the blocks of text. -#: addon\globalPlugins\frequentText\__init__.py:358 +#: addon\globalPlugins\frequentText\__init__.py:330 msgid "&Change blocks" msgstr "Modificar &blocos" -#. Translators: Label for btton to move the selected block to other category. -#: addon\globalPlugins\frequentText\__init__.py:363 +#. Translators: Label for button to move the selected block to other category. +#: addon\globalPlugins\frequentText\__init__.py:334 msgid "&Move" msgstr "&Mover" #. Translators: Label for button to go back to categories list. -#: addon\globalPlugins\frequentText\__init__.py:373 +#: addon\globalPlugins\frequentText\__init__.py:342 msgid "&Back to categories" msgstr "&Voltar a categorias" #. Translators: Message dialog box to add a name to a new block. -#: addon\globalPlugins\frequentText\__init__.py:406 +#: addon\globalPlugins\frequentText\__init__.py:378 msgid "Enter a name for the block" msgstr "Introduza um nome para o bloco." #. Translators: Announcement that the block name already exists in the list. -#: addon\globalPlugins\frequentText\__init__.py:415 -#: addon\globalPlugins\frequentText\__init__.py:520 +#: addon\globalPlugins\frequentText\__init__.py:382 +#: addon\globalPlugins\frequentText\__init__.py:492 msgid "There is already a block with this name!" msgstr "Já existe um bloco com este nome!" #. Translators: Message dialog box to add a new block of text. -#: addon\globalPlugins\frequentText\__init__.py:425 +#: addon\globalPlugins\frequentText\__init__.py:392 msgid "Enter the block of text" msgstr "Introduza o bloco de texto" #. Translators: Message dialog box to change a block of text. -#: addon\globalPlugins\frequentText\__init__.py:537 +#: addon\globalPlugins\frequentText\__init__.py:509 msgid "" "Change the block of text as you want and press Tab to Ok button and Enter to " "confirm" @@ -172,7 +157,7 @@ msgstr "" "para confirmar" #. Translators: Message dialog box to move the selected block to other category. -#: addon\globalPlugins\frequentText\__init__.py:573 +#: addon\globalPlugins\frequentText\__init__.py:543 #, python-format msgid "" "If you really want to move %s from %s category, enter the name of the new, " @@ -182,36 +167,10 @@ msgstr "" "já existente" #. Translators: Announcement that the category does not exists. -#: addon\globalPlugins\frequentText\__init__.py:589 +#: addon\globalPlugins\frequentText\__init__.py:567 msgid "There is no such category!" msgstr "Não existe essa categoria!" -#. Translators: Message dialog box to ask user if wants to update. -#: addon\globalPlugins\frequentText\update.py:95 -msgid "" -"It is available a new version of this add-on.\n" -" Do you want to update?" -msgstr "" -"Está disponível uma nova versão deste suplemento.\n" -" Você deseja atualizar?" - -#. because is compatible -#. because is incompatible -#. Translators: Message dialog box to inform user that the add-on is not compatible -#: addon\globalPlugins\frequentText\update.py:125 -msgid "" -"This new version of this add-on is not compatible with your version of " -"NVDA.\n" -" The update process will be terminated." -msgstr "" -"Esta nova versão deste suplemento não é compatível com sua versão do NVDA.\n" -" O processo de atualização será encerrado." - -#. Translators: Checkbox name in the configuration dialog -#: addon\globalPlugins\frequentText\update.py:144 -msgid "Check for updates at startup" -msgstr "Verificar actualizações ao iniciar" - #. Add-on summary, usually the user visible name of the addon. #. Translators: Summary for this add-on #. to be shown on installation and add-on information found in Add-ons Manager. @@ -229,6 +188,40 @@ msgstr "" "Armazena e torna possível a introdução de blocos de texto frequentemente " "usados. Comando: Windows+f12." +#. Author(s) +#: buildVars.py:30 +msgid "" +"Rui Fontes , Ângelo Abrantes and Abel Passos Júnior" +msgstr "" +"Rui Fontes , Ângelo Abrantes and Abel Passos Júnior" + +#~ msgid "&Close" +#~ msgstr "&Fechar" + +#~ msgid "Name" +#~ msgstr "Nome" + +#~ msgid "" +#~ "It is available a new version of this add-on.\n" +#~ " Do you want to update?" +#~ msgstr "" +#~ "Está disponível uma nova versão deste suplemento.\n" +#~ " Você deseja atualizar?" + +#~ msgid "" +#~ "This new version of this add-on is not compatible with your version of " +#~ "NVDA.\n" +#~ " The update process will be terminated." +#~ msgstr "" +#~ "Esta nova versão deste suplemento não é compatível com sua versão do " +#~ "NVDA.\n" +#~ " O processo de atualização será encerrado." + +#~ msgid "Check for updates at startup" +#~ msgstr "Verificar actualizações ao iniciar" + #, python-format #~ msgid "" #~ "Please wait\n" diff --git a/addon/locale/pt_PT/LC_MESSAGES/nvda.po b/addon/locale/pt_PT/LC_MESSAGES/nvda.po index 866791c..f1e0ae6 100644 --- a/addon/locale/pt_PT/LC_MESSAGES/nvda.po +++ b/addon/locale/pt_PT/LC_MESSAGES/nvda.po @@ -2,168 +2,153 @@ msgid "" msgstr "" "Project-Id-Version: FrequentText\n" "Report-Msgid-Bugs-To: 'nvda-translations@groups.io'\n" -"POT-Creation-Date: 2021-08-09 02:06+0100\n" -"PO-Revision-Date: 2021-11-07 20:06+0000\n" +"POT-Creation-Date: 2023-05-29 02:00+0100\n" +"PO-Revision-Date: 2023-05-29 02:06+0100\n" "Last-Translator: Rui Fontes \n" "Language-Team: Equipa portuguesa do NVDA\n" "Language: pt\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 3.0\n" -"X-Poedit-Basepath: ../../../GlobalPlugins\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 3.3.1\n" +"X-Poedit-Basepath: ../../../GlobalPlugins\n" "X-Poedit-SourceCharset: UTF-8\n" "X-Poedit-SearchPath-0: .\n" -#. For translators: Message to be announced during Keyboard Help -#: addon\globalPlugins\frequentText\__init__.py:53 +#. Translators: Message to be announced during Keyboard Help +#: addon\globalPlugins\frequentText\__init__.py:65 msgid "" "Opens a dialog box to registe, manage and paste frequent blocks of text." msgstr "" "Abre uma janela para registar, gerir e selecionar os blocos a colar no texto." -#. For translators: Name of the section in "Input gestures" dialog. -#: addon\globalPlugins\frequentText\__init__.py:55 -#: addon\globalPlugins\frequentText\__init__.py:93 +#. Translators: Name of the section in "Input gestures" dialog. +#: addon\globalPlugins\frequentText\__init__.py:67 +#: addon\globalPlugins\frequentText\__init__.py:78 msgid "Text editing" msgstr "Edição de texto" -#. Translators: Title of categories list dialog box. -#. Translators: Title of Blocks list dialog boxes. -#: addon\globalPlugins\frequentText\__init__.py:66 -#: addon\globalPlugins\frequentText\__init__.py:80 -msgid "Frequent text" -msgstr "Texto frequente" - -#. For translators: Message to be announced during Keyboard Help -#: addon\globalPlugins\frequentText\__init__.py:91 +#. Ttranslators: Message to be announced during Keyboard Help +#: addon\globalPlugins\frequentText\__init__.py:76 msgid "Opens a dialog box with the text blocks of first or default category" msgstr "" "Abre uma janela com os blocos de texto da primeira categoria ou da categoria " "padrão" -#. Create a label and a list view for categories list. -#. Label is above the list view. +#: addon\globalPlugins\frequentText\__init__.py:101 +#: addon\globalPlugins\frequentText\__init__.py:288 +msgid "Frequent text" +msgstr "Texto frequente" + +#. Create a label and a list view for categories list. Label is above the list view. #. Translators: Label the list view that contains the categories -#: addon\globalPlugins\frequentText\__init__.py:125 +#: addon\globalPlugins\frequentText\__init__.py:111 msgid "Categories list" msgstr "Lista de categorias" -#. Translators: Button Label to show the entries in the selected category -#: addon\globalPlugins\frequentText\__init__.py:138 +#. Translators: Button Label to show the entries of a category +#: addon\globalPlugins\frequentText\__init__.py:124 msgid "&Show entries" msgstr "&Mostrar entradas" #. Translators: Button Label to add a new category -#. Translators: Button Label to add a new block. -#: addon\globalPlugins\frequentText\__init__.py:143 -#: addon\globalPlugins\frequentText\__init__.py:343 +#: addon\globalPlugins\frequentText\__init__.py:130 +#: addon\globalPlugins\frequentText\__init__.py:314 msgid "&Add" msgstr "&Adicionar" #. Translators: Button Label that renames the name of the selected block. -#: addon\globalPlugins\frequentText\__init__.py:148 -#: addon\globalPlugins\frequentText\__init__.py:353 +#: addon\globalPlugins\frequentText\__init__.py:136 +#: addon\globalPlugins\frequentText\__init__.py:326 msgid "Re&name" msgstr "&Renomear" #. Translators: Button Label to set the selected category as default -#: addon\globalPlugins\frequentText\__init__.py:153 +#: addon\globalPlugins\frequentText\__init__.py:140 msgid "Set &category as default" msgstr "Definir &categoria como padrão" +#. Translators: Button Label that removes the selected category. #. Translators: Button Label that removes the selected block. -#: addon\globalPlugins\frequentText\__init__.py:158 -#: addon\globalPlugins\frequentText\__init__.py:368 +#: addon\globalPlugins\frequentText\__init__.py:144 +#: addon\globalPlugins\frequentText\__init__.py:338 msgid "&Remove" msgstr "&Eliminar" -#. Translators: Button Label that closes the add-on. -#: addon\globalPlugins\frequentText\__init__.py:162 -#: addon\globalPlugins\frequentText\__init__.py:377 -msgid "&Close" -msgstr "&Fechar" - #. Translators: Message dialog box to add a name to a new category -#: addon\globalPlugins\frequentText\__init__.py:188 +#: addon\globalPlugins\frequentText\__init__.py:186 msgid "Enter a name for the category" msgstr "Introduza um nome para a categoria" #. Translators: Announcement that the category name already exists in the list. -#: addon\globalPlugins\frequentText\__init__.py:197 -#: addon\globalPlugins\frequentText\__init__.py:245 +#: addon\globalPlugins\frequentText\__init__.py:190 +#: addon\globalPlugins\frequentText\__init__.py:235 msgid "There is already a category with this name!" msgstr "Já existe uma categoria com este nome!" #. Translators: Message dialog to rename the category #. Translators: Message dialog to rename the block of text. -#: addon\globalPlugins\frequentText\__init__.py:227 -#: addon\globalPlugins\frequentText\__init__.py:502 +#: addon\globalPlugins\frequentText\__init__.py:219 +#: addon\globalPlugins\frequentText\__init__.py:476 #, python-format msgid "Enter a new name for %s" msgstr "Introduza um novo nome para %s" -#. Translators: Message dialog box to remove the selected category +#. Translators: Message asking if user wants to remove the selected category #. Translators: Message dialog box to remove the selected block. -#: addon\globalPlugins\frequentText\__init__.py:265 -#: addon\globalPlugins\frequentText\__init__.py:608 +#: addon\globalPlugins\frequentText\__init__.py:255 +#: addon\globalPlugins\frequentText\__init__.py:584 #, python-format msgid "Are you sure you want to remove %s?" msgstr "Tem a certeza que quer eliminar %s da lista de blocos?" -#. Translators: Title of the column of the list view. -#: addon\globalPlugins\frequentText\__init__.py:303 -#: addon\globalPlugins\frequentText\__init__.py:644 -msgid "Name" -msgstr "Nome" - -#. Create a label and a list view for Frequent Text list. +#. Create a label and a list view for categories list. #. Label is above the list view. -#. Translators: Label the list view that contains the Blocks. -#: addon\globalPlugins\frequentText\__init__.py:330 +#. Translators: Label the list view that contains the categories +#: addon\globalPlugins\frequentText\__init__.py:301 #, python-format msgid "List of text blocks of %s category" msgstr "Lista de blocos de texto da categoria %s" #. Translators: Button Label that paste the block to the edit box. -#: addon\globalPlugins\frequentText\__init__.py:348 +#: addon\globalPlugins\frequentText\__init__.py:320 msgid "&Paste" msgstr "&Colar" #. Translators: Button Label that change the blocks of text. -#: addon\globalPlugins\frequentText\__init__.py:358 +#: addon\globalPlugins\frequentText\__init__.py:330 msgid "&Change blocks" msgstr "Modificar &blocos" -#. Translators: Label for btton to move the selected block to other category. -#: addon\globalPlugins\frequentText\__init__.py:363 +#. Translators: Label for button to move the selected block to other category. +#: addon\globalPlugins\frequentText\__init__.py:334 msgid "&Move" msgstr "&Mover" #. Translators: Label for button to go back to categories list. -#: addon\globalPlugins\frequentText\__init__.py:373 +#: addon\globalPlugins\frequentText\__init__.py:342 msgid "&Back to categories" msgstr "&Voltar a categorias" #. Translators: Message dialog box to add a name to a new block. -#: addon\globalPlugins\frequentText\__init__.py:406 +#: addon\globalPlugins\frequentText\__init__.py:378 msgid "Enter a name for the block" msgstr "Introduza um nome para o bloco" #. Translators: Announcement that the block name already exists in the list. -#: addon\globalPlugins\frequentText\__init__.py:415 -#: addon\globalPlugins\frequentText\__init__.py:520 +#: addon\globalPlugins\frequentText\__init__.py:382 +#: addon\globalPlugins\frequentText\__init__.py:492 msgid "There is already a block with this name!" msgstr "Já existe um bloco com este nome!" #. Translators: Message dialog box to add a new block of text. -#: addon\globalPlugins\frequentText\__init__.py:425 +#: addon\globalPlugins\frequentText\__init__.py:392 msgid "Enter the block of text" msgstr "Introduza o bloco de texto" #. Translators: Message dialog box to change a block of text. -#: addon\globalPlugins\frequentText\__init__.py:537 +#: addon\globalPlugins\frequentText\__init__.py:509 msgid "" "Change the block of text as you want and press Tab to Ok button and Enter to " "confirm" @@ -172,7 +157,7 @@ msgstr "" "para confirmar" #. Translators: Message dialog box to move the selected block to other category. -#: addon\globalPlugins\frequentText\__init__.py:573 +#: addon\globalPlugins\frequentText\__init__.py:543 #, python-format msgid "" "If you really want to move %s from %s category, enter the name of the new, " @@ -182,36 +167,10 @@ msgstr "" "já existente" #. Translators: Announcement that the category does not exists. -#: addon\globalPlugins\frequentText\__init__.py:589 +#: addon\globalPlugins\frequentText\__init__.py:567 msgid "There is no such category!" msgstr "Não existe essa categoria!" -#. Translators: Message dialog box to ask user if wants to update. -#: addon\globalPlugins\frequentText\update.py:95 -msgid "" -"It is available a new version of this add-on.\n" -" Do you want to update?" -msgstr "" -"Está disponível uma nova versão deste extra.\n" -"Quer actualizar?" - -#. because is compatible -#. because is incompatible -#. Translators: Message dialog box to inform user that the add-on is not compatible -#: addon\globalPlugins\frequentText\update.py:125 -msgid "" -"This new version of this add-on is not compatible with your version of " -"NVDA.\n" -" The update process will be terminated." -msgstr "" -"Esta nova versão deste extra não é compatível com a sua versão do NVDA.\n" -" O processo de actualização será terminado." - -#. Translators: Checkbox name in the configuration dialog -#: addon\globalPlugins\frequentText\update.py:144 -msgid "Check for updates at startup" -msgstr "Verificar actualizações ao iniciar" - #. Add-on summary, usually the user visible name of the addon. #. Translators: Summary for this add-on #. to be shown on installation and add-on information found in Add-ons Manager. @@ -229,6 +188,39 @@ msgstr "" "Armazena e torna possível a introdução de blocos de texto frequentemente " "usados. Comando: Windows+f12." +#. Author(s) +#: buildVars.py:30 +msgid "" +"Rui Fontes , Ângelo Abrantes and Abel Passos Júnior" +msgstr "" +"Rui Fontes , Ângelo Abrantes e Abel Passos Júnior" + +#~ msgid "&Close" +#~ msgstr "&Fechar" + +#~ msgid "Name" +#~ msgstr "Nome" + +#~ msgid "" +#~ "It is available a new version of this add-on.\n" +#~ " Do you want to update?" +#~ msgstr "" +#~ "Está disponível uma nova versão deste extra.\n" +#~ "Quer actualizar?" + +#~ msgid "" +#~ "This new version of this add-on is not compatible with your version of " +#~ "NVDA.\n" +#~ " The update process will be terminated." +#~ msgstr "" +#~ "Esta nova versão deste extra não é compatível com a sua versão do NVDA.\n" +#~ " O processo de actualização será terminado." + +#~ msgid "Check for updates at startup" +#~ msgstr "Verificar actualizações ao iniciar" + #, python-format #~ msgid "" #~ "Please wait\n" diff --git a/addon/locale/sr/LC_MESSAGES/nvda.po b/addon/locale/sr/LC_MESSAGES/nvda.po index afc7487..57e8709 100644 --- a/addon/locale/sr/LC_MESSAGES/nvda.po +++ b/addon/locale/sr/LC_MESSAGES/nvda.po @@ -2,166 +2,151 @@ msgid "" msgstr "" "Project-Id-Version: FrequentText\n" "Report-Msgid-Bugs-To: 'nvda-translations@groups.io'\n" -"POT-Creation-Date: 2021-08-09 02:06+0100\n" -"PO-Revision-Date: 2021-08-10 17:04+0100\n" -"Last-Translator: Rui Fontes \n" +"POT-Creation-Date: 2023-05-29 02:00+0100\n" +"PO-Revision-Date: 2023-05-29 02:07+0100\n" +"Last-Translator: Rui Fontes \n" "Language-Team: \n" "Language: sr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 3.0\n" -"X-Poedit-Basepath: ../../../GlobalPlugins\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Poedit 3.3.1\n" +"X-Poedit-Basepath: ../../../GlobalPlugins\n" "X-Poedit-SourceCharset: UTF-8\n" "X-Poedit-SearchPath-0: .\n" -#. For translators: Message to be announced during Keyboard Help -#: addon\globalPlugins\frequentText\__init__.py:53 +#. Translators: Message to be announced during Keyboard Help +#: addon\globalPlugins\frequentText\__init__.py:65 msgid "" "Opens a dialog box to registe, manage and paste frequent blocks of text." msgstr "" "Otvara dijalog za upisivanje, upravljanje i lepljenje čestih blokova teksta" -#. For translators: Name of the section in "Input gestures" dialog. -#: addon\globalPlugins\frequentText\__init__.py:55 -#: addon\globalPlugins\frequentText\__init__.py:93 +#. Translators: Name of the section in "Input gestures" dialog. +#: addon\globalPlugins\frequentText\__init__.py:67 +#: addon\globalPlugins\frequentText\__init__.py:78 msgid "Text editing" msgstr "Uređivanje teksta" -#. Translators: Title of categories list dialog box. -#. Translators: Title of Blocks list dialog boxes. -#: addon\globalPlugins\frequentText\__init__.py:66 -#: addon\globalPlugins\frequentText\__init__.py:80 -msgid "Frequent text" -msgstr "Čest tekst" - -#. For translators: Message to be announced during Keyboard Help -#: addon\globalPlugins\frequentText\__init__.py:91 +#. Ttranslators: Message to be announced during Keyboard Help +#: addon\globalPlugins\frequentText\__init__.py:76 msgid "Opens a dialog box with the text blocks of first or default category" msgstr "Otvara dijalog sa blokovima teksta prve ili podrazumevane kategorije" -#. Create a label and a list view for categories list. -#. Label is above the list view. +#: addon\globalPlugins\frequentText\__init__.py:101 +#: addon\globalPlugins\frequentText\__init__.py:288 +msgid "Frequent text" +msgstr "Čest tekst" + +#. Create a label and a list view for categories list. Label is above the list view. #. Translators: Label the list view that contains the categories -#: addon\globalPlugins\frequentText\__init__.py:125 +#: addon\globalPlugins\frequentText\__init__.py:111 msgid "Categories list" msgstr "Lista kategorija" -#. Translators: Button Label to show the entries in the selected category -#: addon\globalPlugins\frequentText\__init__.py:138 +#. Translators: Button Label to show the entries of a category +#: addon\globalPlugins\frequentText\__init__.py:124 msgid "&Show entries" msgstr "&Prikaži stavke" #. Translators: Button Label to add a new category -#. Translators: Button Label to add a new block. -#: addon\globalPlugins\frequentText\__init__.py:143 -#: addon\globalPlugins\frequentText\__init__.py:343 +#: addon\globalPlugins\frequentText\__init__.py:130 +#: addon\globalPlugins\frequentText\__init__.py:314 msgid "&Add" msgstr "&Dodaj" #. Translators: Button Label that renames the name of the selected block. -#: addon\globalPlugins\frequentText\__init__.py:148 -#: addon\globalPlugins\frequentText\__init__.py:353 +#: addon\globalPlugins\frequentText\__init__.py:136 +#: addon\globalPlugins\frequentText\__init__.py:326 msgid "Re&name" msgstr "&Preimenuj" #. Translators: Button Label to set the selected category as default -#: addon\globalPlugins\frequentText\__init__.py:153 +#: addon\globalPlugins\frequentText\__init__.py:140 msgid "Set &category as default" msgstr "Podesi &kategoriju kao podrazumevanu" +#. Translators: Button Label that removes the selected category. #. Translators: Button Label that removes the selected block. -#: addon\globalPlugins\frequentText\__init__.py:158 -#: addon\globalPlugins\frequentText\__init__.py:368 +#: addon\globalPlugins\frequentText\__init__.py:144 +#: addon\globalPlugins\frequentText\__init__.py:338 msgid "&Remove" msgstr "&Ukloni" -#. Translators: Button Label that closes the add-on. -#: addon\globalPlugins\frequentText\__init__.py:162 -#: addon\globalPlugins\frequentText\__init__.py:377 -msgid "&Close" -msgstr "&Zatvori" - #. Translators: Message dialog box to add a name to a new category -#: addon\globalPlugins\frequentText\__init__.py:188 +#: addon\globalPlugins\frequentText\__init__.py:186 msgid "Enter a name for the category" msgstr "Upiši ime za kategoriju" #. Translators: Announcement that the category name already exists in the list. -#: addon\globalPlugins\frequentText\__init__.py:197 -#: addon\globalPlugins\frequentText\__init__.py:245 +#: addon\globalPlugins\frequentText\__init__.py:190 +#: addon\globalPlugins\frequentText\__init__.py:235 msgid "There is already a category with this name!" msgstr "Već postoji kategorija sa ovim imenom!" #. Translators: Message dialog to rename the category #. Translators: Message dialog to rename the block of text. -#: addon\globalPlugins\frequentText\__init__.py:227 -#: addon\globalPlugins\frequentText\__init__.py:502 +#: addon\globalPlugins\frequentText\__init__.py:219 +#: addon\globalPlugins\frequentText\__init__.py:476 #, python-format msgid "Enter a new name for %s" msgstr "Upiši novo ime za %s" -#. Translators: Message dialog box to remove the selected category +#. Translators: Message asking if user wants to remove the selected category #. Translators: Message dialog box to remove the selected block. -#: addon\globalPlugins\frequentText\__init__.py:265 -#: addon\globalPlugins\frequentText\__init__.py:608 +#: addon\globalPlugins\frequentText\__init__.py:255 +#: addon\globalPlugins\frequentText\__init__.py:584 #, python-format msgid "Are you sure you want to remove %s?" msgstr "Da li si siguran da želiš da obrišeš %s?" -#. Translators: Title of the column of the list view. -#: addon\globalPlugins\frequentText\__init__.py:303 -#: addon\globalPlugins\frequentText\__init__.py:644 -msgid "Name" -msgstr "Ime" - -#. Create a label and a list view for Frequent Text list. +#. Create a label and a list view for categories list. #. Label is above the list view. -#. Translators: Label the list view that contains the Blocks. -#: addon\globalPlugins\frequentText\__init__.py:330 +#. Translators: Label the list view that contains the categories +#: addon\globalPlugins\frequentText\__init__.py:301 #, python-format msgid "List of text blocks of %s category" msgstr "Lista blokova teksta kategorije %s" #. Translators: Button Label that paste the block to the edit box. -#: addon\globalPlugins\frequentText\__init__.py:348 +#: addon\globalPlugins\frequentText\__init__.py:320 msgid "&Paste" msgstr "&Nalepi" #. Translators: Button Label that change the blocks of text. -#: addon\globalPlugins\frequentText\__init__.py:358 +#: addon\globalPlugins\frequentText\__init__.py:330 msgid "&Change blocks" msgstr "&Promeni blokove" -#. Translators: Label for btton to move the selected block to other category. -#: addon\globalPlugins\frequentText\__init__.py:363 +#. Translators: Label for button to move the selected block to other category. +#: addon\globalPlugins\frequentText\__init__.py:334 msgid "&Move" msgstr "&Premesti" #. Translators: Label for button to go back to categories list. -#: addon\globalPlugins\frequentText\__init__.py:373 +#: addon\globalPlugins\frequentText\__init__.py:342 msgid "&Back to categories" msgstr "&Nazad na kategorije" #. Translators: Message dialog box to add a name to a new block. -#: addon\globalPlugins\frequentText\__init__.py:406 +#: addon\globalPlugins\frequentText\__init__.py:378 msgid "Enter a name for the block" msgstr "Upiši ime za blok" #. Translators: Announcement that the block name already exists in the list. -#: addon\globalPlugins\frequentText\__init__.py:415 -#: addon\globalPlugins\frequentText\__init__.py:520 +#: addon\globalPlugins\frequentText\__init__.py:382 +#: addon\globalPlugins\frequentText\__init__.py:492 msgid "There is already a block with this name!" msgstr "Već postoji blok sa ovim imenom!" #. Translators: Message dialog box to add a new block of text. -#: addon\globalPlugins\frequentText\__init__.py:425 +#: addon\globalPlugins\frequentText\__init__.py:392 msgid "Enter the block of text" msgstr "Upiši blok teksta" #. Translators: Message dialog box to change a block of text. -#: addon\globalPlugins\frequentText\__init__.py:537 +#: addon\globalPlugins\frequentText\__init__.py:509 msgid "" "Change the block of text as you want and press Tab to Ok button and Enter to " "confirm" @@ -170,7 +155,7 @@ msgstr "" "da biste potvrdili" #. Translators: Message dialog box to move the selected block to other category. -#: addon\globalPlugins\frequentText\__init__.py:573 +#: addon\globalPlugins\frequentText\__init__.py:543 #, python-format msgid "" "If you really want to move %s from %s category, enter the name of the new, " @@ -180,32 +165,10 @@ msgstr "" "postojeće kategorije" #. Translators: Announcement that the category does not exists. -#: addon\globalPlugins\frequentText\__init__.py:589 +#: addon\globalPlugins\frequentText\__init__.py:567 msgid "There is no such category!" msgstr "Nema ove kategorije!" -#. Translators: Message dialog box to ask user if wants to update. -#: addon\globalPlugins\frequentText\update.py:95 -msgid "" -"It is available a new version of this add-on.\n" -" Do you want to update?" -msgstr "" - -#. because is compatible -#. because is incompatible -#. Translators: Message dialog box to inform user that the add-on is not compatible -#: addon\globalPlugins\frequentText\update.py:125 -msgid "" -"This new version of this add-on is not compatible with your version of " -"NVDA.\n" -" The update process will be terminated." -msgstr "" - -#. Translators: Checkbox name in the configuration dialog -#: addon\globalPlugins\frequentText\update.py:144 -msgid "Check for updates at startup" -msgstr "" - #. Add-on summary, usually the user visible name of the addon. #. Translators: Summary for this add-on #. to be shown on installation and add-on information found in Add-ons Manager. @@ -223,6 +186,21 @@ msgstr "" "Čuva i omogućava vam da ponovo upisujete česte blokove teksta. Komanda: " "Windows plus f12" +#. Author(s) +#: buildVars.py:30 +msgid "" +"Rui Fontes , Ângelo Abrantes and Abel Passos Júnior" +msgstr "" +"Rui Fontes , Ângelo Abrantes и Abel Passos Júnior" + +#~ msgid "&Close" +#~ msgstr "&Zatvori" + +#~ msgid "Name" +#~ msgstr "Ime" + #, python-format #~ msgid "" #~ "Please wait\n" diff --git a/addon/locale/tr/LC_MESSAGES/nvda.po b/addon/locale/tr/LC_MESSAGES/nvda.po new file mode 100644 index 0000000..9de3e4e --- /dev/null +++ b/addon/locale/tr/LC_MESSAGES/nvda.po @@ -0,0 +1,241 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the 'frequentText' package. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: 'frequentText' '2022.05'\n" +"Report-Msgid-Bugs-To: 'nvda-translations@groups.io'\n" +"POT-Creation-Date: 2023-02-06 15:37+0200\n" +"PO-Revision-Date: 2023-05-29 02:08+0100\n" +"Last-Translator: Heorhii \n" +"Language-Team: \n" +"Language: uk\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && " +"n%10<=4 && (n%100<12 || n%100>14) ? 1 : 2);\n" +"X-Generator: Poedit 3.3.1\n" + +#. For translators: Message to be announced during Keyboard Help +#: addon\globalPlugins\frequentText\__init__.py:60 +msgid "" +"Opens a dialog box to registe, manage and paste frequent blocks of text." +msgstr "" +"Відкриває діалог для реєстрації, керування та вставки блоків тексту, що " +"часто повторюються." + +#. For translators: Name of the section in "Input gestures" dialog. +#: addon\globalPlugins\frequentText\__init__.py:62 +#: addon\globalPlugins\frequentText\__init__.py:100 +msgid "Text editing" +msgstr "Редагування тексту" + +#. Translators: Title of categories list dialog box. +#. Translators: Title of Blocks list dialog boxes. +#: addon\globalPlugins\frequentText\__init__.py:73 +#: addon\globalPlugins\frequentText\__init__.py:87 +msgid "Frequent text" +msgstr "Часто повторюваний текст" + +#. For translators: Message to be announced during Keyboard Help +#: addon\globalPlugins\frequentText\__init__.py:98 +msgid "Opens a dialog box with the text blocks of first or default category" +msgstr "Відкриває діалог з текстовими блоками першої або основної категорії" + +#. Create a label and a list view for categories list. +#. Label is above the list view. +#. Translators: Label the list view that contains the categories +#: addon\globalPlugins\frequentText\__init__.py:138 +msgid "Categories list" +msgstr "Список категорій" + +#. Translators: Button Label to show the entries in the selected category +#: addon\globalPlugins\frequentText\__init__.py:151 +msgid "&Show entries" +msgstr "&Показати записи" + +#. Translators: Button Label to add a new category +#. Translators: Button Label to add a new block. +#: addon\globalPlugins\frequentText\__init__.py:156 +#: addon\globalPlugins\frequentText\__init__.py:356 +msgid "&Add" +msgstr "&Додати" + +#. Translators: Button Label that renames the name of the selected block. +#: addon\globalPlugins\frequentText\__init__.py:161 +#: addon\globalPlugins\frequentText\__init__.py:366 +msgid "Re&name" +msgstr "&Перейменувати" + +#. Translators: Button Label to set the selected category as default +#: addon\globalPlugins\frequentText\__init__.py:166 +msgid "Set &category as default" +msgstr "Встановити &категорію як основну" + +#. Translators: Button Label that removes the selected block. +#: addon\globalPlugins\frequentText\__init__.py:171 +#: addon\globalPlugins\frequentText\__init__.py:381 +msgid "&Remove" +msgstr "&Видалити" + +#. Translators: Button Label that closes the add-on. +#: addon\globalPlugins\frequentText\__init__.py:175 +#: addon\globalPlugins\frequentText\__init__.py:390 +msgid "&Close" +msgstr "&Закрити" + +#. Translators: Message dialog box to add a name to a new category +#: addon\globalPlugins\frequentText\__init__.py:201 +msgid "Enter a name for the category" +msgstr "Введіть назву категорії" + +#. Translators: Announcement that the category name already exists in the list. +#: addon\globalPlugins\frequentText\__init__.py:210 +#: addon\globalPlugins\frequentText\__init__.py:258 +msgid "There is already a category with this name!" +msgstr "Категорія з такою назвою вже існує!" + +#. Translators: Message dialog to rename the category +#. Translators: Message dialog to rename the block of text. +#: addon\globalPlugins\frequentText\__init__.py:240 +#: addon\globalPlugins\frequentText\__init__.py:515 +#, python-format +msgid "Enter a new name for %s" +msgstr "Введіть нову назву для %s" + +#. Translators: Message dialog box to remove the selected category +#. Translators: Message dialog box to remove the selected block. +#: addon\globalPlugins\frequentText\__init__.py:278 +#: addon\globalPlugins\frequentText\__init__.py:621 +#, python-format +msgid "Are you sure you want to remove %s?" +msgstr "Ви впевнені, що хочете видалити %s?" + +#. Translators: Title of the column of the list view. +#: addon\globalPlugins\frequentText\__init__.py:316 +#: addon\globalPlugins\frequentText\__init__.py:657 +msgid "Name" +msgstr "Назва" + +#. Create a label and a list view for Frequent Text list. +#. Label is above the list view. +#. Translators: Label the list view that contains the Blocks. +#: addon\globalPlugins\frequentText\__init__.py:343 +#, python-format +msgid "List of text blocks of %s category" +msgstr "Список текстових блоків категорії %s" + +#. Translators: Button Label that paste the block to the edit box. +#: addon\globalPlugins\frequentText\__init__.py:361 +msgid "&Paste" +msgstr "&Скопіювати" + +#. Translators: Button Label that change the blocks of text. +#: addon\globalPlugins\frequentText\__init__.py:371 +msgid "&Change blocks" +msgstr "&Редагувати блок" + +#. Translators: Label for btton to move the selected block to other category. +#: addon\globalPlugins\frequentText\__init__.py:376 +msgid "&Move" +msgstr "&Перемістити" + +#. Translators: Label for button to go back to categories list. +#: addon\globalPlugins\frequentText\__init__.py:386 +msgid "&Back to categories" +msgstr "&Назад до категорій" + +#. Translators: Message dialog box to add a name to a new block. +#: addon\globalPlugins\frequentText\__init__.py:419 +msgid "Enter a name for the block" +msgstr "Введіть назву для блоку" + +#. Translators: Announcement that the block name already exists in the list. +#: addon\globalPlugins\frequentText\__init__.py:428 +#: addon\globalPlugins\frequentText\__init__.py:533 +msgid "There is already a block with this name!" +msgstr "Блок з такою назвою вже існує!" + +#. Translators: Message dialog box to add a new block of text. +#: addon\globalPlugins\frequentText\__init__.py:438 +msgid "Enter the block of text" +msgstr "Введіть блок тексту" + +#. Translators: Message dialog box to change a block of text. +#: addon\globalPlugins\frequentText\__init__.py:550 +msgid "" +"Change the block of text as you want and press Tab to Ok button and Enter to " +"confirm" +msgstr "" +"Редагуйте блок з текстом так, як вам потрібно, і натисніть клавішу Tab, а " +"потім кнопку Ok" + +#. Translators: Message dialog box to move the selected block to other category. +#: addon\globalPlugins\frequentText\__init__.py:586 +#, python-format +msgid "" +"If you really want to move %s from %s category, enter the name of the new, " +"already existing, category" +msgstr "" +"Якщо ви дійсно хочете перемістити %s з категорії %s, введіть назву нової, " +"вже наявної категорії" + +#. Translators: Announcement that the category does not exists. +#: addon\globalPlugins\frequentText\__init__.py:602 +msgid "There is no such category!" +msgstr "Такої категорії немає!" + +#. Translators: Message dialog box to ask user if wants to update. +#: addon\globalPlugins\frequentText\update.py:95 +msgid "" +"It is available a new version of this add-on.\n" +" Do you want to update?" +msgstr "" +"Доступна нова версія цього додатка.\n" +"Ви хочете оновити?" + +#. because is compatible +#. because is incompatible +#. Translators: Message dialog box to inform user that the add-on is not compatible +#: addon\globalPlugins\frequentText\update.py:125 +msgid "" +"This new version of this add-on is not compatible with your version of " +"NVDA.\n" +" The update process will be terminated." +msgstr "" +"Нова версія додатка не сумісна з вашою версією NVDA.\n" +"Процес оновлення буде припинено." + +#. Translators: Checkbox name in the configuration dialog +#: addon\globalPlugins\frequentText\update.py:144 +msgid "Check for updates at startup" +msgstr "Перевіряти наявність оновлень під час запуску" + +#. Add-on summary, usually the user visible name of the addon. +#. Translators: Summary for this add-on +#. to be shown on installation and add-on information found in Add-ons Manager. +#: buildVars.py:23 +msgid "Regists blocks of text frequently used" +msgstr "Реєструє часто використовувані блоки тексту" + +#. Add-on description +#. Translators: Long description to be shown for this add-on on add-on information from add-ons manager +#: buildVars.py:26 +msgid "" +"Stores and make possible the entry of frequently used blocks of text. " +"Command: Windows+F12." +msgstr "" +"Зберігає і робить можливим ввставлення часто використовуваних блоків тексту. " +"Команда: Windows+F12." + +#. Author(s) +#: buildVars.py:30 +msgid "" +"Rui Fontes , Ângelo Abrantes and Abel Passos Júnior" +msgstr "" +"Rui Fontes , Ângelo Abrantes та Abel Passos Júnior" diff --git a/buildVars.py b/buildVars.py index 5616cbe..6ca9c4e 100644 --- a/buildVars.py +++ b/buildVars.py @@ -25,21 +25,27 @@ def _(arg): # Translators: Long description to be shown for this add-on on add-on information from add-ons manager "addon_description": _("""Stores and make possible the entry of frequently used blocks of text. Command: Windows+F12."""), # version - "addon_version": "2022.05", + "addon_version": "2023.05.30", # Author(s) "addon_author": _("Rui Fontes , Ângelo Abrantes and Abel Passos Júnior"), # URL for the add-on documentation support "addon_url": "https://github.com/ruifontes/frequentText", + # URL for the add-on repository where the source code can be found + "addon_sourceURL": "https://github.com/ruifontes/frequentText", # Documentation file name "addon_docFileName": "readme.html", # Minimum NVDA version supported (e.g. "2018.3.0", minor version is optional) "addon_minimumNVDAVersion" : "2021.1", # Last NVDA version supported/tested (e.g. "2018.4.0", ideally more recent than minimum version) - "addon_lastTestedNVDAVersion" : "2022.1", + "addon_lastTestedNVDAVersion" : "2023.1", # Add-on update channel (default is None, denoting stable releases, # and for development releases, use "dev".) # Do not change unless you know what you are doing! "addon_updateChannel": None, + # Add-on license such as GPL 2 + "addon_license": "GPL 2", + # URL for the license document the ad-on is licensed under + "addon_licenseURL": "https://www.gnu.org/licenses/old-licenses/gpl-2.0.html", } # Define the python files that are the sources of your add-on. diff --git a/readme.md b/readme.md index 60f6b12..db7311d 100644 --- a/readme.md +++ b/readme.md @@ -1,11 +1,11 @@ # Frequent text # -## Informations +## Information * Authors: Rui Fontes, Ângelo Abrantes and Abel Passos Júnior, based on work of Marcos António de Oliveira -* Updated in 31/05/2022 +* Updated in 30/05/2023 * Download [stable version][1] -* Compatibility: NVDA version 2019.3 and beyond +* Compatibility: NVDA version 2021.1 and beyond ## Presentation @@ -32,11 +32,4 @@ To paste the block of text in an edit field, just select the block and press Ent In the add-on dialog box you also can rename, change the contents, move to other category, delete the block of text or go back to categories dialog. -## Auto update -Starting in version 21.07 includes a auto update check function. - -Everytime NVDA starts, it will check the repository to see if there are any new version. - -If you do not want this procedure, go to NVDA configurations and in the add-on category uncheck the checkbox. - -[1]: https://github.com/ruifontes/frequentText/releases/download/2022.05/frequentText-2022.05.nvda-addon +[1]: https://github.com/ruifontes/frequentText/releases/download/2023.05.30/frequentText-2023.05.30.nvda-addon diff --git a/sconstruct b/sconstruct index 600db4a..8aa914b 100644 --- a/sconstruct +++ b/sconstruct @@ -1,7 +1,7 @@ # NVDA add-on template SCONSTRUCT file -#Copyright (C) 2012, 2014 Rui Batista -#This file is covered by the GNU General Public License. -#See the file COPYING.txt for more details. +# Copyright (C) 2012-2023 Rui Batista, Noelia Martinez, Joseph Lee +# This file is covered by the GNU General Public License. +# See the file COPYING.txt for more details. import codecs import gettext @@ -9,14 +9,33 @@ import os import os.path import zipfile import sys + +# While names imported below are available by default in every SConscript +# Linters aren't aware about them. +# To avoid Flake8 F821 warnings about them they are imported explicitly. +# When using other Scons functions please add them to the line below. +from SCons.Script import BoolVariable, Builder, Copy, Environment, Variables + sys.dont_write_bytecode = True -import buildVars +# Bytecode should not be written for build vars module to keep the repository root folder clean. +import buildVars # NOQA: E402 + def md2html(source, dest): import markdown + # Use extensions if defined. + mdExtensions = buildVars.markdownExtensions lang = os.path.basename(os.path.dirname(source)).replace('_', '-') - title="{addonSummary} {addonVersion}".format(addonSummary=buildVars.addon_info["addon_summary"], addonVersion=buildVars.addon_info["addon_version"]) + localeLang = os.path.basename(os.path.dirname(source)) + try: + _ = gettext.translation("nvda", localedir=os.path.join("addon", "locale"), languages=[localeLang]).gettext + summary = _(buildVars.addon_info["addon_summary"]) + except Exception: + summary = buildVars.addon_info["addon_summary"] + title = "{addonSummary} {addonVersion}".format( + addonSummary=summary, addonVersion=buildVars.addon_info["addon_version"] + ) headerDic = { "[[!meta title=\"": "# ", "\"]]": " #", @@ -25,35 +44,52 @@ def md2html(source, dest): mdText = f.read() for k, v in headerDic.items(): mdText = mdText.replace(k, v, 1) - htmlText = markdown.markdown(mdText) + htmlText = markdown.markdown(mdText, extensions=mdExtensions) + # Optimization: build resulting HTML text in one go instead of writing parts separately. + docText = "\n".join([ + "", + "" % lang, + "", + "" + "", + "", + "%s" % title, + "\n", + htmlText, + "\n" + ]) with codecs.open(dest, "w", "utf-8") as f: - f.write("\n" + - "\n" + - "\n" % (lang, lang) + - "\n" + - "\n" + - "\n" + - "%s\n" % title + - "\n\n" - ) - f.write(htmlText) - f.write("\n\n") + f.write(docText) + def mdTool(env): - mdAction=env.Action( - lambda target,source,env: md2html(source[0].path, target[0].path), - lambda target,source,env: 'Generating %s'%target[0], + mdAction = env.Action( + lambda target, source, env: md2html(source[0].path, target[0].path), + lambda target, source, env: 'Generating % s' % target[0], ) - mdBuilder=env.Builder( + mdBuilder = env.Builder( action=mdAction, suffix='.html', src_suffix='.md', ) - env['BUILDERS']['markdown']=mdBuilder + env['BUILDERS']['markdown'] = mdBuilder + + +def validateVersionNumber(key, val, env): + # Used to make sure version major.minor.patch are integers to comply with NV Access add-on store. + # Ignore all this if version number is not specified, in which case json generator will validate this info. + if val == "0.0.0": + return + versionNumber = val.split(".") + if len(versionNumber) < 3: + raise ValueError("versionNumber must have three parts (major.minor.patch)") + if not all([part.isnumeric() for part in versionNumber]): + raise ValueError("versionNumber (major.minor.patch) must be integers") + vars = Variables() vars.Add("version", "The version of this build", buildVars.addon_info["addon_version"]) +vars.Add("versionNumber", "Version number of the form major.minor.patch", "0.0.0", validateVersionNumber) vars.Add(BoolVariable("dev", "Whether this is a daily development version", False)) vars.Add("channel", "Update channel for this build", buildVars.addon_info["addon_updateChannel"]) @@ -64,36 +100,52 @@ if env["dev"]: import datetime buildDate = datetime.datetime.now() year, month, day = str(buildDate.year), str(buildDate.month), str(buildDate.day) - env["addon_version"] = "".join([year, month.zfill(2), day.zfill(2), "-dev"]) + versionTimestamp = "".join([year, month.zfill(2), day.zfill(2)]) + env["addon_version"] = f"{versionTimestamp}-dev" + env["versionNumber"] = f"{versionTimestamp}.0.0" env["channel"] = "dev" elif env["version"] is not None: env["addon_version"] = env["version"] if "channel" in env and env["channel"] is not None: env["addon_updateChannel"] = env["channel"] +buildVars.addon_info["addon_version"] = env["addon_version"] +buildVars.addon_info["addon_updateChannel"] = env["addon_updateChannel"] + addonFile = env.File("${addon_name}-${addon_version}.nvda-addon") + def addonGenerator(target, source, env, for_signature): - action = env.Action(lambda target, source, env : createAddonBundleFromPath(source[0].abspath, target[0].abspath) and None, - lambda target, source, env : "Generating Addon %s" % target[0]) + action = env.Action( + lambda target, source, env: createAddonBundleFromPath(source[0].abspath, target[0].abspath) and None, + lambda target, source, env: "Generating Addon %s" % target[0] + ) return action + def manifestGenerator(target, source, env, for_signature): - action = env.Action(lambda target, source, env : generateManifest(source[0].abspath, target[0].abspath) and None, - lambda target, source, env : "Generating manifest %s" % target[0]) + action = env.Action( + lambda target, source, env: generateManifest(source[0].abspath, target[0].abspath) and None, + lambda target, source, env: "Generating manifest %s" % target[0] + ) return action + def translatedManifestGenerator(target, source, env, for_signature): dir = os.path.abspath(os.path.join(os.path.dirname(str(source[0])), "..")) lang = os.path.basename(dir) - action = env.Action(lambda target, source, env : generateTranslatedManifest(source[1].abspath, lang, target[0].abspath) and None, - lambda target, source, env : "Generating translated manifest %s" % target[0]) + action = env.Action( + lambda target, source, env: generateTranslatedManifest(source[1].abspath, lang, target[0].abspath) and None, + lambda target, source, env: "Generating translated manifest %s" % target[0] + ) return action + env['BUILDERS']['NVDAAddon'] = Builder(generator=addonGenerator) env['BUILDERS']['NVDAManifest'] = Builder(generator=manifestGenerator) env['BUILDERS']['NVDATranslatedManifest'] = Builder(generator=translatedManifestGenerator) + def createAddonHelp(dir): docsDir = os.path.join(dir, "doc") if os.path.isfile("style.css"): @@ -101,10 +153,11 @@ def createAddonHelp(dir): cssTarget = env.Command(cssPath, "style.css", Copy("$TARGET", "$SOURCE")) env.Depends(addon, cssTarget) if os.path.isfile("readme.md"): - readmePath = os.path.join(docsDir, "en", "readme.md") + readmePath = os.path.join(docsDir, buildVars.baseLanguage, "readme.md") readmeTarget = env.Command(readmePath, "readme.md", Copy("$TARGET", "$SOURCE")) env.Depends(addon, readmeTarget) + def createAddonBundleFromPath(path, dest): """ Creates a bundle from a directory that contains an addon manifest file.""" basedir = os.path.abspath(path) @@ -115,25 +168,98 @@ def createAddonBundleFromPath(path, dest): for filename in filenames: pathInBundle = os.path.join(relativePath, filename) absPath = os.path.join(dir, filename) - if pathInBundle not in buildVars.excludedFiles: z.write(absPath, pathInBundle) + if pathInBundle not in buildVars.excludedFiles: + z.write(absPath, pathInBundle) + createAddonStoreJson(dest) return dest + +def createAddonStoreJson(bundle): + """Creates add-on store JSON file from an add-on package and manifest data.""" + import json + import hashlib + # Set different json file names and version number properties based on version number parsing results. + if env["versionNumber"] == "0.0.0": + env["versionNumber"] = buildVars.addon_info["addon_version"] + versionNumberParsed = env["versionNumber"].split(".") + if all([part.isnumeric() for part in versionNumberParsed]): + if len(versionNumberParsed) == 1: + versionNumberParsed += ["0", "0"] + elif len(versionNumberParsed) == 2: + versionNumberParsed.append("0") + else: + versionNumberParsed = [] + if len(versionNumberParsed): + major, minor, patch = [int(part) for part in versionNumberParsed] + jsonFilename = f'{major}.{minor}.{patch}.json' + else: + jsonFilename = f'{buildVars.addon_info["addon_version"]}.json' + major, minor, patch = 0, 0, 0 + print('Generating % s' % jsonFilename) + sha256 = hashlib.sha256() + with open(bundle, "rb") as f: + for byte_block in iter(lambda: f.read(65536), b""): + sha256.update(byte_block) + hashValue = sha256.hexdigest() + try: + minimumNVDAVersion = buildVars.addon_info["addon_minimumNVDAVersion"].split(".") + except AttributeError: + minimumNVDAVersion = [0, 0, 0] + minMajor, minMinor = minimumNVDAVersion[:2] + minPatch = minimumNVDAVersion[-1] if len(minimumNVDAVersion) == 3 else "0" + try: + lastTestedNVDAVersion = buildVars.addon_info["addon_lastTestedNVDAVersion"].split(".") + except AttributeError: + lastTestedNVDAVersion = [0, 0, 0] + lastTestedMajor, lastTestedMinor = lastTestedNVDAVersion[:2] + lastTestedPatch = lastTestedNVDAVersion[-1] if len(lastTestedNVDAVersion) == 3 else "0" + channel = buildVars.addon_info["addon_updateChannel"] + if channel is None: + channel = "stable" + addonStoreEntry = { + "addonId": buildVars.addon_info["addon_name"], + "displayName": buildVars.addon_info["addon_summary"], + "URL": "", + "description": buildVars.addon_info["addon_description"], + "sha256": hashValue, + "homepage": buildVars.addon_info["addon_url"], + "addonVersionName": buildVars.addon_info["addon_version"], + "addonVersionNumber": { + "major": major, + "minor": minor, + "patch": patch + }, + "minNVDAVersion": { + "major": int(minMajor), + "minor": int(minMinor), + "patch": int(minPatch) + }, + "lastTestedVersion": { + "major": int(lastTestedMajor), + "minor": int(lastTestedMinor), + "patch": int(lastTestedPatch) + }, + "channel": channel, + "publisher": "", + "sourceURL": buildVars.addon_info["addon_sourceURL"], + "license": buildVars.addon_info["addon_license"], + "licenseURL": buildVars.addon_info["addon_licenseURL"], + } + with open(jsonFilename, "w") as addonStoreJson: + json.dump(addonStoreEntry, addonStoreJson, indent="\t") + + def generateManifest(source, dest): addon_info = buildVars.addon_info - addon_info["addon_version"] = env["addon_version"] - addon_info["addon_updateChannel"] = env["addon_updateChannel"] with codecs.open(source, "r", "utf-8") as f: manifest_template = f.read() manifest = manifest_template.format(**addon_info) with codecs.open(dest, "w", "utf-8") as f: f.write(manifest) + def generateTranslatedManifest(source, language, out): - # No ugettext in Python 3. - if sys.version_info.major == 2: - _ = gettext.translation("nvda", localedir=os.path.join("addon", "locale"), languages=[language]).ugettext - else: - _ = gettext.translation("nvda", localedir=os.path.join("addon", "locale"), languages=[language]).gettext + _ = gettext.translation("nvda", localedir=os.path.join("addon", "locale"), languages=[language]).gettext vars = {} for var in ("addon_summary", "addon_description"): vars[var] = _(buildVars.addon_info[var]) @@ -143,19 +269,24 @@ def generateTranslatedManifest(source, language, out): with codecs.open(out, "w", "utf-8") as f: f.write(result) + def expandGlobs(files): return [f for pattern in files for f in env.Glob(pattern)] + addon = env.NVDAAddon(addonFile, env.Dir('addon')) langDirs = [f for f in env.Glob(os.path.join("addon", "locale", "*"))] -#Allow all NVDA's gettext po files to be compiled in source/locale, and manifest files to be generated +# Allow all NVDA's gettext po files to be compiled in source/locale, and manifest files to be generated for dir in langDirs: poFile = dir.File(os.path.join("LC_MESSAGES", "nvda.po")) - moFile=env.gettextMoFile(poFile) + moFile = env.gettextMoFile(poFile) env.Depends(moFile, poFile) - translatedManifest = env.NVDATranslatedManifest(dir.File("manifest.ini"), [moFile, os.path.join("manifest-translated.ini.tpl")]) + translatedManifest = env.NVDATranslatedManifest( + dir.File("manifest.ini"), + [moFile, os.path.join("manifest-translated.ini.tpl")] + ) env.Depends(translatedManifest, ["buildVars.py"]) env.Depends(addon, [translatedManifest, moFile]) @@ -163,8 +294,9 @@ pythonFiles = expandGlobs(buildVars.pythonSources) for file in pythonFiles: env.Depends(addon, file) -#Convert markdown files to html -createAddonHelp("addon") # We need at least doc in English and should enable the Help button for the add-on in Add-ons Manager +# Convert markdown files to html +# We need at least doc in English and should enable the Help button for the add-on in Add-ons Manager +createAddonHelp("addon") for mdFile in env.Glob(os.path.join('addon', 'doc', '*', '*.md')): htmlFile = env.markdown(mdFile) env.Depends(htmlFile, mdFile) @@ -172,11 +304,11 @@ for mdFile in env.Glob(os.path.join('addon', 'doc', '*', '*.md')): # Pot target i18nFiles = expandGlobs(buildVars.i18nSources) -gettextvars={ - 'gettext_package_bugs_address' : 'nvda-translations@groups.io', - 'gettext_package_name' : buildVars.addon_info['addon_name'], - 'gettext_package_version' : buildVars.addon_info['addon_version'] - } +gettextvars = { + 'gettext_package_bugs_address': 'nvda-translations@groups.io', + 'gettext_package_name': buildVars.addon_info['addon_name'], + 'gettext_package_version': buildVars.addon_info['addon_version'] +} pot = env.gettextPotFile("${addon_name}.pot", i18nFiles, **gettextvars) env.Alias('pot', pot) @@ -192,4 +324,4 @@ env.Depends(manifest, "buildVars.py") env.Depends(addon, manifest) env.Default(addon) -env.Clean (addon, ['.sconsign.dblite', 'addon/doc/en/']) +env.Clean(addon, ['.sconsign.dblite', 'addon/doc/' + buildVars.baseLanguage + '/'])