Index: gc_lang/fr/config.ini ================================================================== --- gc_lang/fr/config.ini +++ gc_lang/fr/config.ini @@ -90,10 +90,14 @@ # Dictionary Options oxt/DictOptions/DictOptions.py = pythonpath/DictOptions.py oxt/DictOptions/do_strings.py = pythonpath/do_strings.py oxt/DictOptions/LexiconEditor.py = pythonpath/LexiconEditor.py oxt/DictOptions/lxe_strings.py = pythonpath/lxe_strings.py +oxt/DictOptions/SearchWords.py = pythonpath/SearchWords.py +oxt/DictOptions/sw_strings.py = pythonpath/sw_strings.py +oxt/DictOptions/TagsInfo.py = pythonpath/TagsInfo.py +oxt/DictOptions/ti_strings.py = pythonpath/ti_strings.py # ContextMenu oxt/ContextMenu/ContextMenu.py = ContextMenu.py oxt/ContextMenu/jobs.xcu = config/jobs.xcu # TextFormatter oxt/TextFormatter/TextFormatter.py = pythonpath/TextFormatter.py Index: gc_lang/fr/oxt/DictOptions/LexiconEditor.py ================================================================== --- gc_lang/fr/oxt/DictOptions/LexiconEditor.py +++ gc_lang/fr/oxt/DictOptions/LexiconEditor.py @@ -1,8 +1,8 @@ # Lexicon Editor # by Olivier R. -# License: GPL 3 +# License: MPL 2 import unohelper import uno import json import re @@ -13,10 +13,13 @@ import grammalecte.graphspell as sc import grammalecte.graphspell.dawg as dawg import grammalecte.graphspell.ibdawg as ibdawg import grammalecte.fr.conj as conj import grammalecte.fr.conj_generator as conjgen + +import SearchWords +import TagsInfo from com.sun.star.task import XJobExecutor from com.sun.star.awt import XActionListener from com.sun.star.awt import XKeyListener @@ -91,10 +94,11 @@ self.xDialog.insertByName(name, xGridModel) return xGridModel def run (self, sLang): # ui lang + self.sLang = sLang self.dUI = lxe_strings.getUI(sLang) # dialog self.xDialog = self.xSvMgr.createInstanceWithContext('com.sun.star.awt.UnoControlDialogModel', self.ctx) self.xDialog.Width = 570 @@ -136,15 +140,17 @@ self._addWidget("dictionary_section", 'FixedLine', nX1, nY0, 180, nHeight, Label = self.dUI.get("dictionary_section", "#err"), FontDescriptor = xFDTitle, TextColor = 0x000088) self._addWidget("save_date_label", 'FixedText', nXB, nY0+2, 80, nHeight, Label = self.dUI.get("save_date_label", "#err"), FontDescriptor = xFDSubTitle, TextColor = 0x000088) self._addWidget("num_of_entries_label2", 'FixedText', nXC, nY0+2, 65, nHeight, Label = self.dUI.get("num_of_entries_label", "#err"), FontDescriptor = xFDSubTitle, TextColor = 0x000088) self.xDateDic = self._addWidget("save_date", 'FixedText', nXB+85, nY0+2, 75, nHeight, Label = self.dUI.get("void", "#err"), FontDescriptor = xFDSubTitle, TextColor = 0x000088) self.xNumDic = self._addWidget("num_of_entries2", 'FixedText', nXC+70, nY0+2, 45, nHeight, Label = "0", FontDescriptor = xFDSubTitle, TextColor = 0x000088) - self.xExport = self._addWidget('export_button', 'Button', nXC+150, nY0, 50, 12, Label = self.dUI.get('export_button', "#err"), FontDescriptor = xFDSubTitle, TextColor = 0x005500) + self.xExport = self._addWidget('export_button', 'Button', nXC+150, nY0, 50, 12, Label = self.dUI.get('export_button', "#err"), FontDescriptor = xFDSubTitle, TextColor = 0x000055) #### Add word self._addWidget("add_section", 'FixedLine', nX1, nY1, 180, nHeight, Label = self.dUI.get("add_section", "#err"), FontDescriptor = xFDTitle) - self.xLemma = self._addWidget('lemma', 'Edit', nX1, nY1+10, 120, 14, FontDescriptor = xFDTitle) + self.xLemma = self._addWidget('lemma', 'Edit', nX1, nY1+10, 110, 14, FontDescriptor = xFDTitle) + self._addWidget('search_button', 'Button', nX1+115, nY1+11, 45, 12, Label = self.dUI.get('search_button', "#err"), FontDescriptor = xFDSubTitle, TextColor = 0x555500) + self._addWidget('information_button', 'Button', nX1+165, nY1+11, 15, 12, Label = self.dUI.get('information_button', "#err"), FontDescriptor = xFDSubTitle, TextColor = 0x555500) # Radio buttons: main POS tag # Note: the only way to group RadioButtons is to create them successively self.xNA = self._addWidget('nom_adj', 'RadioButton', nX1, nY2+12, 60, nHeight, Label = self.dUI.get("nom_adj", "#err"), HelpText = ":N:A") self.xN = self._addWidget('nom', 'RadioButton', nX1, nY2+22, 60, nHeight, Label = self.dUI.get("nom", "#err"), HelpText = ":N") @@ -165,11 +171,11 @@ self.xSs = self._addWidget('Ss', 'RadioButton', nX1+120, nY2+12, 50, nHeight, Label = self.dUI.get("-s", "#err"), HelpText = "·s") self.xSx = self._addWidget('Sx', 'RadioButton', nX1+120, nY2+22, 50, nHeight, Label = self.dUI.get("-x", "#err"), HelpText = "·x") self.xSinv = self._addWidget('Sinv', 'RadioButton', nX1+120, nY2+32, 50, nHeight, Label = self.dUI.get("inv", "#err"), HelpText = ":i") self._addWidget("alt_lemma_label", 'FixedLine', nX1+10, nY2+42, 170, nHeight, Label = self.dUI.get("alt_lemma", "#err")) - self.xAltLemma = self._addWidget('alt_lemma', 'Edit', nX1+10, nY2+52, 120, nHeight) + self.xAltLemma = self._addWidget('alt_lemma', 'Edit', nX1+10, nY2+52, 110, nHeight) self.xNA2 = self._addWidget('nom_adj2', 'RadioButton', nX1+10, nY2+65, 60, nHeight, Label = self.dUI.get("nom_adj", "#err"), HelpText = ":N:A") self.xN2 = self._addWidget('nom2', 'RadioButton', nX1+10, nY2+75, 60, nHeight, Label = self.dUI.get("nom", "#err"), HelpText = ":N") self.xA2 = self._addWidget('adj2', 'RadioButton', nX1+10, nY2+85, 60, nHeight, Label = self.dUI.get("adj", "#err"), HelpText = ":A") self._addWidget("fl_sep2", 'FixedLine', nX1, nY2, 1, nHeight) self.xSepi2 = self._addWidget('Sepi2', 'RadioButton', nX1+75, nY2+65, 50, nHeight, Label = self.dUI.get("epi", "#err"), HelpText = ":e") @@ -245,10 +251,14 @@ self._createKeyListeners(['lemma', 'alt_lemma', "v_pattern", 'flexion', 'tags'], "Update") self._createActionListeners(['nom_adj', 'nom', 'adj', 'M1', 'M2', 'MP', 'verb', 'adv', 'other', \ 'Sepi', 'Smas', 'Sfem', 'Ss', 'Sx', 'Sinv', 'nom_adj2', 'nom2', 'adj2', \ 'Sepi2', 'Smas2', 'Sfem2', 'Ss2', 'Sx2', 'Sinv2', 'Mepi', 'Mmas', 'Mfem', \ 'v_i', 'v_t', 'v_n', 'v_p', 'v_m', 'v_ae', 'v_aa', 'v_pp'], "Update") + self.xContainer.getControl('search_button').addActionListener(self) + self.xContainer.getControl('search_button').setActionCommand('SearchWords') + self.xContainer.getControl('information_button').addActionListener(self) + self.xContainer.getControl('information_button').setActionCommand('TagsInfo') self.xContainer.getControl('add_button').addActionListener(self) self.xContainer.getControl('add_button').setActionCommand('Add') self.xContainer.getControl('delete_button').addActionListener(self) self.xContainer.getControl('delete_button').setActionCommand('Delete') self.xContainer.getControl('save_button').addActionListener(self) @@ -272,10 +282,14 @@ # XActionListener def actionPerformed (self, xActionEvent): try: if xActionEvent.ActionCommand == "Update": self.updateGenWords() + elif xActionEvent.ActionCommand == "SearchWords": + self.launchSearchWords() + elif xActionEvent.ActionCommand == "TagsInfo": + self.launchTagsInfo() elif xActionEvent.ActionCommand == "Add": self.addToLexicon() elif xActionEvent.ActionCommand == "Delete": self.deleteSelectedEntries() elif xActionEvent.ActionCommand == "Save": @@ -303,20 +317,27 @@ xDialog.run() except: traceback.print_exc() # Code + def launchSearchWords (self): + xDialog = SearchWords.SearchWords(self.ctx) + xDialog.run(self.sLang) + + def launchTagsInfo (self): + xDialog = TagsInfo.TagsInfo(self.ctx) + xDialog.run(self.sLang) + #@_waitPointer (don’t: strange behavior) def loadLexicon (self): xChild = self.xSettingNode.getByName("o_fr") sJSON = xChild.getPropertyValue("personal_dic") if sJSON != "": oIBDAWG = ibdawg.IBDAWG(json.loads(sJSON)) xGridDataModel = self.xGridModelLex.GridDataModel - for i, sLine in enumerate(oIBDAWG.select()): - sFlexion, sLemma, sTag = sLine.split("\t") - xGridDataModel.addRow(i, (sFlexion, sLemma, sTag)) + for i, aEntry in enumerate(oIBDAWG.select()): + xGridDataModel.addRow(i, aEntry) self.xNumLex.Label = str(i) self.xNumDic.Label = str(i) self.xDateDic.Label = oIBDAWG.sDate @_waitPointer ADDED gc_lang/fr/oxt/DictOptions/SearchWords.py Index: gc_lang/fr/oxt/DictOptions/SearchWords.py ================================================================== --- /dev/null +++ gc_lang/fr/oxt/DictOptions/SearchWords.py @@ -0,0 +1,176 @@ +# Search and informations about tags +# by Olivier R. +# License: MPL 2 + +import unohelper +import uno +import traceback + +import helpers +import sw_strings +import grammalecte.graphspell as sc +import grammalecte.graphspell.ibdawg as ibdawg + +from com.sun.star.task import XJobExecutor +from com.sun.star.awt import XActionListener + + +def _waitPointer (funcDecorated): + def wrapper (*args, **kwargs): + # self is the first parameter if the decorator is applied on a object + self = args[0] + # before + xPointer = self.xSvMgr.createInstanceWithContext("com.sun.star.awt.Pointer", self.ctx) + xPointer.setType(uno.getConstantByName("com.sun.star.awt.SystemPointer.WAIT")) + xWindowPeer = self.xContainer.getPeer() + xWindowPeer.setPointer(xPointer) + for x in xWindowPeer.Windows: + x.setPointer(xPointer) + # processing + result = funcDecorated(*args, **kwargs) + # after + xPointer.setType(uno.getConstantByName("com.sun.star.awt.SystemPointer.ARROW")) + xWindowPeer.setPointer(xPointer) + for x in xWindowPeer.Windows: + x.setPointer(xPointer) + self.xContainer.setVisible(True) # seems necessary to refresh the dialog box and text widgets (why?) + # return + return result + return wrapper + + +class SearchWords (unohelper.Base, XActionListener): + + def __init__ (self, ctx): + self.ctx = ctx + self.xSvMgr = self.ctx.ServiceManager + self.xDesktop = self.xSvMgr.createInstanceWithContext("com.sun.star.frame.Desktop", self.ctx) + self.xDocument = self.xDesktop.getCurrentComponent() + self.xContainer = None + self.xDialog = None + self.oSpellChecker = None + # options node + self.xSettingNode = helpers.getConfigSetting("/org.openoffice.Lightproof_grammalecte/Other/", True) + + def _addWidget (self, name, wtype, x, y, w, h, **kwargs): + xWidget = self.xDialog.createInstance('com.sun.star.awt.UnoControl%sModel' % wtype) + xWidget.Name = name + xWidget.PositionX = x + xWidget.PositionY = y + xWidget.Width = w + xWidget.Height = h + for k, w in kwargs.items(): + setattr(xWidget, k, w) + self.xDialog.insertByName(name, xWidget) + return xWidget + + def _addGrid (self, name, x, y, w, h, columns, **kwargs): + xGridModel = self.xDialog.createInstance('com.sun.star.awt.grid.UnoControlGridModel') + xGridModel.Name = name + xGridModel.PositionX = x + xGridModel.PositionY = y + xGridModel.Width = w + xGridModel.Height = h + xColumnModel = xGridModel.ColumnModel + for e in columns: + xCol = xColumnModel.createColumn() + for k, w in e.items(): + setattr(xCol, k, w) + xColumnModel.addColumn(xCol) + for k, w in kwargs.items(): + setattr(xGridModel, k, w) + self.xDialog.insertByName(name, xGridModel) + return xGridModel + + def run (self, sLang): + # ui lang + self.dUI = sw_strings.getUI(sLang) + + # dialog + self.xDialog = self.xSvMgr.createInstanceWithContext('com.sun.star.awt.UnoControlDialogModel', self.ctx) + self.xDialog.Width = 350 + self.xDialog.Height = 305 + self.xDialog.Title = self.dUI.get('title', "#title#") + #xWindowSize = helpers.getWindowSize() + #self.xDialog.PositionX = int((xWindowSize.Width / 2) - (self.xDialog.Width / 2)) + #self.xDialog.PositionY = int((xWindowSize.Height / 2) - (self.xDialog.Height / 2)) + + # fonts + xFDTitle = uno.createUnoStruct("com.sun.star.awt.FontDescriptor") + xFDTitle.Height = 9 + xFDTitle.Weight = uno.getConstantByName("com.sun.star.awt.FontWeight.BOLD") + xFDTitle.Name = "Verdana" + + xFDSubTitle = uno.createUnoStruct("com.sun.star.awt.FontDescriptor") + xFDSubTitle.Height = 8 + xFDSubTitle.Weight = uno.getConstantByName("com.sun.star.awt.FontWeight.BOLD") + xFDSubTitle.Name = "Verdana" + + # widget + nX1 = 10 + nX2 = nX1 + 130 + + nY0 = 5 + nY1 = nY0 + 20 + nY2 = nY1 + 60 + nY3 = nY2 + 95 + + nHeight = 10 + + #### Search + self._addWidget("search_section", 'FixedLine', nX1, nY0, 120, nHeight, Label = self.dUI.get("search_section", "#err"), FontDescriptor = xFDTitle) + self._addWidget("similar_search_section", 'FixedLine', nX1, nY1, 120, nHeight, Label = self.dUI.get("similar_search_section", "#err"), FontDescriptor = xFDTitle) + self.xWord = self._addWidget('word', 'Edit', nX1, nY1+10, 100, nHeight) + self._addWidget('similar_search_button', 'Button', nX1, nY1+22, 55, 12, Label = self.dUI.get('similar_search_button', "#err"), FontDescriptor = xFDSubTitle, TextColor = 0x005500) + + + self._addWidget("regex_search_section", 'FixedLine', nX1, nY2, 120, nHeight, Label = self.dUI.get("regex_search_section", "#err"), FontDescriptor = xFDSubTitle) + self._addWidget('flexion_label', 'FixedText', nX1, nY2+10, 30, nHeight, Label = self.dUI.get('flexion', "#err")) + self.xFlexion = self._addWidget('flexion', 'Edit', nX1+35, nY2+10, 85, nHeight) + self._addWidget('tags_label', 'FixedText', nX1, nY2+22, 30, nHeight, Label = self.dUI.get('tags', "#err")) + self.xTags = self._addWidget('tags', 'Edit', nX1+35, nY2+22, 85, nHeight) + self._addWidget('regex_search_button', 'Button', nX1, nY2+34, 55, 12, Label = self.dUI.get('regex_search_button', "#err"), FontDescriptor = xFDSubTitle, TextColor = 0x005500) + + #### Results + self._addWidget("result_section", 'FixedLine', nX2, nY0, 200, nHeight, Label = self.dUI.get("result_section", "#err"), FontDescriptor = xFDTitle) + self.xGridModel = self._addGrid("list_grid_search", nX2, nY0+10, 200, 265, [ + {"Title": self.dUI.get("res_flexion", "#err"), "ColumnWidth": 70}, + {"Title": self.dUI.get("res_lemma", "#err"), "ColumnWidth": 60}, + {"Title": self.dUI.get("res_tags", "#err"), "ColumnWidth": 70} + ]) + + self._addWidget('close_button', 'Button', self.xDialog.Width-50, self.xDialog.Height-20, 40, 12, Label = self.dUI.get('close_button', "#err"), FontDescriptor = xFDSubTitle, TextColor = 0x550000) + + # container + self.xContainer = self.xSvMgr.createInstanceWithContext('com.sun.star.awt.UnoControlDialog', self.ctx) + self.xContainer.setModel(self.xDialog) + self.xGridControlSearch = self.xContainer.getControl('list_grid_search') + self.xGridControlInfo = self.xContainer.getControl('list_grid_info') + self.xContainer.getControl('similar_search_button').addActionListener(self) + self.xContainer.getControl('similar_search_button').setActionCommand('SearchSimilar') + self.xContainer.getControl('regex_search_button').addActionListener(self) + self.xContainer.getControl('regex_search_button').setActionCommand('SearchRegex') + self.xContainer.getControl('close_button').addActionListener(self) + self.xContainer.getControl('close_button').setActionCommand('Close') + self.xContainer.setVisible(False) + xToolkit = self.xSvMgr.createInstanceWithContext('com.sun.star.awt.ExtToolkit', self.ctx) + self.xContainer.createPeer(xToolkit, None) + self.xContainer.execute() + + # XActionListener + def actionPerformed (self, xActionEvent): + try: + if xActionEvent.ActionCommand == "SearchSimilar": + self.searchSimilar() + elif xActionEvent.ActionCommand == "SearchRegex": + self.searchRegex() + elif xActionEvent.ActionCommand == "Close": + self.xContainer.endExecute() + except: + traceback.print_exc() + + def searchSimilar (self): + pass + + def searchRegex (self): + pass ADDED gc_lang/fr/oxt/DictOptions/TagsInfo.py Index: gc_lang/fr/oxt/DictOptions/TagsInfo.py ================================================================== --- /dev/null +++ gc_lang/fr/oxt/DictOptions/TagsInfo.py @@ -0,0 +1,146 @@ +# Lexicon editor: Information +# by Olivier R. +# License: MPL 2 + +import unohelper +import uno +import traceback + +import helpers +import ti_strings + +import grammalecte.fr.lexicographe as lxg + +from com.sun.star.task import XJobExecutor +from com.sun.star.awt import XActionListener + + + +class TagsInfo (unohelper.Base, XActionListener): + + def __init__ (self, ctx): + self.ctx = ctx + self.xSvMgr = self.ctx.ServiceManager + self.xDesktop = self.xSvMgr.createInstanceWithContext("com.sun.star.frame.Desktop", self.ctx) + self.xDocument = self.xDesktop.getCurrentComponent() + self.xContainer = None + self.xDialog = None + + def _addWidget (self, name, wtype, x, y, w, h, **kwargs): + xWidget = self.xDialog.createInstance('com.sun.star.awt.UnoControl%sModel' % wtype) + xWidget.Name = name + xWidget.PositionX = x + xWidget.PositionY = y + xWidget.Width = w + xWidget.Height = h + for k, w in kwargs.items(): + setattr(xWidget, k, w) + self.xDialog.insertByName(name, xWidget) + return xWidget + + def _addGrid (self, name, x, y, w, h, columns, **kwargs): + xGridModel = self.xDialog.createInstance('com.sun.star.awt.grid.UnoControlGridModel') + xGridModel.Name = name + xGridModel.PositionX = x + xGridModel.PositionY = y + xGridModel.Width = w + xGridModel.Height = h + xColumnModel = xGridModel.ColumnModel + for e in columns: + xCol = xColumnModel.createColumn() + for k, w in e.items(): + setattr(xCol, k, w) + xColumnModel.addColumn(xCol) + for k, w in kwargs.items(): + setattr(xGridModel, k, w) + self.xDialog.insertByName(name, xGridModel) + return xGridModel + + def run (self, sLang): + # ui lang + self.dUI = ti_strings.getUI(sLang) + + # dialog + self.xDialog = self.xSvMgr.createInstanceWithContext('com.sun.star.awt.UnoControlDialogModel', self.ctx) + self.xDialog.Width = 360 + self.xDialog.Height = 305 + self.xDialog.Title = self.dUI.get('title', "#title#") + #xWindowSize = helpers.getWindowSize() + #self.xDialog.PositionX = int((xWindowSize.Width / 2) - (self.xDialog.Width / 2)) + #self.xDialog.PositionY = int((xWindowSize.Height / 2) - (self.xDialog.Height / 2)) + + # fonts + xFDTitle = uno.createUnoStruct("com.sun.star.awt.FontDescriptor") + xFDTitle.Height = 9 + xFDTitle.Weight = uno.getConstantByName("com.sun.star.awt.FontWeight.BOLD") + xFDTitle.Name = "Verdana" + + xFDSubTitle = uno.createUnoStruct("com.sun.star.awt.FontDescriptor") + xFDSubTitle.Height = 8 + xFDSubTitle.Weight = uno.getConstantByName("com.sun.star.awt.FontWeight.BOLD") + xFDSubTitle.Name = "Verdana" + + # widget + nX1 = 10 + nX2 = 20 + nX3 = 120 + + nY0 = 5 + nY1 = nY0 + 13 + nY2 = nY1 + 60 + nY3 = nY2 + 60 + nY4 = nY3 + 80 + + nXB = nX1 + 110 + + nHeight = 10 + + #### Add word + self._addWidget("add_section", 'FixedLine', nX1, nY0, 100, nHeight, Label = self.dUI.get("information_section", "#err"), FontDescriptor = xFDTitle) + + self._addWidget('save_label', 'FixedText', nX1, nY1, 100, nHeight, Label = self.dUI.get('save', "#err"), FontDescriptor = xFDTitle) + self._addWidget('save_desc_label', 'FixedText', nX1, nY1+10, 100, nHeight*5, Label = self.dUI.get('save_desc', "#err"), MultiLine=True) + + self._addWidget('duplicates_label', 'FixedText', nX1, nY2, 100, nHeight, Label = self.dUI.get('duplicates', "#err"), FontDescriptor = xFDTitle) + self._addWidget('duplicates_desc_label', 'FixedText', nX1, nY2+10, 100, nHeight*5, Label = self.dUI.get('duplicates_desc', "#err"), MultiLine=True) + + self._addWidget('compilation_label', 'FixedText', nX1, nY3, 100, nHeight, Label = self.dUI.get('compilation', "#err"), FontDescriptor = xFDTitle) + self._addWidget('compilation_desc_label', 'FixedText', nX1, nY3+10, 100, nHeight*7, Label = self.dUI.get('compilation_desc', "#err"), MultiLine=True) + + self._addWidget('warning_label', 'FixedText', nX1, nY4, 100, nHeight, Label = self.dUI.get('warning', "#err"), FontDescriptor = xFDTitle) + self._addWidget('warning_desc_label', 'FixedText', nX1, nY4+10, 100, nHeight*7, Label = self.dUI.get('warning_desc', "#err"), MultiLine=True) + + #### Tags + self._addWidget("tags_section", 'FixedLine', nXB, nY0, 230, nHeight, Label = self.dUI.get("tags_section", "#err"), FontDescriptor = xFDTitle) + self.xGridModel = self._addGrid("list_grid_tags", nXB, nY0+10, 230, 265, [ + {"Title": self.dUI.get("tags", "#err"), "ColumnWidth": 40}, + {"Title": self.dUI.get("meaning", "#err"), "ColumnWidth": 190} + ]) + + self._addWidget('close_button', 'Button', self.xDialog.Width-50, self.xDialog.Height-20, 40, 12, Label = self.dUI.get('close_button', "#err"), FontDescriptor = xFDSubTitle, TextColor = 0x550000) + + self.loadData() + + # container + self.xContainer = self.xSvMgr.createInstanceWithContext('com.sun.star.awt.UnoControlDialog', self.ctx) + self.xContainer.setModel(self.xDialog) + self.xGridControlInfo = self.xContainer.getControl('list_grid_tags') + self.xContainer.getControl('close_button').addActionListener(self) + self.xContainer.getControl('close_button').setActionCommand('Close') + self.xContainer.setVisible(False) + xToolkit = self.xSvMgr.createInstanceWithContext('com.sun.star.awt.ExtToolkit', self.ctx) + self.xContainer.createPeer(xToolkit, None) + self.xContainer.execute() + + # XActionListener + def actionPerformed (self, xActionEvent): + try: + if xActionEvent.ActionCommand == "Close": + self.xContainer.endExecute() + except: + traceback.print_exc() + + def loadData (self): + xGridDataModel = self.xGridModel.GridDataModel + for i, sKey in enumerate(lxg._dTAGS): + xGridDataModel.addRow(i, [sKey, lxg._dTAGS[sKey][1]]) Index: gc_lang/fr/oxt/DictOptions/lxe_strings.py ================================================================== --- gc_lang/fr/oxt/DictOptions/lxe_strings.py +++ gc_lang/fr/oxt/DictOptions/lxe_strings.py @@ -8,10 +8,12 @@ "title": "Grammalecte · Éditeur lexical", # Ajout "add_section": "Nouveau mot (lemme)", "lemma": "Lemme", + "search_button": "Recherche", + "information_button": "", # catégories "common_name": "Nom commun", "nom_adj": "Nom et adjectif", "nom": "Nom", ADDED gc_lang/fr/oxt/DictOptions/sw_strings.py Index: gc_lang/fr/oxt/DictOptions/sw_strings.py ================================================================== --- /dev/null +++ gc_lang/fr/oxt/DictOptions/sw_strings.py @@ -0,0 +1,33 @@ +def getUI (sLang): + if sLang in dStrings: + return dStrings[sLang] + return dStrings["fr"] + +dStrings = { + "fr": { + "title": "Grammalecte · Recherche et informations", + + "search_section": "Recherche", + + "similar_search_section": "Graphies similaires", + "similar_search_button": "Chercher", + + "regex_search_section": "Expression régulières", + "flexion": "Flexion", + "tags": "Étiquettes", + "regex_search_button": "Chercher", + + "result_section": "Résultats", + "res_flexion": "Flexions", + "res_lemma": "Lemmes", + "res_tags": "Étiquettes", + + "close_button": "Fermer", + }, + + "en": { + "title": "Grammalecte · Search and informations", + + "close_button": "Close", + }, +} ADDED gc_lang/fr/oxt/DictOptions/ti_strings.py Index: gc_lang/fr/oxt/DictOptions/ti_strings.py ================================================================== --- /dev/null +++ gc_lang/fr/oxt/DictOptions/ti_strings.py @@ -0,0 +1,37 @@ +def getUI (sLang): + if sLang in dStrings: + return dStrings[sLang] + return dStrings["fr"] + +dStrings = { + "fr": { + "title": "Grammalecte · Informations", + + "information_section": "Informations", + + "save": "Enregistrement", + "save_desc": "Les modifications apportées au lexique ne sont enregistrées dans le dictionnaire qu’au moment où vous cliquez sur ‹Enregistrer› dans l’onglet ‹Lexique›.", + + "duplicates": "Doublons", + "duplicates_desc": "Il est inutile de purger votre lexique des doublons éventuels. Les doublons sont automatiquement supprimés lors de la création du dictionnaire.", + + "compilation": "Compilation du dictionnaire", + "compilation_desc": "Le dictionnaire est compilé comme un graphe de mots sous la forme d’une chaîne binaire dans un fichier JSON. Cette opération peut prendre du temps et consommer beaucoup de mémoire si votre lexique contient plusieurs dizaines de milliers d’entrées.", + + "warning": "Avertissement", + "warning_desc": "Il est déconseillé d’utiliser la catégorie ‹Autre› pour générer autre chose que des noms, des adjectifs, des noms propres, des verbes et des adverbes. Il n’y a aucune garantie que les étiquettes pour les autres catégories, notamment les mots grammaticaux, ne changeront pas.", + + "tags_section": "Signification des étiquettes", + "tags": "Étiquettes", + "meaning": "Signification", + + + "close_button": "Fermer", + }, + + "en": { + "title": "Grammalecte · Informations", + + "close_button": "Close", + }, +}