diff --git a/addon/GlobalPlugins/frequentText/__init__.py b/addon/GlobalPlugins/frequentText/__init__.py new file mode 100644 index 0000000..4216e3c --- /dev/null +++ b/addon/GlobalPlugins/frequentText/__init__.py @@ -0,0 +1,327 @@ +#-*- coding: utf-8 -*- +# frequentText add-on for NVDA. +# written by Rui Fontes +# Registes the frequently used blocks of text +# Shortcut: WINDOWS+F12 + +import os +import api +import gui +import wx +from keyboardHandler import KeyboardInputGesture +import ui +from configobj import ConfigObj +import time +import globalPluginHandler +import addonHandler +addonHandler.initTranslation() + +_ffIniFile = os.path.join (os.path.dirname(__file__),'frequentText.ini') + +class GlobalPlugin(globalPluginHandler.GlobalPlugin): + def __init__(self): + super(globalPluginHandler.GlobalPlugin, self).__init__() + self.dialog = None + + def readConfig (self): + if not os.path.isfile (_ffIniFile): + return None + config = ConfigObj(_ffIniFile, list_values=True) + blocks = config['Blocks'] + total = len(blocks.keys()) + if not total: + return None + if not len (blocks.keys()): + blocks = None + return blocks + + def script_startFrequentText(self, gesture): + self.showFrequentTextDialog (self) + + script_startFrequentText.__doc__ = _("Opens a dialog box to registe and paste frequent blocks of text.") + + def showFrequentTextDialog (self, dictBlocks): + # Displays the add-on dialog box. + dictBlocks = self.readConfig() + + # Translators: Title of add-on, present in the 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.Centre() + gui.mainFrame.postPopup() + + def terminate (self): + if self.dialog is not None: + self.dialog.Destroy() + + __gestures={ + "kb:WINDOWS+f12": "startFrequentText", + } + +class FrequentTextDialog(wx.Dialog): + 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. + # Label is above the list view. + # Translators: Label the list view that contains the Blocks. + tasksLabel = wx.StaticText(self, -1, label=_('Text blocks list')) + tasksSizer.Add(tasksLabel) + + # 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) + + # Create buttons. + # Buttons are in a horizontal row + buttonsSizer = wx.BoxSizer(wx.HORIZONTAL) + + addButtonID = wx.Window.NewControlId() + # Translators: Button Label to add a new block. + self.addButton = wx.Button(self, addButtonID, _('&Add')) + buttonsSizer.Add (self.addButton) + + 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) + + 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) + + 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) + + 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 closes the add-on. + cancelButton = wx.Button(self, wx.ID_CANCEL, _('&Close')) + buttonsSizer.Add(cancelButton) + + 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.onRemove, id = removeButtonID) + self.listBox.Bind(wx.EVT_KEY_DOWN, self.onKeyPress) + mainSizer.Fit(self) + self.SetSizer(mainSizer) + + 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) + else: + dlg.Destroy() + + def _addBlock(self, name): + # Translators: Message dialog box to add a new block of text. + dlg = wx.TextEntryDialog(gui.mainFrame, _("Enter the block of text"), self.title, style = wx.OK | wx.CANCEL | wx.TE_MULTILINE) + dlg.SetValue("") + if dlg.ShowModal() == wx.ID_OK: + nBlock = dlg.GetValue() + else: + dlg.Destroy() + return + if nBlock != "": + newBlock = nBlock.split("\n") + else: + dlg.Destroy() + return + + #Saving the block + config = ConfigObj(_ffIniFile, list_values=True, encoding = "utf-8") + if 'Blocks' in config.sections: + blocks = config['Blocks'] + blocks.__setitem__ (name, newBlock) + else: + config['Blocks'] = {name:newBlock} + self.dictBlocks = {name:newBlock} + config.write() + self.listBox.Append([name]) + newIndex = self.listBox.FindItem(0,name) + list = [self.dictBlocks.items()] + list.append ((name, newBlock)) + # Puts the focus on the inserted block. + self.listBox.Focus (newIndex) + self.listBox.Select(newIndex) + self.listBox.SetFocus() + name = "" + newBlock = [] + return + + def onPaste (self, evt): + # Simulates typing the block of text in the edit area. + self.Hide() + evt.Skip() + index=self.listBox.GetFocusedItem() + name = self.listBox.GetItemText(index) + paste = self.dictBlocks [name] + for x in range(len(paste)): + if paste[x] == "": + time.sleep(0.1) + KeyboardInputGesture.fromName("Enter").send() + else: + api.copyToClip(str(paste[x])) + time.sleep(0.1) + KeyboardInputGesture.fromName("Control+v").send() + KeyboardInputGesture.fromName("Enter").send() + time.sleep(0.1) + + def onRename(self, evt): + # Renames the selected block. + evt.Skip() + index=self.listBox.GetFocusedItem() + name = self.listBox.GetItemText(index) + 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['Blocks'] + paste = blocks[name] + # update the dictionary. + list = self.dictBlocks.items() + list.append ((newKey, paste)) + list.remove ((name, paste)) + self.dictBlocks = dict (list) + blocks.rename(name, newKey) + config.write() + + # update the list view. + blocks = config['Blocks'] + keys = blocks.keys() + keys.sort() + newIndex = keys.index (newKey) + self.updateBlocks (blocks, newIndex) + + 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['Blocks'] + paste = blocks[name] + self.dialogActive = True + + changeBlock = [] + for x in range(len(paste)): + # Translators: Message dialog box to change a block of text. + dlg = wx.TextEntryDialog(gui.mainFrame, _("Enter the new block of text or press Enter to confirm"), self.title) + dlg.SetValue(paste[x]) + if dlg.ShowModal() == wx.ID_OK: + nBlock = dlg.GetValue() + else: + dlg.Destroy() + return + + if nBlock != "": + changeBlock.append(nBlock) + else: + dlg.Destroy() + return + + # update the dictionary. + name1 = name + config = ConfigObj(_ffIniFile, list_values=True, encoding = "utf-8") + blocks = config['Blocks'] + list = self.dictBlocks.items() + list.append ((name1, changeBlock)) + list.remove ((name1, paste)) + self.dictBlocks = dict (list) + blocks[name1] = changeBlock + config.write() + + # update the list view. + blocks = config['Blocks'] + keys = blocks.keys() + keys.sort() + newIndex = keys.index (name) + self.updateBlocks (blocks, newIndex) + + def onRemove (self, evt): + # Removes the selected block. + evt.Skip() + self.removeItem() + + def removeItem (self): + # Removes the selected block. + index=self.listBox.GetFocusedItem() + name = self.listBox.GetItemText(index) + 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['Blocks'] + blocks.__delitem__(name) + config.write() + self.listBox.DeleteItem(index) + if self.listBox.GetItemCount(): + self.listBox.Select(self.listBox.GetFocusedItem()) + self.dialogActive = False + + 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(): + self.onPaste(evt) + elif keycode == wx.WXK_DELETE and self.listBox.GetItemCount(): + 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() + cont = 0 + for item in keys: + k = item + self.listBox.Append ([k]) + cont += 1 + self.listBox.Focus(index) + self.listBox.Select(index) + diff --git a/addon/doc/pt_BR/readme.md b/addon/doc/pt_BR/readme.md new file mode 100644 index 0000000..e93ddc6 --- /dev/null +++ b/addon/doc/pt_BR/readme.md @@ -0,0 +1,24 @@ +# # Texto frequente + +## Informações +* Autores: Rui Fontes e Ângelo Abrantes, baseado no trabalho de Marcos António de Oliveira +* Actualizado em 27/03/2020 +* Baixar a [versão estável][1] +* Compatibilidade: NVDA versão 2019.3 e seguintes + +## Apresentação +Este complemento fornece uma maneira de inserir rapidamente blocos de texto digitados com freqüência nos documentos que você está escrevendo. + +## Uso +Para começar a usar esse complemento, você precisará preencher os blocos de texto que deseja usar. +Para isso, primeiro pressione Windows + f12. +Será exibida uma caixa de diálogo onde você pode pressionar Tab para acessar o botão "Adicionar". Ative-o para criar um novo bloco. +Na primeira caixa de diálogo, digite o nome do bloco e pressione Enter ou ative o botão "Ok". +Será apresentada uma caixa de diálogo para digitar o bloco de texto. +Quando tiver introduzido todas as linhas, pressione Tab para ir para o botão "Ok" e ative-o. + +Para colar o bloco de texto num campo de edição, seleccione o bloco e pressione Enter. + +Na caixa de diálogo do complemento também pode renomear, alterar o conteúdo ou eliminar um bloco de texto. + +[1] diff --git a/addon/doc/pt_PT/readme.md b/addon/doc/pt_PT/readme.md new file mode 100644 index 0000000..6a5dd2b --- /dev/null +++ b/addon/doc/pt_PT/readme.md @@ -0,0 +1,24 @@ +# # Texto frequente + +## Informações +* Autores: Rui Fontes e Ângelo Abrantes, baseado no trabalho de Marcos António de Oliveira +* Actualizado em 27/03/2020 +* Descarregar a [versão estável][1] +* Compatibilidade: NVDA versão 2019.3 e seguintes + +## Apresentação +Este extra fornece uma maneira de inserir rapidamente blocos de texto digitados com freqüência nos documentos que escreve. + +## Uso +Para começar a usar este extra, precisa preencher os blocos de texto que deseja usar. +Para isso, primeiro pressione Windows + f12. +Será mostrada uma caixa de diálogo onde pode pressionar Tab para aceder ao botão "Adicionar". Active-o para criar um novo bloco. +Na primeira caixa de diálogo, digite o nome do bloco e pressione Enter ou active o botão "Ok". +Será então apresentada uma caixa de diálogo para introduzir o bloco de texto. +Quando tiver introduzido todas as linhas, pressione Tab para ir para o botão "Ok" e active-o. + +Para colar o bloco de texto num campo de edição, seleccione o bloco e pressione Enter. + +Na caixa de diálogo do extra também pode renomear, alterar o conteúdo ou eliminar um bloco de texto. + +[1] diff --git a/addon/installTasks.py b/addon/installTasks.py new file mode 100644 index 0000000..ead75ec --- /dev/null +++ b/addon/installTasks.py @@ -0,0 +1,13 @@ +#-*- coding: utf-8 -*- +# Part of frequentText add-on for NVDA. +# written by Rui Fontes + +import os +import globalVars +import addonHandler + +def onInstall(): + configFilePath = os.path.abspath(os.path.join(globalVars.appArgs.configPath, "addons", "frequentText", "globalPlugins", "frequentText", "frequentText.ini")) + if os.path.isfile(configFilePath): + os.remove(os.path.abspath(os.path.join(globalVars.appArgs.configPath, "addons", "frequentText" + addonHandler.ADDON_PENDINGINSTALL_SUFFIX, "globalPlugins", "frequentText", "frequentText.ini"))) + os.rename(configFilePath, os.path.abspath(os.path.join(globalVars.appArgs.configPath, "addons", "frequentText" + addonHandler.ADDON_PENDINGINSTALL_SUFFIX, "globalPlugins", "frequentText", "frequentText.ini"))) diff --git a/addon/locale/en/LC_MESSAGES/nvda.po b/addon/locale/en/LC_MESSAGES/nvda.po new file mode 100644 index 0000000..cf3d96b --- /dev/null +++ b/addon/locale/en/LC_MESSAGES/nvda.po @@ -0,0 +1,177 @@ +msgid "" +msgstr "" +"Project-Id-Version: FrequentText\n" +"Report-Msgid-Bugs-To: 'nvda-translations@groups.io'\n" +"POT-Creation-Date: 2020-03-27 17:59+0000\n" +"PO-Revision-Date: 2020-03-27 18:01+0000\n" +"Last-Translator: Marcos Antonio de Oliveira \n" +"Language-Team: \n" +"Language: en\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 2.3\n" +"X-Poedit-Basepath: ../../../GlobalPlugins\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Poedit-SourceCharset: UTF-8\n" +"X-Poedit-SearchPath-0: .\n" + +#: addon\globalPlugins\frequentText\__init__.py:41 +msgid "Opens a dialog box to registe and paste frequent blocks of text." +msgstr "" + +#. Translators: Title of add-on, present in the dialog boxes. +#: addon\globalPlugins\frequentText\__init__.py:48 +msgid "Frequent Text" +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:77 +msgid "Text blocks list" +msgstr "" + +#. Translators: Button Label to add a new block. +#: addon\globalPlugins\frequentText\__init__.py:90 +msgid "&Add" +msgstr "" + +#. Translators: Button Label that paste the block to the edit box. +#: addon\globalPlugins\frequentText\__init__.py:95 +msgid "&Paste" +msgstr "" + +#. Translators: Button Label that renames the name of the selected block. +#: addon\globalPlugins\frequentText\__init__.py:100 +msgid "Re&name" +msgstr "" + +#. Translators: Button Label that change the blocks of text. +#: addon\globalPlugins\frequentText\__init__.py:105 +msgid "Change &blocks" +msgstr "" + +#. Translators: Button Label that removes the selected block. +#: addon\globalPlugins\frequentText\__init__.py:110 +msgid "&Remove" +msgstr "" + +#. Translators: Button Label that closes the add-on. +#: addon\globalPlugins\frequentText\__init__.py:114 +msgid "&Close" +msgstr "" + +#. Translators: Message dialog box to add a name to a new block. +#: addon\globalPlugins\frequentText\__init__.py:134 +msgid "Enter a name for the block" +msgstr "" + +#. Translators: Announcement that the block name already exists in the list. +#: addon\globalPlugins\frequentText\__init__.py:143 +#: addon\globalPlugins\frequentText\__init__.py:234 +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:153 +msgid "Enter the block of text" +msgstr "" + +#. Translators: Message dialog to rename the block of text. +#: addon\globalPlugins\frequentText\__init__.py:212 +#, python-format +msgid "Enter a new name for %s" +msgstr "" + +#. Translators: Message dialog box to change a block of text. +#: addon\globalPlugins\frequentText\__init__.py:249 +msgid "Enter the new block of text or press Enter to confirm" +msgstr "" + +#. Translators: Message dialog box to remove the selected block. +#: addon\globalPlugins\frequentText\__init__.py:292 +#, python-format +msgid "Are you sure you want to remove %s?" +msgstr "" + +#. Translators: Title of the column of the list view. +#: addon\globalPlugins\frequentText\__init__.py:314 +msgid "Name" +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. +#: buildVars.py:17 +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:20 +msgid "" +"Stores and make possible the entry of frequently used blocks of text. " +"Command: Windows+F12." +msgstr "" + +#~ msgid "" +#~ "You do not have added folders and is not in the windows explorer window " +#~ "to make a record" +#~ msgstr "" +#~ "No tienes ninguna carpeta registrada y no estás en la ventana del " +#~ "Explorador de Windows para efectuar un registro" + +#~ msgid "Favorite folders" +#~ msgstr "Carpetas favoritas" + +#~ msgid "Favorite folders list" +#~ msgstr "Lista de carpetas favoritas" + +#~ msgid "&Show paths in the list" +#~ msgstr "&Ver las direcciones en la lista" + +#~ msgid "&Open folder" +#~ msgstr "Abrir carpe&ta" + +#~ msgid "Write in the e&dit box" +#~ msgstr "Escriba en el cuadro de e&dición" + +#~ msgid "Ab&out" +#~ msgstr "Ace&rca de" + +#, python-format +#~ msgid "File not found: %s." +#~ msgstr "Archivo no encontrado: %s." + +#, python-format +#~ msgid "Enter a new nickname for %s" +#~ msgstr "Introducir un nuevo nombre de referencia para %s." + +#~ msgid "Nickname" +#~ msgstr "Referencia" + +#~ msgid "Address" +#~ msgstr "Dirección" + +#~ msgid "Enter a nickname" +#~ msgstr "Entre com um nome de referência para a pasta" + +#~ msgid "&Past in editable text" +#~ msgstr "&Colar em caixa de texto" + +#~ msgid "There is already a folder with this reference!" +#~ msgstr "Já existe uma pasta com este nome!" + +#~ msgid "Add to group call" +#~ msgstr "Adicionar à chamada em grupo" + +#~ msgid "Added to the conference" +#~ msgstr "Adicionada a conferência" + +#~ msgid "Could not be added to the conference" +#~ msgstr "" +#~ "Não foi possível adicionar a chamada a conferência.Para utilizar esse " +#~ "recurso você precisa ser o administrador da conferência." + +#~ msgid "Notify window not found" +#~ msgstr "Janela de notificação de chamada não encontrada" diff --git a/addon/locale/pt_BR/LC_MESSAGES/nvda.po b/addon/locale/pt_BR/LC_MESSAGES/nvda.po new file mode 100644 index 0000000..58a08c7 --- /dev/null +++ b/addon/locale/pt_BR/LC_MESSAGES/nvda.po @@ -0,0 +1,205 @@ +msgid "" +msgstr "" +"Project-Id-Version: FrequentText\n" +"Report-Msgid-Bugs-To: 'nvda-translations@groups.io'\n" +"POT-Creation-Date: 2020-03-27 17:59+0000\n" +"PO-Revision-Date: 2020-03-27 18:04+0000\n" +"Last-Translator: Marcos Antonio de Oliveira \n" +"Language-Team: \n" +"Language: pt_BR\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 2.3\n" +"X-Poedit-Basepath: ../../../GlobalPlugins\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Poedit-SourceCharset: UTF-8\n" +"X-Poedit-SearchPath-0: .\n" + +#: addon\globalPlugins\frequentText\__init__.py:41 +msgid "Opens a dialog box to registe and paste frequent blocks of text." +msgstr "" +"Abre uma janela para registar, gerir e selecionar os blocos a colar no texto." + +#. Translators: Title of add-on, present in the dialog boxes. +#: addon\globalPlugins\frequentText\__init__.py:48 +msgid "Frequent Text" +msgstr "Texto frequente" + +#. 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:77 +msgid "Text blocks list" +msgstr "Lista dos blocos de texto" + +#. Translators: Button Label to add a new block. +#: addon\globalPlugins\frequentText\__init__.py:90 +msgid "&Add" +msgstr "&Adicionar" + +#. Translators: Button Label that paste the block to the edit box. +#: addon\globalPlugins\frequentText\__init__.py:95 +msgid "&Paste" +msgstr "&Colar" + +#. Translators: Button Label that renames the name of the selected block. +#: addon\globalPlugins\frequentText\__init__.py:100 +msgid "Re&name" +msgstr "&Renomear" + +#. Translators: Button Label that change the blocks of text. +#: addon\globalPlugins\frequentText\__init__.py:105 +msgid "Change &blocks" +msgstr "Modificar &blocos" + +#. Translators: Button Label that removes the selected block. +#: addon\globalPlugins\frequentText\__init__.py:110 +msgid "&Remove" +msgstr "&Eliminar" + +#. Translators: Button Label that closes the add-on. +#: addon\globalPlugins\frequentText\__init__.py:114 +msgid "&Close" +msgstr "&Fechar" + +#. Translators: Message dialog box to add a name to a new block. +#: addon\globalPlugins\frequentText\__init__.py:134 +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:143 +#: addon\globalPlugins\frequentText\__init__.py:234 +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:153 +msgid "Enter the block of text" +msgstr "Introduza o bloco de texto" + +#. Translators: Message dialog to rename the block of text. +#: addon\globalPlugins\frequentText\__init__.py:212 +#, python-format +msgid "Enter a new name for %s" +msgstr "Introduza um novo nome para %s" + +#. Translators: Message dialog box to change a block of text. +#: addon\globalPlugins\frequentText\__init__.py:249 +msgid "Enter the new block of text or press Enter to confirm" +msgstr "Introduza o novo bloco de texto ou pressione Enter para confirmar" + +#. Translators: Message dialog box to remove the selected block. +#: addon\globalPlugins\frequentText\__init__.py:292 +#, 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:314 +msgid "Name" +msgstr "Nome" + +#. 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. +#: buildVars.py:17 +msgid "Regists blocks of text frequently used" +msgstr "Regista blocos de texto frequentemente usados" + +#. Add-on description +#. Translators: Long description to be shown for this add-on on add-on information from add-ons manager +#: buildVars.py:20 +msgid "" +"Stores and make possible the entry of frequently used blocks of text. " +"Command: Windows+F12." +msgstr "" +"Armazena e torna possível a introdução de blocos de texto frequentemente " +"usados. Comando: Windows+f12." + +#~ msgid "Do you want to add a new line?" +#~ msgstr "Quer adicionar uma nova linha?" + +#, fuzzy +#~| msgid "Frequent Text" +#~ msgid "Frequent text" +#~ msgstr "Texto frequente" + +#~ msgid "You do not have any block registered." +#~ msgstr "Não tem nenhum bloco registado." + +#~ msgid "&Add block" +#~ msgstr "&Adicionar bloco" + +#~ msgid "&Paste the block" +#~ msgstr "&Colar o bloco" + +#~ msgid "&Add folder" +#~ msgstr "&Añadir carpeta" + +#, fuzzy +#~| msgid "There is already a folder with this nickname!" +#~ msgid "There is already a folder with this name!" +#~ msgstr "¡Ya existe una carpeta con esta referencia!" + +#~ msgid "" +#~ "You do not have added folders and is not in the windows explorer window " +#~ "to make a record" +#~ msgstr "" +#~ "No tienes ninguna carpeta registrada y no estás en la ventana del " +#~ "Explorador de Windows para efectuar un registro" + +#~ msgid "Favorite folders" +#~ msgstr "Carpetas favoritas" + +#~ msgid "Favorite folders list" +#~ msgstr "Lista de carpetas favoritas" + +#~ msgid "&Show paths in the list" +#~ msgstr "&Ver las direcciones en la lista" + +#~ msgid "&Open folder" +#~ msgstr "Abrir carpe&ta" + +#~ msgid "Write in the e&dit box" +#~ msgstr "Escriba en el cuadro de e&dición" + +#~ msgid "Ab&out" +#~ msgstr "Ace&rca de" + +#, python-format +#~ msgid "File not found: %s." +#~ msgstr "Archivo no encontrado: %s." + +#, python-format +#~ msgid "Enter a new nickname for %s" +#~ msgstr "Introducir un nuevo nombre de referencia para %s." + +#~ msgid "Nickname" +#~ msgstr "Referencia" + +#~ msgid "Address" +#~ msgstr "Dirección" + +#~ msgid "Enter a nickname" +#~ msgstr "Entre com um nome de referência para a pasta" + +#~ msgid "&Past in editable text" +#~ msgstr "&Colar em caixa de texto" + +#~ msgid "There is already a folder with this reference!" +#~ msgstr "Já existe uma pasta com este nome!" + +#~ msgid "Add to group call" +#~ msgstr "Adicionar à chamada em grupo" + +#~ msgid "Added to the conference" +#~ msgstr "Adicionada a conferência" + +#~ msgid "Could not be added to the conference" +#~ msgstr "" +#~ "Não foi possível adicionar a chamada a conferência.Para utilizar esse " +#~ "recurso você precisa ser o administrador da conferência." + +#~ msgid "Notify window not found" +#~ msgstr "Janela de notificação de chamada não encontrada" diff --git a/addon/locale/pt_PT/LC_MESSAGES/nvda.po b/addon/locale/pt_PT/LC_MESSAGES/nvda.po new file mode 100644 index 0000000..115ce48 --- /dev/null +++ b/addon/locale/pt_PT/LC_MESSAGES/nvda.po @@ -0,0 +1,205 @@ +msgid "" +msgstr "" +"Project-Id-Version: FrequentText\n" +"Report-Msgid-Bugs-To: 'nvda-translations@groups.io'\n" +"POT-Creation-Date: 2020-03-27 17:59+0000\n" +"PO-Revision-Date: 2020-03-27 18:30+0000\n" +"Last-Translator: Marcos Antonio de Oliveira \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 2.3\n" +"X-Poedit-Basepath: ../../../GlobalPlugins\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Poedit-SourceCharset: UTF-8\n" +"X-Poedit-SearchPath-0: .\n" + +#: addon\globalPlugins\frequentText\__init__.py:41 +msgid "Opens a dialog box to registe and paste frequent blocks of text." +msgstr "" +"Abre uma janela para registar, gerir e selecionar os blocos a colar no texto." + +#. Translators: Title of add-on, present in the dialog boxes. +#: addon\globalPlugins\frequentText\__init__.py:48 +msgid "Frequent Text" +msgstr "Texto frequente" + +#. 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:77 +msgid "Text blocks list" +msgstr "Lista dos blocos de texto" + +#. Translators: Button Label to add a new block. +#: addon\globalPlugins\frequentText\__init__.py:90 +msgid "&Add" +msgstr "&Adicionar" + +#. Translators: Button Label that paste the block to the edit box. +#: addon\globalPlugins\frequentText\__init__.py:95 +msgid "&Paste" +msgstr "&Colar" + +#. Translators: Button Label that renames the name of the selected block. +#: addon\globalPlugins\frequentText\__init__.py:100 +msgid "Re&name" +msgstr "&Renomear" + +#. Translators: Button Label that change the blocks of text. +#: addon\globalPlugins\frequentText\__init__.py:105 +msgid "Change &blocks" +msgstr "Modificar &blocos" + +#. Translators: Button Label that removes the selected block. +#: addon\globalPlugins\frequentText\__init__.py:110 +msgid "&Remove" +msgstr "&Eliminar" + +#. Translators: Button Label that closes the add-on. +#: addon\globalPlugins\frequentText\__init__.py:114 +msgid "&Close" +msgstr "&Fechar" + +#. Translators: Message dialog box to add a name to a new block. +#: addon\globalPlugins\frequentText\__init__.py:134 +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:143 +#: addon\globalPlugins\frequentText\__init__.py:234 +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:153 +msgid "Enter the block of text" +msgstr "Introduza o bloco de texto" + +#. Translators: Message dialog to rename the block of text. +#: addon\globalPlugins\frequentText\__init__.py:212 +#, python-format +msgid "Enter a new name for %s" +msgstr "Introduza um novo nome para %s" + +#. Translators: Message dialog box to change a block of text. +#: addon\globalPlugins\frequentText\__init__.py:249 +msgid "Enter the new block of text or press Enter to confirm" +msgstr "Introduza o novo bloco de texto ou pressione Enter para confirmar" + +#. Translators: Message dialog box to remove the selected block. +#: addon\globalPlugins\frequentText\__init__.py:292 +#, 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:314 +msgid "Name" +msgstr "Nome" + +#. 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. +#: buildVars.py:17 +msgid "Regists blocks of text frequently used" +msgstr "Regista blocos de texto frequentemente usados" + +#. Add-on description +#. Translators: Long description to be shown for this add-on on add-on information from add-ons manager +#: buildVars.py:20 +msgid "" +"Stores and make possible the entry of frequently used blocks of text. " +"Command: Windows+F12." +msgstr "" +"Armazena e torna possível a introdução de blocos de texto frequentemente " +"usados. Comando: Windows+f12." + +#~ msgid "Do you want to add a new line?" +#~ msgstr "Quer adicionar uma nova linha?" + +#, fuzzy +#~| msgid "Frequent Text" +#~ msgid "Frequent text" +#~ msgstr "Texto frequente" + +#~ msgid "You do not have any block registered." +#~ msgstr "Não tem nenhum bloco registado." + +#~ msgid "&Add block" +#~ msgstr "&Adicionar bloco" + +#~ msgid "&Paste the block" +#~ msgstr "&Colar o bloco" + +#~ msgid "&Add folder" +#~ msgstr "&Añadir carpeta" + +#, fuzzy +#~| msgid "There is already a folder with this nickname!" +#~ msgid "There is already a folder with this name!" +#~ msgstr "¡Ya existe una carpeta con esta referencia!" + +#~ msgid "" +#~ "You do not have added folders and is not in the windows explorer window " +#~ "to make a record" +#~ msgstr "" +#~ "No tienes ninguna carpeta registrada y no estás en la ventana del " +#~ "Explorador de Windows para efectuar un registro" + +#~ msgid "Favorite folders" +#~ msgstr "Carpetas favoritas" + +#~ msgid "Favorite folders list" +#~ msgstr "Lista de carpetas favoritas" + +#~ msgid "&Show paths in the list" +#~ msgstr "&Ver las direcciones en la lista" + +#~ msgid "&Open folder" +#~ msgstr "Abrir carpe&ta" + +#~ msgid "Write in the e&dit box" +#~ msgstr "Escriba en el cuadro de e&dición" + +#~ msgid "Ab&out" +#~ msgstr "Ace&rca de" + +#, python-format +#~ msgid "File not found: %s." +#~ msgstr "Archivo no encontrado: %s." + +#, python-format +#~ msgid "Enter a new nickname for %s" +#~ msgstr "Introducir un nuevo nombre de referencia para %s." + +#~ msgid "Nickname" +#~ msgstr "Referencia" + +#~ msgid "Address" +#~ msgstr "Dirección" + +#~ msgid "Enter a nickname" +#~ msgstr "Entre com um nome de referência para a pasta" + +#~ msgid "&Past in editable text" +#~ msgstr "&Colar em caixa de texto" + +#~ msgid "There is already a folder with this reference!" +#~ msgstr "Já existe uma pasta com este nome!" + +#~ msgid "Add to group call" +#~ msgstr "Adicionar à chamada em grupo" + +#~ msgid "Added to the conference" +#~ msgstr "Adicionada a conferência" + +#~ msgid "Could not be added to the conference" +#~ msgstr "" +#~ "Não foi possível adicionar a chamada a conferência.Para utilizar esse " +#~ "recurso você precisa ser o administrador da conferência." + +#~ msgid "Notify window not found" +#~ msgstr "Janela de notificação de chamada não encontrada" diff --git a/buildVars.py b/buildVars.py index 971a48a..4e2124a 100644 --- a/buildVars.py +++ b/buildVars.py @@ -11,26 +11,25 @@ # for previously unpublished addons, please follow the community guidelines at: # https://bitbucket.org/nvdaaddonteam/todo/raw/master/guidelines.txt # add-on Name, internal for nvda - "addon_name" : "addonTemplate", + "addon_name" : "frequentText", # 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. - "addon_summary" : _("Add-on user visible name"), + "addon_summary" : _("Regists blocks of text frequently used"), # Add-on description # Translators: Long description to be shown for this add-on on add-on information from add-ons manager - "addon_description" : _("""Description for the add-on. -It can span multiple lines."""), + "addon_description" : _("""Stores and make possible the entry of frequently used blocks of text. Command: Windows+F12."""), # version - "addon_version" : "x.y", + "addon_version" : "1.0", # Author(s) - "addon_author" : u"name ", + "addon_author" : u"Rui Fontes and Ângelo Abrantes ", # URL for the add-on documentation support - "addon_url" : None, + "addon_url" : "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" : None, + "addon_minimumNVDAVersion" : "2019.3", # Last NVDA version supported/tested (e.g. "2018.4.0", ideally more recent than minimum version) - "addon_lastTestedNVDAVersion" : None, + "addon_lastTestedNVDAVersion" : "2020.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, } @@ -40,7 +39,7 @@ # Define the python files that are the sources of your add-on. # You can use glob expressions here, they will be expanded. -pythonSources = [] +pythonSources = ["addon/globalPlugins/frequentText/*.py", "addon/*.py"] # Files that contain strings for translation. Usually your python sources i18nSources = pythonSources + ["buildVars.py"] diff --git a/readme.md b/readme.md index 0e765dc..24661e4 100644 --- a/readme.md +++ b/readme.md @@ -1,54 +1,24 @@ -# NVDA Add-on Scons Template # +# Frequent text -This package contains a basic template structure for NVDA add-on development, building, distribution and localization. -For details about NVDA add-on development please see the [NVDA Developer Guide](http://www.nvda-project.org/documentation/developerGuide.html). -The NVDA addon development/discussion list [is here](https://nvda-addons.groups.io/g/nvda-addons) +## Informations +* Authors: Rui Fontes and Ângelo Abrantes, based on work of Marcos António de Oliveira +* Updated in 24/03/2020 +* Download [stable version][1] +* Compatibility: NVDA version 2019.3 and posteriors -Copyright (C) 2012-2019 nvda addon team contributors. - -This package is distributed under the terms of the GNU General Public License, version 2 or later. Please see the file COPYING.txt for further details. - -## Features - -This template provides the following features you can use to help NVDA add-on development: - -* Automatic add-on package creation, with naming and version loaded from a centralized build variables file (buildVars.py). -* Manifest file creation using a template (manifest.ini.tpl). Build variables are replaced on this template. -* Compilation of gettext mo files before distribution, when needed. - * To generate a gettext pot file, please run scons pot. A **addon-name.pot** file will be created with all gettext messages for your add-on. You need to check the buildVars.i18nSources variable to comply with your requirements. -* Automatic generation of manifest localization files directly from gettext po files. Please make sure buildVars.py is included in i18nFiles. -* Automatic generation of HTML documents from markdown (.md) files, to manage documentation in different languages. - -## Requirements - -You need the following software to use this code for your NVDA add-ons development: - -* a Python distribution (2.7 or greater is recommended). Check the [Python Website](http://www.python.org) for Windows Installers. -* Scons - [Website](http://www.scons.org/) - version 2.1.0 or greater. Install it using **easy_install** or grab an windows installer from the website. -* GNU Gettext tools, if you want to have localization support for your add-on - Recommended. Any Linux distro or cygwin have those installed. You can find windows builds [here](http://gnuwin32.sourceforge.net/downlinks/gettext.php). -* Markdown-2.0.1 or greater, if you want to convert documentation files to HTML documents. You can [Download Markdown-2.0.1 installer for Windows](https://pypi.python.org/pypi/Markdown/2.0.1) or get it using `easy_install markdown`. +## Presentation +This add-on provides a way to insert quickly blocks of text you type frequently in documents you write. ## Usage -### To create a new NVDA add-on, taking advantage of this template: - -1. Create an empty folder to hold the files for your add-on. -2. Copy the **site_scons** folder, and the following files, into your new empty folder: **buildVars.py**, **manifest.ini.tpl**, **manifest-translated.ini.tpl**, **sconstruct**, **.gitignore**, and **.gitattributes** -3. Create an **addon** folder inside your new folder. Inside the **addon* folder, create needed folders for the add-on modules (e.g. appModules, synthDrivers, etc.). An add-on may have one or more module folders. -4. In the **buildVars.py** file, change variable **addon_info** with your add-on's information (name, summary, description, version, author and url). -5. Put your code in the usual folders for NVDA extension, under the **addon** folder. For instance: globalPlugins, synthDrivers, etc. -6. Gettext translations must be placed into addon\locale\/LC_MESSAGES\nvda.po. - -### To manage documentation files for your addon: - -1. Copy the **readme.md** file for your add-on to the first created folder, where you copied **buildVars.py**. You can also copy **style.css** to improve the presentation of HTML documents. -2. Documentation files (named **readme.md**) must be placed into addon\doc\/. - -+### To package the add-on for distribution: - -1. Open a command line, change to the folder that has the **sconstruct** file (usually the root of your add-on development folder) and run the **scons** command. The created add-on, if there were no errors, is placed in the current directory. -2. You can further customize variables in the **buildVars.py** file. +To start using this add-on you will need to fill the blocks of text you want to use. +For that, first press Windows+f12. +It will be displayed a dialog where you can press Tab to access the "Add" button. Activate it to create a new block. +In the first dialog, type the name of the block and press Enter or activate the "Ok" button. +It will present a dialog to type the block of text, one line at a time. +If you want to include a blank line, type only a space. +After each line you are prompted if you want to create one mor line or not. +When done, you will be returned to the main add-on dialog with the list of blocks. -Note that this template only provides a basic add-on structure and build infrastructure. You may need to adapt it for your specific needs. +To paste the block of text in the edit field, just select the block and press Enter. -If you have any issues please use the NVDA addon list mentioned above.