Grammalecte  Check-in [130814503c]

Overview
Comment:[lo] code cleaning & clarification
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | lo
Files: files | file ages | folders
SHA3-256: 130814503c5e42686ad170ff94594d8dc237c424548aaaad83921e79dfc19782
User & Date: olr on 2020-12-17 20:31:35
Other Links: manifest | tags
Context
2020-12-18
09:59
[lo] text formatter editor update check-in: 7d2246bb86 user: olr tags: lo, trunk
2020-12-17
20:31
[lo] code cleaning & clarification check-in: 130814503c user: olr tags: lo, trunk
17:46
[lo] text formatter: editor update check-in: b2ccc36215 user: olr tags: lo, trunk
Changes

Modified gc_lang/fr/oxt/About/About.py from [eb41943f0c] to [ad3a7ac1f9].

     3      3   # License: MPL 2
     4      4   
     5      5   import unohelper
     6      6   import uno
     7      7   import traceback
     8      8   import sys
     9      9   
    10         -import ab_strings
           10  +import ab_strings as ui
    11     11   import helpers
    12     12   
    13     13   from com.sun.star.awt import XActionListener
    14     14   from com.sun.star.beans import PropertyValue
    15     15   
    16     16   
    17     17   class AboutGrammalecte (unohelper.Base, XActionListener):
................................................................................
    31     31           for k, w in kwargs.items():
    32     32               setattr(xWidget, k, w)
    33     33           self.xDialog.insertByName(name, xWidget)
    34     34           return xWidget
    35     35   
    36     36       def run (self, sLang):
    37     37           try:
    38         -            dUI = ab_strings.getUI(sLang)
           38  +            ui.selectLang(sLang)
           39  +
    39     40               self.xGLOptionNode = helpers.getConfigSetting("/org.openoffice.Lightproof_grammalecte/Other/", True)
    40     41   
    41     42               # dialog
    42     43               self.xDialog = self.xSvMgr.createInstanceWithContext('com.sun.star.awt.UnoControlDialogModel', self.ctx)
    43     44               self.xDialog.Width = 160
    44     45               self.xDialog.Height = 320
    45         -            self.xDialog.Title = dUI.get('windowtitle', "#err")
           46  +            self.xDialog.Title = ui.get('windowtitle')
    46     47               xWindowSize = helpers.getWindowSize()
    47     48               self.xDialog.PositionX = int((xWindowSize.Width / 2) - (self.xDialog.Width / 2))
    48     49               self.xDialog.PositionY = int((xWindowSize.Height / 2) - (self.xDialog.Height / 2))
    49     50   
    50     51               # xWidgets
    51     52               nLblWidth = 140
    52     53               nURLcolor = 0x4444FF
................................................................................
    68     69               # logo
    69     70               xDefaultContext = self.ctx.ServiceManager.DefaultContext
    70     71               xPackageInfoProvider = xDefaultContext.getValueByName("/singletons/com.sun.star.deployment.PackageInformationProvider")
    71     72               sExtPath = xPackageInfoProvider.getPackageLocation("French.linguistic.resources.from.Dicollecte.by.OlivierR")
    72     73               self._addWidget('imgMainLogo', 'ImageControl', 5, 5, 150, 80, ImageURL = sExtPath+"/img/logo120_text.png", Border = 0, ScaleMode = 1)
    73     74   
    74     75               # Infos
    75         -            self._addWidget('lblVersion', 'FixedText', 10, 90, nLblWidth, 10, Label = dUI.get('version', "#err"), Align = 1, FontDescriptor = xFD2)
    76         -            self._addWidget('lblLicence', 'FixedText', 10, 100, nLblWidth, 10, Label = dUI.get('license', "#err"), Align = 1, FontDescriptor = xFD2)
    77         -            self._addWidget('lblWebsite', 'FixedHyperlink', 10, 110, nLblWidth, 10, Label = dUI.get('website', "#err"), Align = 1, \
           76  +            self._addWidget('lblVersion', 'FixedText', 10, 90, nLblWidth, 10, Label = ui.get('version'), Align = 1, FontDescriptor = xFD2)
           77  +            self._addWidget('lblLicence', 'FixedText', 10, 100, nLblWidth, 10, Label = ui.get('license'), Align = 1, FontDescriptor = xFD2)
           78  +            self._addWidget('lblWebsite', 'FixedHyperlink', 10, 110, nLblWidth, 10, Label = ui.get('website'), Align = 1, \
    78     79                               URL="https://grammalecte.net/?from=grammalecte-lo", FontDescriptor = xFD1, TextColor = nURLcolor)
    79     80   
    80     81               # Python
    81     82               self._addWidget('lblpython', 'FixedText', 10, 125, nLblWidth//2, 10, Align = 1, TextColor = 0x666666, FontDescriptor = xFD2, \
    82         -                            Label = dUI.get('pythonver', "#err") + "{0[0]}.{0[1]}.{0[2]}".format(sys.version_info))
           83  +                            Label = ui.get('pythonver') + "{0[0]}.{0[1]}.{0[2]}".format(sys.version_info))
    83     84               self._addWidget('console_button', 'Button', nLblWidth-40, 124, 40, 10, \
    84         -                            Label = dUI.get('console', "#err"), FontDescriptor = xFD2, TextColor = 0x666666)
           85  +                            Label = ui.get('console'), FontDescriptor = xFD2, TextColor = 0x666666)
    85     86   
    86     87               # other
    87     88               self._addWidget('line', 'FixedLine', 10, 140, nLblWidth, 10)
    88     89   
    89     90               # sponsors
    90         -            self._addWidget('lblMsg', 'FixedText', 10, 155, nLblWidth, 10, Label = dUI.get('message', "#err"), FontDescriptor = xFD2, Align = 1)
    91         -            self._addWidget('lblURL1', 'FixedHyperlink', 10, 170, nLblWidth, 10, Label = dUI.get('sponsor', "#err"), \
           91  +            self._addWidget('lblMsg', 'FixedText', 10, 155, nLblWidth, 10, Label = ui.get('message'), FontDescriptor = xFD2, Align = 1)
           92  +            self._addWidget('lblURL1', 'FixedHyperlink', 10, 170, nLblWidth, 10, Label = ui.get('sponsor'), \
    92     93                               Align = 1, URL="http://lamouette.org/?from=grammalecte-lo", FontDescriptor = xFD3, TextColor = nURLcolor)
    93     94               self._addWidget('imgSponsor', 'ImageControl', 5, 180, 150, 50, ImageURL = sExtPath+"/img/LaMouette_small.png", Border = 0, ScaleMode = 1)
    94         -            self._addWidget('lblURL2', 'FixedHyperlink', 10, 235, nLblWidth, 10, Label = dUI.get('sponsor2', "#err"), \
           95  +            self._addWidget('lblURL2', 'FixedHyperlink', 10, 235, nLblWidth, 10, Label = ui.get('sponsor2'), \
    95     96                               Align = 1, URL="https://www.algoo.fr/?from=grammalecte-lo", FontDescriptor = xFD3, TextColor = nURLcolor)
    96     97               self._addWidget('imgSponsor2', 'ImageControl', 5, 245, 150, 50, ImageURL = sExtPath+"/img/Algoo_logo.png", Border = 0, ScaleMode = 1)
    97         -            self._addWidget('lblURL3', 'FixedHyperlink', 10, 300, nLblWidth, 10, Label = dUI.get('link', "#err"), \
           98  +            self._addWidget('lblURL3', 'FixedHyperlink', 10, 300, nLblWidth, 10, Label = ui.get('link'), \
    98     99                               Align = 1, URL="https://grammalecte.net/#thanks", FontDescriptor = xFD1, TextColor = nURLcolor)
    99    100   
   100    101               # container
   101    102               self.xContainer = self.xSvMgr.createInstanceWithContext('com.sun.star.awt.UnoControlDialog', self.ctx)
   102    103               self.xContainer.setModel(self.xDialog)
   103    104               self.xContainer.getControl('console_button').addActionListener(self)
   104    105               self.xContainer.getControl('console_button').setActionCommand('Console')

Modified gc_lang/fr/oxt/About/ab_strings.py from [c192c50bdb] to [599146a562].

     1         -# About strings
            1  +# strings for About
            2  +
            3  +
            4  +sUI = "fr"
            5  +
     2      6   
     3         -def getUI (sLang):
            7  +def selectLang (sLang):
            8  +    global sUI
     4      9       if sLang in dStrings:
     5         -        return dStrings[sLang]
     6         -    return dStrings["fr"]
           10  +        sUI = sLang
           11  +
           12  +
           13  +def get (sMsgCode):
           14  +    try:
           15  +        return dStrings[sUI].get(sMsgCode, sMsgCode)
           16  +    except:
           17  +        return "#error"
           18  +
     7     19   
     8     20   dStrings = {
     9     21       "fr": {
    10         -            "windowtitle": "À propos…",
    11         -            "title": "Grammalecte",
    12         -            "version": "Version : ${version}",
    13         -            "license": "Licence : GPL 3",
    14         -            "website": "Site web",
           22  +        "windowtitle": "À propos…",
           23  +        "title": "Grammalecte",
           24  +        "version": "Version : ${version}",
           25  +        "license": "Licence : GPL 3",
           26  +        "website": "Site web",
           27  +
           28  +        "pythonver": "Python v",
           29  +        "console": "Console",
    15     30   
    16         -            "pythonver": "Python v",
    17         -            "console": "Console",
           31  +        "message": "Avec le soutien de",
           32  +        "sponsor": "La Mouette…",
           33  +        "sponsor2": "Algoo…",
           34  +        "link": "… et de nombreux contributeurs.",
    18     35   
    19         -            "message": "Avec le soutien de",
    20         -            "sponsor": "La Mouette…",
    21         -            "sponsor2": "Algoo…",
    22         -            "link": "… et de nombreux contributeurs.",
    23         -
    24         -            "close": "~OK"
    25         -          },
           36  +        "close": "~OK"
           37  +    },
    26     38       "en": {
    27         -            "windowtitle": "About…",
    28         -            "title": "Grammalecte",
    29         -            "version": "Version: ${version}",
    30         -            "license": "License: GPL 3",
    31         -            "website": "Web site",
           39  +        "windowtitle": "About…",
           40  +        "title": "Grammalecte",
           41  +        "version": "Version: ${version}",
           42  +        "license": "License: GPL 3",
           43  +        "website": "Web site",
           44  +
           45  +        "pythonver": "Python v",
           46  +        "console": "Console",
    32     47   
    33         -            "pythonver": "Python v",
    34         -            "console": "Console",
           48  +        "message": "With the support of",
           49  +        "sponsor": "La Mouette…",
           50  +        "sponsor2": "Algoo…",
           51  +        "link": "… and many contributors.",
    35     52   
    36         -            "message": "With the support of",
    37         -            "sponsor": "La Mouette…",
    38         -            "sponsor2": "Algoo…",
    39         -            "link": "… and many contributors.",
    40         -
    41         -            "close": "~OK"
    42         -          }
           53  +        "close": "~OK"
           54  +    }
    43     55   }

Modified gc_lang/fr/oxt/ChangeAuthor/Author.py from [65d326e8e4] to [3df7981a3b].

     1         -# -*- coding: utf8 -*-
     2      1   # Modify author field
     3      2   # by Olivier R.
     4      3   # License: MPL 2
     5      4   
     6      5   import unohelper
     7      6   import uno
     8      7   import re
     9      8   import traceback
    10      9   
    11         -import ca_strings
           10  +import ca_strings as ui
    12     11   import helpers
    13     12   
    14     13   from com.sun.star.awt import XActionListener
    15     14   from com.sun.star.beans import PropertyValue
    16     15   
    17     16   
    18     17   class Author (unohelper.Base, XActionListener):
    19     18       def __init__ (self, ctx):
    20     19           self.ctx = ctx
    21     20           self.xSvMgr = self.ctx.ServiceManager
    22     21           self.xContainer = None
    23         -        
           22  +
    24     23       def _addWidget (self, name, wtype, x, y, w, h, **kwargs):
    25     24           xWidget = self.xDialog.createInstance('com.sun.star.awt.UnoControl%sModel' % wtype)
    26     25           xWidget.Name = name
    27     26           xWidget.PositionX = x
    28     27           xWidget.PositionY = y
    29     28           xWidget.Width = w
    30     29           xWidget.Height = h
................................................................................
    31     30           for k, w in kwargs.items():
    32     31               setattr(xWidget, k, w)
    33     32           self.xDialog.insertByName(name, xWidget)
    34     33           return xWidget
    35     34   
    36     35       def run (self, sLang):
    37     36           try:
    38         -            dUI = ca_strings.getUI(sLang)
           37  +            ui.selectLang(sLang)
    39     38   
    40     39               # dialog
    41     40               self.xDialog = self.xSvMgr.createInstanceWithContext('com.sun.star.awt.UnoControlDialogModel', self.ctx)
    42     41               self.xDialog.Width = 160
    43     42               self.xDialog.Height = 85
    44         -            self.xDialog.Title = dUI.get('title', "#err")
           43  +            self.xDialog.Title = ui.get('title')
    45     44               xWindowSize = helpers.getWindowSize()
    46     45               self.xDialog.PositionX = int((xWindowSize.Width / 2) - (self.xDialog.Width / 2))
    47     46               self.xDialog.PositionY = int((xWindowSize.Height / 2) - (self.xDialog.Height / 2))
    48     47   
    49     48               # fonts
    50     49               xFDBut = uno.createUnoStruct("com.sun.star.awt.FontDescriptor")
    51     50               xFDBut.Height = 10
    52     51               xFDBut.Weight = uno.getConstantByName("com.sun.star.awt.FontWeight.BOLD")
    53     52               xFDBut.Name = "Verdana"
    54     53   
    55     54               # document
    56     55               xDesktop = self.ctx.ServiceManager.createInstanceWithContext("com.sun.star.frame.Desktop", self.ctx)
    57     56               self.xDoc = xDesktop.getCurrentComponent()
    58         -            sAuthor = self.xDoc.DocumentProperties.Author  if self.xDoc.DocumentProperties.Author  else  dUI.get('empty', "#err")
           57  +            sAuthor = self.xDoc.DocumentProperties.Author  if self.xDoc.DocumentProperties.Author  else  ui.get('empty')
    59     58   
    60     59               # widgets
    61     60               nTextWidth = self.xDialog.Width - 20
    62         -            state = self._addWidget('state', 'FixedText', 10, 10, nTextWidth, 10, Label = dUI.get('state', "#err"))
           61  +            state = self._addWidget('state', 'FixedText', 10, 10, nTextWidth, 10, Label = ui.get('state'))
    63     62               value = self._addWidget('value', 'FixedText', 10, 20, nTextWidth, 10, Label = sAuthor, FontSlant = 2, TextColor = 0x000044)
    64         -            
    65         -            inputlbl = self._addWidget('inputlbl', 'FixedText', 10, 34, nTextWidth, 10, Label = dUI.get('newvalue', "#err"))
           63  +
           64  +            inputlbl = self._addWidget('inputlbl', 'FixedText', 10, 34, nTextWidth, 10, Label = ui.get('newvalue'))
    66     65               self.inputtxt = self._addWidget('input', 'Edit', 10, 45, nTextWidth-20, 12, Text=self.xDoc.DocumentProperties.Author, MaxTextLen=150)
    67         -            but0 = self._addWidget('reset', 'Button', self.xDialog.Width-25, 45, 15, 12, Label = u"×", FontDescriptor = xFDBut, TextColor = 0x440000)
           66  +            but0 = self._addWidget('reset', 'Button', self.xDialog.Width-25, 45, 15, 12, Label = "×", FontDescriptor = xFDBut, TextColor = 0x440000)
    68     67   
    69     68               but1 = self._addWidget('modify', 'Button', self.xDialog.Width-115, self.xDialog.Height-20, 50, 14, \
    70         -                                   Label = dUI.get('modify', "#err"), FontDescriptor = xFDBut, TextColor = 0x004400)
           69  +                                   Label = ui.get('modify'), FontDescriptor = xFDBut, TextColor = 0x004400)
    71     70               but2 = self._addWidget('cancel', 'Button', self.xDialog.Width-60, self.xDialog.Height-20, 50, 14, \
    72         -                                   Label = dUI.get('cancel', "#err"), FontDescriptor = xFDBut, TextColor = 0x440000)
           71  +                                   Label = ui.get('cancel'), FontDescriptor = xFDBut, TextColor = 0x440000)
    73     72   
    74     73               # container
    75     74               self.xContainer = self.xSvMgr.createInstanceWithContext('com.sun.star.awt.UnoControlDialog', self.ctx)
    76     75               self.xContainer.setModel(self.xDialog)
    77     76               self.xContainer.getControl('reset').addActionListener(self)
    78     77               self.xContainer.getControl('reset').setActionCommand('Reset')
    79     78               self.xContainer.getControl('modify').addActionListener(self)
................................................................................
    82     81               self.xContainer.getControl('cancel').setActionCommand('Cancel')
    83     82               self.xContainer.setVisible(False)
    84     83               xToolkit = self.xSvMgr.createInstanceWithContext('com.sun.star.awt.ExtToolkit', self.ctx)
    85     84               self.xContainer.createPeer(xToolkit, None)
    86     85               self.xContainer.execute()
    87     86           except:
    88     87               traceback.print_exc()
    89         -    
           88  +
    90     89       # XActionListener
    91     90       def actionPerformed (self, xActionEvent):
    92     91           try:
    93     92               if xActionEvent.ActionCommand == 'Reset':
    94     93                   self.inputtxt.Text = ""
    95     94               elif xActionEvent.ActionCommand == 'Modify':
    96     95                   self.xDoc.DocumentProperties.Author = self.inputtxt.Text.strip()

Modified gc_lang/fr/oxt/ChangeAuthor/ca_strings.py from [b67a9eb4f9] to [249ebc6d98].

     1         -# -*- encoding: UTF-8 -*-
            1  +# strings for change author
     2      2   
     3         -def getUI (sLang):
            3  +
            4  +sUI = "fr"
            5  +
            6  +
            7  +def selectLang (sLang):
            8  +    global sUI
     4      9       if sLang in dStrings:
     5         -        return dStrings[sLang]
     6         -    return dStrings["fr"]
           10  +        sUI = sLang
           11  +
           12  +
           13  +def get (sMsgCode):
           14  +    try:
           15  +        return dStrings[sUI].get(sMsgCode, sMsgCode)
           16  +    except:
           17  +        return "#error"
           18  +
     7     19   
     8     20   dStrings = {
     9     21       "fr": {
    10         -            "title": "Grammalecte · Édition du champ “Auteur”",
           22  +        "title": "Grammalecte · Édition du champ “Auteur”",
    11     23   
    12         -            "state": "Valeur actuelle du champ “Auteur” :",
    13         -            "empty": "[vide]",
           24  +        "state": "Valeur actuelle du champ “Auteur” :",
           25  +        "empty": "[vide]",
    14     26   
    15         -            "newvalue": "Entrez la nouvelle valeur :",
           27  +        "newvalue": "Entrez la nouvelle valeur :",
    16     28   
    17         -            "modify": "Modifier",
    18         -            "cancel": "Annuler"
    19         -          },
           29  +        "modify": "Modifier",
           30  +        "cancel": "Annuler"
           31  +    },
    20     32       "en": {
    21         -            "title": "Grammalecte · Edition of field “Author”",
           33  +        "title": "Grammalecte · Edition of field “Author”",
    22     34   
    23         -            "state": "Current value of field “Author”:",
    24         -            "empty": "[empty]",
           35  +        "state": "Current value of field “Author”:",
           36  +        "empty": "[empty]",
    25     37   
    26         -            "newvalue": "Enter the new value:",
           38  +        "newvalue": "Enter the new value:",
    27     39   
    28         -            "modify": "Modify",
    29         -            "cancel": "Cancel"
    30         -          }
           40  +        "modify": "Modify",
           41  +        "cancel": "Cancel"
           42  +    }
    31     43   }
    32     44   
    33     45   

Modified gc_lang/fr/oxt/DictOptions/DictOptions.py from [427b5db60b] to [134ec117ea].

     4      4   
     5      5   import unohelper
     6      6   import uno
     7      7   import re
     8      8   import traceback
     9      9   
    10     10   import helpers
    11         -import do_strings
           11  +import do_strings as ui
    12     12   
    13     13   from com.sun.star.task import XJobExecutor
    14     14   from com.sun.star.awt import XActionListener
    15     15   from com.sun.star.beans import PropertyValue
    16     16   
    17     17   from com.sun.star.awt.MessageBoxButtons import BUTTONS_OK
    18     18   # BUTTONS_OK, BUTTONS_OK_CANCEL, BUTTONS_YES_NO, BUTTONS_YES_NO_CANCEL, BUTTONS_RETRY_CANCEL, BUTTONS_ABORT_IGNORE_RETRY
................................................................................
    44     44           xWidget.Height = h
    45     45           for k, w in kwargs.items():
    46     46               setattr(xWidget, k, w)
    47     47           self.xDialog.insertByName(name, xWidget)
    48     48           return xWidget
    49     49   
    50     50       def run (self, sLang):
    51         -        self.dUI = do_strings.getUI(sLang)
           51  +        ui.selectLang(sLang)
    52     52   
    53     53           self.xDesktop = self.xSvMgr.createInstanceWithContext("com.sun.star.frame.Desktop", self.ctx)
    54     54           self.xDocument = self.xDesktop.getCurrentComponent()
    55     55           self.xGLOptionNode = helpers.getConfigSetting("/org.openoffice.Lightproof_grammalecte/Other/", True)
    56     56   
    57     57           # what is the current Hunspell dictionary
    58     58           self.xHunspellNode = helpers.getConfigSetting("/org.openoffice.Office.Linguistic/ServiceManager/Dictionaries/HunSpellDic_fr", True)
................................................................................
    60     60           m = re.search(r"fr-(\w*)\.(?:dic|aff)", xLocations[0])
    61     61           self.sHunspellCurrentDic = m.group(1)  if m  else ""
    62     62   
    63     63           # dialog
    64     64           self.xDialog = self.xSvMgr.createInstanceWithContext('com.sun.star.awt.UnoControlDialogModel', self.ctx)
    65     65           self.xDialog.Width = 200
    66     66           self.xDialog.Height = 285
    67         -        self.xDialog.Title = self.dUI.get('title', "#title#")
           67  +        self.xDialog.Title = ui.get('title')
    68     68           xWindowSize = helpers.getWindowSize()
    69     69           self.xDialog.PositionX = int((xWindowSize.Width / 2) - (self.xDialog.Width / 2))
    70     70           self.xDialog.PositionY = int((xWindowSize.Height / 2) - (self.xDialog.Height / 2))
    71     71   
    72     72           # fonts
    73     73           xFDTitle = uno.createUnoStruct("com.sun.star.awt.FontDescriptor")
    74     74           xFDTitle.Height = 9
................................................................................
    88     88           nY4 = nY3 + 45
    89     89           nY5 = nY4 + 95
    90     90   
    91     91           nWidth = self.xDialog.Width - 20
    92     92           nHeight = 10
    93     93   
    94     94           # Graphspell dictionary section
    95         -        self._addWidget("graphspell_section", 'FixedLine', nX, nY1, nWidth, nHeight, Label = self.dUI.get("graphspell_section", "#err"), FontDescriptor = xFDTitle)
    96         -        self.xMainDic = self._addWidget('activate_main', 'CheckBox', nX, nY1+15, nWidth, nHeight, Label = self.dUI.get('activate_main', "#err"), FontDescriptor = xFDSubTitle, TextColor = 0x000088, State = True)
    97         -        self._addWidget('activate_main_descr', 'FixedText', nX+10, nY1+25, nWidth-10, nHeight*2, Label = self.dUI.get('activate_main_descr', "#err"), MultiLine = True)
    98         -        self._addWidget('spelling', 'FixedText', nX+10, nY1+45, nWidth-80, nHeight, Label = self.dUI.get('spelling', "#err"), FontDescriptor = xFDSubTitle)
           95  +        self._addWidget("graphspell_section", 'FixedLine', nX, nY1, nWidth, nHeight, Label = ui.get("graphspell_section"), FontDescriptor = xFDTitle)
           96  +        self.xMainDic = self._addWidget('activate_main', 'CheckBox', nX, nY1+15, nWidth, nHeight, Label = ui.get('activate_main'), FontDescriptor = xFDSubTitle, TextColor = 0x000088, State = True)
           97  +        self._addWidget('activate_main_descr', 'FixedText', nX+10, nY1+25, nWidth-10, nHeight*2, Label = ui.get('activate_main_descr'), MultiLine = True)
           98  +        self._addWidget('spelling', 'FixedText', nX+10, nY1+45, nWidth-80, nHeight, Label = ui.get('spelling'), FontDescriptor = xFDSubTitle)
    99     99           self.xInfoDicButton = self._addWidget('info_dic_button', 'Button', nX+160, nY1+45, 12, 9, Label = "‹i›")
   100         -        self.xSelClassic = self._addWidget('classic', 'RadioButton', nX+10, nY1+55, 50, nHeight, Label = self.dUI.get('classic', "#err"))
   101         -        self.xSelReform = self._addWidget('reform', 'RadioButton', nX+65, nY1+55, 55, nHeight, Label = self.dUI.get('reform', "#err"))
   102         -        self.xSelAllvars = self._addWidget('allvars', 'RadioButton', nX+120, nY1+55, 60, nHeight, Label = self.dUI.get('allvars', "#err"))
   103         -        self.xCommunityDic = self._addWidget('activate_community', 'CheckBox', nX, nY2+15, nWidth, nHeight, Label = self.dUI.get('activate_community', "#err"), FontDescriptor = xFDSubTitle, TextColor = 0x000088, Enabled = False)
   104         -        self._addWidget('activate_community_descr', 'FixedText', nX+10, nY2+25, nWidth-10, nHeight*1, Label = self.dUI.get('activate_community_descr', "#err"), MultiLine = True)
   105         -        self.xPersonalDic = self._addWidget('activate_personal', 'CheckBox', nX, nY3+15, nWidth, nHeight, Label = self.dUI.get('activate_personal', "#err"), FontDescriptor = xFDSubTitle, TextColor = 0x000088)
   106         -        self._addWidget('activate_personal_descr', 'FixedText', nX+10, nY3+25, nWidth-10, nHeight*1, Label = self.dUI.get('activate_personal_descr', "#err"), MultiLine = True)
          100  +        self.xSelClassic = self._addWidget('classic', 'RadioButton', nX+10, nY1+55, 50, nHeight, Label = ui.get('classic'))
          101  +        self.xSelReform = self._addWidget('reform', 'RadioButton', nX+65, nY1+55, 55, nHeight, Label = ui.get('reform'))
          102  +        self.xSelAllvars = self._addWidget('allvars', 'RadioButton', nX+120, nY1+55, 60, nHeight, Label = ui.get('allvars'))
          103  +        self.xCommunityDic = self._addWidget('activate_community', 'CheckBox', nX, nY2+15, nWidth, nHeight, Label = ui.get('activate_community'), FontDescriptor = xFDSubTitle, TextColor = 0x000088, Enabled = False)
          104  +        self._addWidget('activate_community_descr', 'FixedText', nX+10, nY2+25, nWidth-10, nHeight*1, Label = ui.get('activate_community_descr'), MultiLine = True)
          105  +        self.xPersonalDic = self._addWidget('activate_personal', 'CheckBox', nX, nY3+15, nWidth, nHeight, Label = ui.get('activate_personal'), FontDescriptor = xFDSubTitle, TextColor = 0x000088)
          106  +        self._addWidget('activate_personal_descr', 'FixedText', nX+10, nY3+25, nWidth-10, nHeight*1, Label = ui.get('activate_personal_descr'), MultiLine = True)
   107    107   
   108    108           # Spell suggestion engine section
   109         -        self._addWidget("suggestion_section", 'FixedLine', nX, nY4, nWidth, nHeight, Label = self.dUI.get("suggestion_section", "#err"), FontDescriptor = xFDTitle)
   110         -        self.xGraphspellSugg = self._addWidget('activate_spell_sugg', 'CheckBox', nX, nY4+15, nWidth, nHeight, Label = self.dUI.get('activate_spell_sugg', "#err"))
   111         -        self._addWidget('activate_spell_sugg_descr', 'FixedText', nX, nY4+25, nWidth, nHeight*6, Label = self.dUI.get('activate_spell_sugg_descr', "#err"), MultiLine = True)
          109  +        self._addWidget("suggestion_section", 'FixedLine', nX, nY4, nWidth, nHeight, Label = ui.get("suggestion_section"), FontDescriptor = xFDTitle)
          110  +        self.xGraphspellSugg = self._addWidget('activate_spell_sugg', 'CheckBox', nX, nY4+15, nWidth, nHeight, Label = ui.get('activate_spell_sugg'))
          111  +        self._addWidget('activate_spell_sugg_descr', 'FixedText', nX, nY4+25, nWidth, nHeight*6, Label = ui.get('activate_spell_sugg_descr'), MultiLine = True)
   112    112   
   113    113           # Restart message
   114         -        self._addWidget('restart', 'FixedText', nX, nY5, nWidth, nHeight*2, Label = self.dUI.get('restart', "#err"), FontDescriptor = xFDTitle, MultiLine = True, TextColor = 0x880000)
          114  +        self._addWidget('restart', 'FixedText', nX, nY5, nWidth, nHeight*2, Label = ui.get('restart'), FontDescriptor = xFDTitle, MultiLine = True, TextColor = 0x880000)
   115    115   
   116    116           # Button
   117         -        self._addWidget('apply_button', 'Button', self.xDialog.Width-115, self.xDialog.Height-20, 50, 14, Label = self.dUI.get('apply_button', "#err"), FontDescriptor = xFDTitle, TextColor = 0x005500)
   118         -        self._addWidget('cancel_button', 'Button', self.xDialog.Width-60, self.xDialog.Height-20, 50, 14, Label = self.dUI.get('cancel_button', "#err"), FontDescriptor = xFDTitle, TextColor = 0x550000)
          117  +        self._addWidget('apply_button', 'Button', self.xDialog.Width-115, self.xDialog.Height-20, 50, 14, Label = ui.get('apply_button'), FontDescriptor = xFDTitle, TextColor = 0x005500)
          118  +        self._addWidget('cancel_button', 'Button', self.xDialog.Width-60, self.xDialog.Height-20, 50, 14, Label = ui.get('cancel_button'), FontDescriptor = xFDTitle, TextColor = 0x550000)
   119    119   
   120    120           self._loadOptions()
   121    121   
   122    122           # container
   123    123           self.xContainer = self.xSvMgr.createInstanceWithContext('com.sun.star.awt.UnoControlDialog', self.ctx)
   124    124           self.xContainer.setModel(self.xDialog)
   125    125           self.xContainer.getControl('info_dic_button').addActionListener(self)
................................................................................
   164    164                   #self.xHunspellNode.replaceByName("Locations", xLocations)  # doesn't work, see line below
   165    165                   uno.invoke(self.xHunspellNode, "replaceByName", ("Locations", uno.Any("[]string", (v1, v2))))
   166    166                   self.xHunspellNode.commitChanges()
   167    167   
   168    168                   # Close window
   169    169                   self.xContainer.endExecute()
   170    170               elif xActionEvent.ActionCommand == 'InfoDic':
   171         -                MessageBox(self.xDocument, self.dUI.get('spelling_descr', "#err"), "Orthographe du français", nBoxType=INFOBOX, nBoxButtons=BUTTONS_OK)
          171  +                MessageBox(self.xDocument, ui.get('spelling_descr'), "Orthographe du français", nBoxType=INFOBOX, nBoxButtons=BUTTONS_OK)
   172    172               else:
   173    173                   self.xContainer.endExecute()
   174    174           except:
   175    175               traceback.print_exc()
   176    176   
   177    177       # XJobExecutor
   178    178       def trigger (self, args):

Modified gc_lang/fr/oxt/DictOptions/LexiconEditor.py from [5ef5214006] to [28c9952b1e].

     7      7   import json
     8      8   import re
     9      9   import os
    10     10   import traceback
    11     11   import platform
    12     12   
    13     13   import helpers
    14         -import lxe_strings
           14  +import lxe_strings as ui
    15     15   import grammalecte.graphspell as sc
    16     16   import grammalecte.graphspell.dawg as dawg
    17     17   import grammalecte.graphspell.ibdawg as ibdawg
    18     18   import grammalecte.fr.conj as conj
    19     19   import grammalecte.fr.conj_generator as conjgen
    20     20   
    21     21   import SearchWords
................................................................................
   109    109           for k, w in kwargs.items():
   110    110               setattr(xGridModel, k, w)
   111    111           self.xDialog.insertByName(name, xGridModel)
   112    112           return xGridModel
   113    113   
   114    114       def run (self, sLang, sWord=""):
   115    115           # ui lang
          116  +        ui.selectLang(sLang)
   116    117           self.sLang = sLang
   117         -        self.dUI = lxe_strings.getUI(sLang)
   118    118   
   119    119           # dialog
   120    120           self.xDialog = self.xSvMgr.createInstanceWithContext('com.sun.star.awt.UnoControlDialogModel', self.ctx)
   121    121           self.xDialog.Width = 550
   122    122           self.xDialog.Height = 290
   123         -        self.xDialog.Title = self.dUI.get('title', "#title#")
          123  +        self.xDialog.Title = ui.get('title')
   124    124           xWindowSize = helpers.getWindowSize()
   125    125           self.xDialog.PositionX = int((xWindowSize.Width / 2) - (self.xDialog.Width / 2))
   126    126           self.xDialog.PositionY = int((xWindowSize.Height / 2) - (self.xDialog.Height / 2))
   127    127   
   128    128           # fonts
   129    129           xFDTitle = uno.createUnoStruct("com.sun.star.awt.FontDescriptor")
   130    130           xFDTitle.Height = 9
................................................................................
   150    150   
   151    151           nXB = nX1 + 175
   152    152           nXC = nXB + 165
   153    153   
   154    154           nHeight = 10
   155    155   
   156    156           #### Dictionary section
   157         -        self._addWidget("dictionary_section", 'FixedLine', nX1, nY0, 170, nHeight, Label = self.dUI.get("dictionary_section", "#err"), FontDescriptor = xFDTitle, TextColor = 0x000088)
   158         -        self._addWidget("save_date_label", 'FixedText', nXB, nY0+2, 80, nHeight, Label = self.dUI.get("save_date_label", "#err"), FontDescriptor = xFDSubTitle, TextColor = 0x000088)
   159         -        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)
   160         -        self.xDateDic = self._addWidget("save_date", 'FixedText', nXB+85, nY0+2, 75, nHeight, Label = self.dUI.get("void", "#err"), FontDescriptor = xFDSubTitle, TextColor = 0x000088)
          157  +        self._addWidget("dictionary_section", 'FixedLine', nX1, nY0, 170, nHeight, Label = ui.get("dictionary_section"), FontDescriptor = xFDTitle, TextColor = 0x000088)
          158  +        self._addWidget("save_date_label", 'FixedText', nXB, nY0+2, 80, nHeight, Label = ui.get("save_date_label"), FontDescriptor = xFDSubTitle, TextColor = 0x000088)
          159  +        self._addWidget("num_of_entries_label2", 'FixedText', nXC, nY0+2, 65, nHeight, Label = ui.get("num_of_entries_label"), FontDescriptor = xFDSubTitle, TextColor = 0x000088)
          160  +        self.xDateDic = self._addWidget("save_date", 'FixedText', nXB+85, nY0+2, 75, nHeight, Label = ui.get("void"), FontDescriptor = xFDSubTitle, TextColor = 0x000088)
   161    161           self.xNumDic = self._addWidget("num_of_entries2", 'FixedText', nXC+70, nY0+2, 45, nHeight, Label = "0", FontDescriptor = xFDSubTitle, TextColor = 0x000088)
   162         -        self.xImport = self._addWidget('import_button', 'Button', self.xDialog.Width-90, nY0, 40, 12, Label = self.dUI.get('import_button', "#err"), FontDescriptor = xFDSubTitle, TextColor = 0x000055)
   163         -        self.xExport = self._addWidget('export_button', 'Button', self.xDialog.Width-45, nY0, 40, 12, Label = self.dUI.get('export_button', "#err"), FontDescriptor = xFDSubTitle, TextColor = 0x000055)
          162  +        self.xImport = self._addWidget('import_button', 'Button', self.xDialog.Width-90, nY0, 40, 12, Label = ui.get('import_button'), FontDescriptor = xFDSubTitle, TextColor = 0x000055)
          163  +        self.xExport = self._addWidget('export_button', 'Button', self.xDialog.Width-45, nY0, 40, 12, Label = ui.get('export_button'), FontDescriptor = xFDSubTitle, TextColor = 0x000055)
   164    164   
   165    165           #### Add word
   166         -        self._addWidget("add_section", 'FixedLine', nX1, nY1, 170, nHeight, Label = self.dUI.get("add_section", "#err"), FontDescriptor = xFDTitle)
          166  +        self._addWidget("add_section", 'FixedLine', nX1, nY1, 170, nHeight, Label = ui.get("add_section"), FontDescriptor = xFDTitle)
   167    167           self.xLemma = self._addWidget('lemma', 'Edit', nX1, nY1+10, 100, 14, Text = sWord, FontDescriptor = xFDTitle)
   168         -        self._addWidget('search_button', 'Button', nX1+105, nY1+11, 45, 12, Label = self.dUI.get('search_button', "#err"), FontDescriptor = xFDSubTitle, TextColor = 0x555500)
   169         -        self._addWidget('information_button', 'Button', nX1+155, nY1+11, 15, 12, Label = self.dUI.get('information_button', "#err"), FontDescriptor = xFDSubTitle, TextColor = 0x555500)
          168  +        self._addWidget('search_button', 'Button', nX1+105, nY1+11, 45, 12, Label = ui.get('search_button'), FontDescriptor = xFDSubTitle, TextColor = 0x555500)
          169  +        self._addWidget('information_button', 'Button', nX1+155, nY1+11, 15, 12, Label = ui.get('information_button'), FontDescriptor = xFDSubTitle, TextColor = 0x555500)
   170    170   
   171    171           # Radio buttons: main POS tag
   172    172           # Note: the only way to group RadioButtons is to create them successively
   173         -        self.xNA = self._addWidget('nom_adj', 'RadioButton', nX1, nY2+12, 60, nHeight, Label = self.dUI.get("nom_adj", "#err"), HelpText = ":N:A")
   174         -        self.xN = self._addWidget('nom', 'RadioButton', nX1, nY2+22, 60, nHeight, Label = self.dUI.get("nom", "#err"), HelpText = ":N")
   175         -        self.xA = self._addWidget('adj', 'RadioButton', nX1, nY2+32, 60, nHeight, Label = self.dUI.get("adj", "#err"), HelpText = ":A")
   176         -        self.xM1 = self._addWidget('M1', 'RadioButton', nX1, nY3+12, 60, nHeight, Label = self.dUI.get("M1", "#err"), HelpText = ":M1")
   177         -        self.xM2 = self._addWidget('M2', 'RadioButton', nX1, nY3+22, 60, nHeight, Label = self.dUI.get("M2", "#err"), HelpText = ":M2")
   178         -        self.xMP = self._addWidget('MP', 'RadioButton', nX1, nY3+32, 60, nHeight, Label = self.dUI.get("MP", "#err"), HelpText = ":MP")
   179         -        self.xV = self._addWidget('verb', 'RadioButton', nX1, nY4+2, 35, nHeight, Label = self.dUI.get("verb", "#err"), FontDescriptor = xFDSubTitle, HelpText = ":V")
   180         -        self.xW = self._addWidget('adv', 'RadioButton', nX1, nY5+2, 35, nHeight, Label = self.dUI.get("adverb", "#err"), FontDescriptor = xFDSubTitle, HelpText = ":W")
   181         -        self.xX = self._addWidget('other', 'RadioButton', nX1, nY6+2, 35, nHeight, Label = self.dUI.get("other", "#err"), FontDescriptor = xFDSubTitle, HelpText = ":X")
          173  +        self.xNA = self._addWidget('nom_adj', 'RadioButton', nX1, nY2+12, 60, nHeight, Label = ui.get("nom_adj"), HelpText = ":N:A")
          174  +        self.xN = self._addWidget('nom', 'RadioButton', nX1, nY2+22, 60, nHeight, Label = ui.get("nom"), HelpText = ":N")
          175  +        self.xA = self._addWidget('adj', 'RadioButton', nX1, nY2+32, 60, nHeight, Label = ui.get("adj"), HelpText = ":A")
          176  +        self.xM1 = self._addWidget('M1', 'RadioButton', nX1, nY3+12, 60, nHeight, Label = ui.get("M1"), HelpText = ":M1")
          177  +        self.xM2 = self._addWidget('M2', 'RadioButton', nX1, nY3+22, 60, nHeight, Label = ui.get("M2"), HelpText = ":M2")
          178  +        self.xMP = self._addWidget('MP', 'RadioButton', nX1, nY3+32, 60, nHeight, Label = ui.get("MP"), HelpText = ":MP")
          179  +        self.xV = self._addWidget('verb', 'RadioButton', nX1, nY4+2, 35, nHeight, Label = ui.get("verb"), FontDescriptor = xFDSubTitle, HelpText = ":V")
          180  +        self.xW = self._addWidget('adv', 'RadioButton', nX1, nY5+2, 35, nHeight, Label = ui.get("adverb"), FontDescriptor = xFDSubTitle, HelpText = ":W")
          181  +        self.xX = self._addWidget('other', 'RadioButton', nX1, nY6+2, 35, nHeight, Label = ui.get("other"), FontDescriptor = xFDSubTitle, HelpText = ":X")
   182    182   
   183    183           # Nom, adjectif
   184         -        self._addWidget("fl_nom_adj", 'FixedLine', nX1, nY2, 170, nHeight, Label = self.dUI.get("common_name", "#err"), FontDescriptor = xFDSubTitle)
   185         -        self.xSepi = self._addWidget('Sepi', 'RadioButton', nX1+65, nY2+12, 50, nHeight, Label = self.dUI.get("epi", "#err"), HelpText = ":e")
   186         -        self.xSmas = self._addWidget('Smas', 'RadioButton', nX1+65, nY2+22, 50, nHeight, Label = self.dUI.get("mas", "#err"), HelpText = ":m")
   187         -        self.xSfem = self._addWidget('Sfem', 'RadioButton', nX1+65, nY2+32, 50, nHeight, Label = self.dUI.get("fem", "#err"), HelpText = ":f")
          184  +        self._addWidget("fl_nom_adj", 'FixedLine', nX1, nY2, 170, nHeight, Label = ui.get("common_name"), FontDescriptor = xFDSubTitle)
          185  +        self.xSepi = self._addWidget('Sepi', 'RadioButton', nX1+65, nY2+12, 50, nHeight, Label = ui.get("epi"), HelpText = ":e")
          186  +        self.xSmas = self._addWidget('Smas', 'RadioButton', nX1+65, nY2+22, 50, nHeight, Label = ui.get("mas"), HelpText = ":m")
          187  +        self.xSfem = self._addWidget('Sfem', 'RadioButton', nX1+65, nY2+32, 50, nHeight, Label = ui.get("fem"), HelpText = ":f")
   188    188           self._addWidget("fl_sep1", 'FixedLine', nX1, nY2, 1, nHeight)
   189         -        self.xSs = self._addWidget('Ss', 'RadioButton', nX1+115, nY2+12, 50, nHeight, Label = self.dUI.get("-s", "#err"), HelpText = "·s")
   190         -        self.xSx = self._addWidget('Sx', 'RadioButton', nX1+115, nY2+22, 50, nHeight, Label = self.dUI.get("-x", "#err"), HelpText = "·x")
   191         -        self.xSinv = self._addWidget('Sinv', 'RadioButton', nX1+115, nY2+32, 50, nHeight, Label = self.dUI.get("inv", "#err"), HelpText = ":i")
          189  +        self.xSs = self._addWidget('Ss', 'RadioButton', nX1+115, nY2+12, 50, nHeight, Label = ui.get("-s"), HelpText = "·s")
          190  +        self.xSx = self._addWidget('Sx', 'RadioButton', nX1+115, nY2+22, 50, nHeight, Label = ui.get("-x"), HelpText = "·x")
          191  +        self.xSinv = self._addWidget('Sinv', 'RadioButton', nX1+115, nY2+32, 50, nHeight, Label = ui.get("inv"), HelpText = ":i")
   192    192   
   193         -        self._addWidget("alt_lemma_label", 'FixedLine', nX1+10, nY2+42, 160, nHeight, Label = self.dUI.get("alt_lemma", "#err"))
          193  +        self._addWidget("alt_lemma_label", 'FixedLine', nX1+10, nY2+42, 160, nHeight, Label = ui.get("alt_lemma"))
   194    194           self.xAltLemma = self._addWidget('alt_lemma', 'Edit', nX1+10, nY2+52, 110, nHeight)
   195         -        self.xNA2 = self._addWidget('nom_adj2', 'RadioButton', nX1+10, nY2+65, 60, nHeight, Label = self.dUI.get("nom_adj", "#err"), HelpText = ":N:A")
   196         -        self.xN2 = self._addWidget('nom2', 'RadioButton', nX1+10, nY2+75, 60, nHeight, Label = self.dUI.get("nom", "#err"), HelpText = ":N")
   197         -        self.xA2 = self._addWidget('adj2', 'RadioButton', nX1+10, nY2+85, 60, nHeight, Label = self.dUI.get("adj", "#err"), HelpText = ":A")
          195  +        self.xNA2 = self._addWidget('nom_adj2', 'RadioButton', nX1+10, nY2+65, 60, nHeight, Label = ui.get("nom_adj"), HelpText = ":N:A")
          196  +        self.xN2 = self._addWidget('nom2', 'RadioButton', nX1+10, nY2+75, 60, nHeight, Label = ui.get("nom"), HelpText = ":N")
          197  +        self.xA2 = self._addWidget('adj2', 'RadioButton', nX1+10, nY2+85, 60, nHeight, Label = ui.get("adj"), HelpText = ":A")
   198    198           self._addWidget("fl_sep2", 'FixedLine', nX1, nY2, 1, nHeight)
   199         -        self.xSepi2 = self._addWidget('Sepi2', 'RadioButton', nX1+70, nY2+65, 50, nHeight, Label = self.dUI.get("epi", "#err"), HelpText = ":e")
   200         -        self.xSmas2 = self._addWidget('Smas2', 'RadioButton', nX1+70, nY2+75, 50, nHeight, Label = self.dUI.get("mas", "#err"), HelpText = ":m")
   201         -        self.xSfem2 = self._addWidget('Sfem2', 'RadioButton', nX1+70, nY2+85, 50, nHeight, Label = self.dUI.get("fem", "#err"), HelpText = ":f")
          199  +        self.xSepi2 = self._addWidget('Sepi2', 'RadioButton', nX1+70, nY2+65, 50, nHeight, Label = ui.get("epi"), HelpText = ":e")
          200  +        self.xSmas2 = self._addWidget('Smas2', 'RadioButton', nX1+70, nY2+75, 50, nHeight, Label = ui.get("mas"), HelpText = ":m")
          201  +        self.xSfem2 = self._addWidget('Sfem2', 'RadioButton', nX1+70, nY2+85, 50, nHeight, Label = ui.get("fem"), HelpText = ":f")
   202    202           self._addWidget("fl_sep3", 'FixedLine', nX1, nY2, 1, nHeight)
   203         -        self.xSs2 = self._addWidget('Ss2', 'RadioButton', nX1+120, nY2+65, 50, nHeight, Label = self.dUI.get("-s", "#err"), HelpText = "·s")
   204         -        self.xSx2 = self._addWidget('Sx2', 'RadioButton', nX1+120, nY2+75, 50, nHeight, Label = self.dUI.get("-x", "#err"), HelpText = "·x")
   205         -        self.xSinv2 = self._addWidget('Sinv2', 'RadioButton', nX1+120, nY2+85, 50, nHeight, Label = self.dUI.get("inv", "#err"), HelpText = ":i")
          203  +        self.xSs2 = self._addWidget('Ss2', 'RadioButton', nX1+120, nY2+65, 50, nHeight, Label = ui.get("-s"), HelpText = "·s")
          204  +        self.xSx2 = self._addWidget('Sx2', 'RadioButton', nX1+120, nY2+75, 50, nHeight, Label = ui.get("-x"), HelpText = "·x")
          205  +        self.xSinv2 = self._addWidget('Sinv2', 'RadioButton', nX1+120, nY2+85, 50, nHeight, Label = ui.get("inv"), HelpText = ":i")
   206    206   
   207    207           # Nom propre
   208         -        self._addWidget("fl_M", 'FixedLine', nX1, nY3, 170, nHeight, Label = self.dUI.get("proper_name", "#err"), FontDescriptor = xFDSubTitle)
   209         -        self.xMepi = self._addWidget('Mepi', 'RadioButton', nX1+65, nY3+12, 50, nHeight, Label = self.dUI.get("epi", "#err"), HelpText = ":e")
   210         -        self.xMmas = self._addWidget('Mmas', 'RadioButton', nX1+65, nY3+22, 50, nHeight, Label = self.dUI.get("mas", "#err"), HelpText = ":m")
   211         -        self.xMfem = self._addWidget('Mfem', 'RadioButton', nX1+65, nY3+32, 50, nHeight, Label = self.dUI.get("fem", "#err"), HelpText = ":f")
          208  +        self._addWidget("fl_M", 'FixedLine', nX1, nY3, 170, nHeight, Label = ui.get("proper_name"), FontDescriptor = xFDSubTitle)
          209  +        self.xMepi = self._addWidget('Mepi', 'RadioButton', nX1+65, nY3+12, 50, nHeight, Label = ui.get("epi"), HelpText = ":e")
          210  +        self.xMmas = self._addWidget('Mmas', 'RadioButton', nX1+65, nY3+22, 50, nHeight, Label = ui.get("mas"), HelpText = ":m")
          211  +        self.xMfem = self._addWidget('Mfem', 'RadioButton', nX1+65, nY3+32, 50, nHeight, Label = ui.get("fem"), HelpText = ":f")
   212    212   
   213    213           # Verbe
   214    214           self._addWidget("fl_verb", 'FixedLine', nX2+30, nY4, 130, nHeight, FontDescriptor = xFDSubTitle)
   215         -        self.xV_i = self._addWidget('v_i', 'CheckBox', nX2, nY4+12, 60, nHeight, Label = self.dUI.get("v_i", "#err"))
   216         -        self.xV_t = self._addWidget('v_t', 'CheckBox', nX2, nY4+20, 60, nHeight, Label = self.dUI.get("v_t", "#err"))
   217         -        self.xV_n = self._addWidget('v_n', 'CheckBox', nX2, nY4+28, 60, nHeight, Label = self.dUI.get("v_n", "#err"))
   218         -        self.xV_p = self._addWidget('v_p', 'CheckBox', nX2, nY4+36, 60, nHeight, Label = self.dUI.get("v_p", "#err"))
   219         -        self.xV_m = self._addWidget('v_m', 'CheckBox', nX2, nY4+44, 60, nHeight, Label = self.dUI.get("v_m", "#err"))
          215  +        self.xV_i = self._addWidget('v_i', 'CheckBox', nX2, nY4+12, 60, nHeight, Label = ui.get("v_i"))
          216  +        self.xV_t = self._addWidget('v_t', 'CheckBox', nX2, nY4+20, 60, nHeight, Label = ui.get("v_t"))
          217  +        self.xV_n = self._addWidget('v_n', 'CheckBox', nX2, nY4+28, 60, nHeight, Label = ui.get("v_n"))
          218  +        self.xV_p = self._addWidget('v_p', 'CheckBox', nX2, nY4+36, 60, nHeight, Label = ui.get("v_p"))
          219  +        self.xV_m = self._addWidget('v_m', 'CheckBox', nX2, nY4+44, 60, nHeight, Label = ui.get("v_m"))
   220    220   
   221         -        self._addWidget('aux', 'FixedText', nX2+75, nY4+10, 90, nHeight, Label = self.dUI.get("aux", "#err"))
   222         -        self.xV_ae = self._addWidget('v_ae', 'CheckBox', nX2+75, nY4+20, 90, nHeight, Label = self.dUI.get("v_ae", "#err"))
   223         -        self.xV_aa = self._addWidget('v_aa', 'CheckBox', nX2+75, nY4+28, 90, nHeight, Label = self.dUI.get("v_aa", "#err"))
          221  +        self._addWidget('aux', 'FixedText', nX2+75, nY4+10, 90, nHeight, Label = ui.get("aux"))
          222  +        self.xV_ae = self._addWidget('v_ae', 'CheckBox', nX2+75, nY4+20, 90, nHeight, Label = ui.get("v_ae"))
          223  +        self.xV_aa = self._addWidget('v_aa', 'CheckBox', nX2+75, nY4+28, 90, nHeight, Label = ui.get("v_aa"))
   224    224   
   225         -        self.xV_pp = self._addWidget('v_pp', 'CheckBox', nX2+75, nY4+44, 90, nHeight, Label = self.dUI.get("v_pp", "#err"))
          225  +        self.xV_pp = self._addWidget('v_pp', 'CheckBox', nX2+75, nY4+44, 90, nHeight, Label = ui.get("v_pp"))
   226    226   
   227         -        self._addWidget('v_pattern_label', 'FixedText', nX2, nY4+56, 75, nHeight, Label = self.dUI.get('v_pattern', "#err"), Align = 2)
          227  +        self._addWidget('v_pattern_label', 'FixedText', nX2, nY4+56, 75, nHeight, Label = ui.get('v_pattern'), Align = 2)
   228    228           self.xVpattern = self._addWidget('v_pattern', 'Edit', nX2+80, nY4+56, 80, nHeight)
   229    229   
   230    230           # Adverbe
   231    231           self._addWidget("fl_adv", 'FixedLine', nX2+30, nY5, 130, nHeight, FontDescriptor = xFDSubTitle)
   232    232   
   233    233           # Autre
   234    234           self._addWidget("fl_other", 'FixedLine', nX2+30, nY6, 130, nHeight, FontDescriptor = xFDSubTitle)
   235         -        self._addWidget('flexion_label', 'FixedText', nX2, nY6+11, 22, nHeight, Label = self.dUI.get('flexion', "#err"), Align = 2)
          235  +        self._addWidget('flexion_label', 'FixedText', nX2, nY6+11, 22, nHeight, Label = ui.get('flexion'), Align = 2)
   236    236           self.xFlexion = self._addWidget('flexion', 'Edit', nX2+25, nY6+10, 50, nHeight)
   237         -        self._addWidget('tags_label', 'FixedText', nX2+80, nY6+11, 27, nHeight, Label = self.dUI.get('tags', "#err"), Align = 2)
          237  +        self._addWidget('tags_label', 'FixedText', nX2+80, nY6+11, 27, nHeight, Label = ui.get('tags'), Align = 2)
   238    238           self.xTags = self._addWidget('tags', 'Edit', nX2+110, nY6+10, 50, nHeight)
   239    239   
   240    240           #### Generated words
   241         -        self._addWidget("gwords_section", 'FixedLine', nXB, nY1, 160, nHeight, Label = self.dUI.get("new_section", "#err"), FontDescriptor = xFDTitle)
          241  +        self._addWidget("gwords_section", 'FixedLine', nXB, nY1, 160, nHeight, Label = ui.get("new_section"), FontDescriptor = xFDTitle)
   242    242           self.xGridModelNew = self._addGrid("list_grid_gwords", nXB, nY1+10, 160, 240, [
   243         -            {"Title": self.dUI.get("lex_flex", "#err"), "ColumnWidth": 80},
   244         -            {"Title": self.dUI.get("lex_tags", "#err"), "ColumnWidth": 80}
          243  +            {"Title": ui.get("lex_flex"), "ColumnWidth": 80},
          244  +            {"Title": ui.get("lex_tags"), "ColumnWidth": 80}
   245    245           ], SelectionModel = uno.Enum("com.sun.star.view.SelectionType", "MULTI"))
   246         -        self.xAdd = self._addWidget('add_button', 'Button', nXB, nY1+255, 75, 12, Label = self.dUI.get('add_button', "#err"), FontDescriptor = xFDSubTitle, TextColor = 0x005500, Enabled = False)
   247         -        self.xDelete = self._addWidget('delete_button', 'Button', nXB+80, nY1+255, 80, 12, Label = self.dUI.get('delete_button', "#err"), FontDescriptor = xFDSubTitle, TextColor = 0x550000)
          246  +        self.xAdd = self._addWidget('add_button', 'Button', nXB, nY1+255, 75, 12, Label = ui.get('add_button'), FontDescriptor = xFDSubTitle, TextColor = 0x005500, Enabled = False)
          247  +        self.xDelete = self._addWidget('delete_button', 'Button', nXB+80, nY1+255, 80, 12, Label = ui.get('delete_button'), FontDescriptor = xFDSubTitle, TextColor = 0x550000)
   248    248   
   249    249           #### Lexicon section
   250         -        self._addWidget("lexicon_section", 'FixedLine', nXC, nY1, 200, nHeight, Label = self.dUI.get("lexicon_section", "#err"), FontDescriptor = xFDTitle)
          250  +        self._addWidget("lexicon_section", 'FixedLine', nXC, nY1, 200, nHeight, Label = ui.get("lexicon_section"), FontDescriptor = xFDTitle)
   251    251           self.xGridModelLex = self._addGrid("list_grid_lexicon", nXC, nY1+10, 200, 240, [
   252         -            {"Title": self.dUI.get("lex_flex", "#err"), "ColumnWidth": 65},
   253         -            {"Title": self.dUI.get("lex_lemma", "#err"), "ColumnWidth": 50},
   254         -            {"Title": self.dUI.get("lex_tags", "#err"), "ColumnWidth": 65}
          252  +            {"Title": ui.get("lex_flex"), "ColumnWidth": 65},
          253  +            {"Title": ui.get("lex_lemma"), "ColumnWidth": 50},
          254  +            {"Title": ui.get("lex_tags"), "ColumnWidth": 65}
   255    255           ], SelectionModel = uno.Enum("com.sun.star.view.SelectionType", "MULTI"))
   256         -        self._addWidget("num_of_entries_label1", 'FixedText', nXC, nY1+257, 60, nHeight, Label = self.dUI.get("num_of_entries_label", "#err"), FontDescriptor = xFDSubTitle)
          256  +        self._addWidget("num_of_entries_label1", 'FixedText', nXC, nY1+257, 60, nHeight, Label = ui.get("num_of_entries_label"), FontDescriptor = xFDSubTitle)
   257    257           self.xNumLex = self._addWidget("num_of_entries1", 'FixedText', nXC+65, nY1+257, 40, nHeight, Label = "0", FontDescriptor = xFDSubTitle)
   258         -        self.xSave = self._addWidget('save_button', 'Button', nXC+110, nY1+255, 45, 12, Label = self.dUI.get('save_button', "#err"), FontDescriptor = xFDSubTitle, TextColor = 0x005500)
   259         -        self._addWidget('close_button', 'Button', nXC+160, nY1+255, 40, 12, Label = self.dUI.get('close_button', "#err"), FontDescriptor = xFDSubTitle, TextColor = 0x550000)
          258  +        self.xSave = self._addWidget('save_button', 'Button', nXC+110, nY1+255, 45, 12, Label = ui.get('save_button'), FontDescriptor = xFDSubTitle, TextColor = 0x005500)
          259  +        self._addWidget('close_button', 'Button', nXC+160, nY1+255, 40, 12, Label = ui.get('close_button'), FontDescriptor = xFDSubTitle, TextColor = 0x550000)
   260    260   
   261    261           self.loadLexicon()
   262    262   
   263    263           # container
   264    264           self.xContainer = self.xSvMgr.createInstanceWithContext('com.sun.star.awt.UnoControlDialog', self.ctx)
   265    265           self.xContainer.setModel(self.xDialog)
   266    266           self.xGridControlNew = self.xContainer.getControl('list_grid_gwords')
................................................................................
   390    390                   oIBDAWG = ibdawg.IBDAWG(self.oPersonalDicJSON)
   391    391                   for i, aEntry in enumerate(oIBDAWG.select()):
   392    392                       xGridDataModel.addRow(i, aEntry)
   393    393                   self.xNumLex.Label = str(i)
   394    394                   self.xNumDic.Label = str(i)
   395    395                   self.xDateDic.Label = oIBDAWG.sDate
   396    396               except:
   397         -                sMessage = self.dUI.get('not_loaded', "#err")
          397  +                sMessage = ui.get('not_loaded')
   398    398                   sMessage += traceback.format_exc()
   399         -                MessageBox(self.xDocument, sMessage, self.dUI.get('load_title', "#err"), ERRORBOX)
          399  +                MessageBox(self.xDocument, sMessage, ui.get('load_title'), ERRORBOX)
   400    400           else:
   401    401               self.xNumLex.Label = 0
   402    402               self.xNumDic.Label = 0
   403         -            self.xDateDic.Label = self.dUI.get("void", "#err")
          403  +            self.xDateDic.Label = ui.get("void")
   404    404   
   405    405       @_waitPointer
   406    406       def importDictionary (self):
   407    407           spfImported = ""
   408    408           try:
   409    409               xFilePicker = self.xSvMgr.createInstanceWithContext('com.sun.star.ui.dialogs.FilePicker', self.ctx)  # other possibility: com.sun.star.ui.dialogs.SystemFilePicker
   410    410               xFilePicker.initialize([uno.getConstantByName("com.sun.star.ui.dialogs.TemplateDescription.FILEOPEN_SIMPLE")]) # seems useless
................................................................................
   425    425               spfImported = os.path.join(os.path.expanduser("~"), "fr.__personal__.json") # workaround
   426    426           if spfImported and os.path.isfile(spfImported):
   427    427               with open(spfImported, "r", encoding="utf-8") as hDst:
   428    428                   sJSON = hDst.read()
   429    429                   try:
   430    430                       sTest = json.loads(sJSON)
   431    431                   except:
   432         -                    sMessage = self.dUI.get('wrong_json', "#err_msg: %s") % spfImported
   433         -                    MessageBox(self.xDocument, sMessage, self.dUI.get('import_title', "#err"), ERRORBOX)
          432  +                    sMessage = ui.get('wrong_json', "#err_msg: %s") % spfImported
          433  +                    MessageBox(self.xDocument, sMessage, ui.get('import_title'), ERRORBOX)
   434    434                   else:
   435    435                       self.xOptionNode.setPropertyValue("personal_dic", sJSON)
   436    436                       self.xSettingNode.commitChanges()
   437    437                       self.loadLexicon()
   438    438           else:
   439         -            sMessage = self.dUI.get('file_not_found', "#err_msg: %s") % spfImported
   440         -            MessageBox(self.xDocument, sMessage, self.dUI.get('import_title', "#err"), ERRORBOX)
          439  +            sMessage = ui.get('file_not_found', "#err_msg: %s") % spfImported
          440  +            MessageBox(self.xDocument, sMessage, ui.get('import_title'), ERRORBOX)
   441    441   
   442    442       @_waitPointer
   443    443       def saveLexicon (self):
   444    444           xGridDataModel = self.xGridModelLex.GridDataModel
   445    445           lEntry = []
   446    446           for i in range(xGridDataModel.RowCount):
   447    447               lEntry.append(xGridDataModel.getRowData(i))
................................................................................
   452    452               self.xSettingNode.commitChanges()
   453    453               self.xNumDic.Label = str(self.oPersonalDicJSON["nEntry"])
   454    454               self.xDateDic.Label = self.oPersonalDicJSON["sDate"]
   455    455           else:
   456    456               self.xOptionNode.setPropertyValue("personal_dic", "")
   457    457               self.xSettingNode.commitChanges()
   458    458               self.xNumDic.Label = "0"
   459         -            self.xDateDic.Label = self.dUI.get("void", "#err")
   460         -        MessageBox(self.xDocument, self.dUI.get('save_message', "#err"), self.dUI.get('save_title', "#err"))
          459  +            self.xDateDic.Label = ui.get("void")
          460  +        MessageBox(self.xDocument, ui.get('save_message'), ui.get('save_title'))
   461    461   
   462    462       def exportDictionary (self):
   463    463           try:
   464    464               xFilePicker = self.xSvMgr.createInstanceWithContext('com.sun.star.ui.dialogs.FilePicker', self.ctx)  # other possibility: com.sun.star.ui.dialogs.SystemFilePicker
   465    465               xFilePicker.initialize([uno.getConstantByName("com.sun.star.ui.dialogs.TemplateDescription.FILESAVE_SIMPLE")]) # seems useless
   466    466               xFilePicker.appendFilter("Supported files", "*.json")
   467    467               xFilePicker.setDefaultName("fr.__personal__.json") # useless, doesn’t work
................................................................................
   475    475                   if platform.system() != "Windows":
   476    476                       spfExported = "/" + spfExported
   477    477                   #spfExported = os.path.join(os.path.expanduser("~"), "fr.personal.json")
   478    478                   sJSON = self.xOptionNode.getPropertyValue("personal_dic")
   479    479                   if sJSON:
   480    480                       with open(spfExported, "w", encoding="utf-8") as hDst:
   481    481                           hDst.write(sJSON)
   482         -                    sMessage = self.dUI.get('export_message', "#err_msg: %s") % spfExported
          482  +                    sMessage = ui.get('export_message', "#err_msg: %s") % spfExported
   483    483                   else:
   484         -                    sMessage = self.dUI.get('empty_dictionary', "#err")
   485         -                MessageBox(self.xDocument, sMessage, self.dUI.get('export_title', "#err"))
          484  +                    sMessage = ui.get('empty_dictionary')
          485  +                MessageBox(self.xDocument, sMessage, ui.get('export_title'))
   486    486           except:
   487    487               sMessage = traceback.format_exc()
   488         -            MessageBox(self.xDocument, sMessage, self.dUI.get('export_title', "#err"), ERRORBOX)
          488  +            MessageBox(self.xDocument, sMessage, ui.get('export_title'), ERRORBOX)
   489    489   
   490    490       def _getRadioValue (self, *args):
   491    491           for x in args:
   492    492               if x.State:
   493    493                   return x.HelpText
   494    494           return None
   495    495   

Modified gc_lang/fr/oxt/DictOptions/SearchWords.py from [2c4ada79ef] to [a5205698ad].

     4      4   
     5      5   import unohelper
     6      6   import uno
     7      7   import traceback
     8      8   import re
     9      9   
    10     10   import helpers
    11         -import sw_strings
           11  +import sw_strings as ui
    12     12   import grammalecte.graphspell as sc
    13     13   import grammalecte.graphspell.ibdawg as ibdawg
    14     14   
    15     15   from com.sun.star.task import XJobExecutor
    16     16   from com.sun.star.awt import XActionListener
    17     17   
    18     18   
................................................................................
    94     94           for k, w in kwargs.items():
    95     95               setattr(xGridModel, k, w)
    96     96           self.xDialog.insertByName(name, xGridModel)
    97     97           return xGridModel
    98     98   
    99     99       def run (self, sLang, oPersonalDicJSON):
   100    100           # ui lang
   101         -        self.dUI = sw_strings.getUI(sLang)
          101  +        ui.selectLang(sLang)
   102    102           self.oPersonalDicJSON = oPersonalDicJSON
   103    103   
   104    104           # dialog
   105    105           self.xDialog = self.xSvMgr.createInstanceWithContext('com.sun.star.awt.UnoControlDialogModel', self.ctx)
   106    106           self.xDialog.Width = 350
   107    107           self.xDialog.Height = 305
   108         -        self.xDialog.Title = self.dUI.get('title', "#title#")
          108  +        self.xDialog.Title = ui.get('title')
   109    109           #xWindowSize = helpers.getWindowSize()
   110    110           #self.xDialog.PositionX = int((xWindowSize.Width / 2) - (self.xDialog.Width / 2))
   111    111           #self.xDialog.PositionY = int((xWindowSize.Height / 2) - (self.xDialog.Height / 2))
   112    112   
   113    113           # fonts
   114    114           xFDTitle = uno.createUnoStruct("com.sun.star.awt.FontDescriptor")
   115    115           xFDTitle.Height = 9
................................................................................
   128    128           nY0 = 5
   129    129           nY1 = nY0 + 20
   130    130           nY2 = nY1 + 60
   131    131   
   132    132           nHeight = 10
   133    133   
   134    134           #### Search
   135         -        self._addWidget("search_section", 'FixedLine', nX1, nY0, 120, nHeight, Label = self.dUI.get("search_section", "#err"), FontDescriptor = xFDTitle)
   136         -        self._addWidget("similar_search_section", 'FixedLine', nX1, nY1, 120, nHeight, Label = self.dUI.get("similar_search_section", "#err"), FontDescriptor = xFDSubTitle)
          135  +        self._addWidget("search_section", 'FixedLine', nX1, nY0, 120, nHeight, Label = ui.get("search_section"), FontDescriptor = xFDTitle)
          136  +        self._addWidget("similar_search_section", 'FixedLine', nX1, nY1, 120, nHeight, Label = ui.get("similar_search_section"), FontDescriptor = xFDSubTitle)
   137    137           self.xWord = self._addWidget('word', 'Edit', nX1, nY1+10, 100, nHeight)
   138         -        self._addWidget('similar_search_button', 'Button', nX1, nY1+22, 55, 12, Label = self.dUI.get('similar_search_button', "#err"), FontDescriptor = xFDSubTitle, TextColor = 0x005500)
          138  +        self._addWidget('similar_search_button', 'Button', nX1, nY1+22, 55, 12, Label = ui.get('similar_search_button'), FontDescriptor = xFDSubTitle, TextColor = 0x005500)
   139    139   
   140    140   
   141         -        self._addWidget("regex_search_section", 'FixedLine', nX1, nY2, 120, nHeight, Label = self.dUI.get("regex_search_section", "#err"), FontDescriptor = xFDSubTitle)
   142         -        self._addWidget('flexion_label', 'FixedText', nX1, nY2+10, 30, nHeight, Label = self.dUI.get('flexion', "#err"))
          141  +        self._addWidget("regex_search_section", 'FixedLine', nX1, nY2, 120, nHeight, Label = ui.get("regex_search_section"), FontDescriptor = xFDSubTitle)
          142  +        self._addWidget('flexion_label', 'FixedText', nX1, nY2+10, 30, nHeight, Label = ui.get('flexion'))
   143    143           self.xFlexion = self._addWidget('flexion', 'Edit', nX1+35, nY2+10, 85, nHeight)
   144         -        self._addWidget('tags_label', 'FixedText', nX1, nY2+22, 30, nHeight, Label = self.dUI.get('tags', "#err"))
          144  +        self._addWidget('tags_label', 'FixedText', nX1, nY2+22, 30, nHeight, Label = ui.get('tags'))
   145    145           self.xTags = self._addWidget('tags', 'Edit', nX1+35, nY2+22, 85, nHeight)
   146         -        self._addWidget('regex_search_button', 'Button', nX1, nY2+34, 55, 12, Label = self.dUI.get('regex_search_button', "#err"), FontDescriptor = xFDSubTitle, TextColor = 0x005500)
   147         -        self._addWidget('result_warning', 'FixedText', nX1, nY2+50, 120, nHeight*7, Label = self.dUI.get('result_warning', '#err'), MultiLine = True)
          146  +        self._addWidget('regex_search_button', 'Button', nX1, nY2+34, 55, 12, Label = ui.get('regex_search_button'), FontDescriptor = xFDSubTitle, TextColor = 0x005500)
          147  +        self._addWidget('result_warning', 'FixedText', nX1, nY2+50, 120, nHeight*7, Label = ui.get('result_warning'), MultiLine = True)
   148    148   
   149    149           #### Results
   150         -        self._addWidget("result_section", 'FixedLine', nX2, nY0, 200, nHeight, Label = self.dUI.get("result_section", "#err"), FontDescriptor = xFDTitle)
          150  +        self._addWidget("result_section", 'FixedLine', nX2, nY0, 200, nHeight, Label = ui.get("result_section"), FontDescriptor = xFDTitle)
   151    151           self.xGridModel = self._addGrid("list_grid_search", nX2, nY0+10, 200, 265, [
   152         -            {"Title": self.dUI.get("res_flexion", "#err"), "ColumnWidth": 70},
   153         -            {"Title": self.dUI.get("res_lemma", "#err"), "ColumnWidth": 60},
   154         -            {"Title": self.dUI.get("res_tags", "#err"), "ColumnWidth": 70}
          152  +            {"Title": ui.get("res_flexion"), "ColumnWidth": 70},
          153  +            {"Title": ui.get("res_lemma"), "ColumnWidth": 60},
          154  +            {"Title": ui.get("res_tags"), "ColumnWidth": 70}
   155    155           ])
   156    156   
   157         -        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)
          157  +        self._addWidget('close_button', 'Button', self.xDialog.Width-50, self.xDialog.Height-20, 40, 12, Label = ui.get('close_button'), FontDescriptor = xFDSubTitle, TextColor = 0x550000)
   158    158   
   159    159           # container
   160    160           self.xContainer = self.xSvMgr.createInstanceWithContext('com.sun.star.awt.UnoControlDialog', self.ctx)
   161    161           self.xContainer.setModel(self.xDialog)
   162    162           self.xGridControlSearch = self.xContainer.getControl('list_grid_search')
   163    163           self.xGridControlInfo = self.xContainer.getControl('list_grid_info')
   164    164           self.xContainer.getControl('similar_search_button').addActionListener(self)
................................................................................
   191    191       @_waitPointer
   192    192       def searchSimilar (self):
   193    193           self.initSpellChecker()
   194    194           sWord = self.xWord.Text.strip()
   195    195           if sWord:
   196    196               xGridDataModel = self.xGridModel.GridDataModel
   197    197               xGridDataModel.removeAllRows()
   198         -            lResult = self.oSpellChecker.getSimilarEntries(sWord, 20);
          198  +            lResult = self.oSpellChecker.getSimilarEntries(sWord, 20)
   199    199               for i, aEntry in enumerate(lResult):
   200    200                   xGridDataModel.addRow(i, aEntry)
   201    201   
   202    202       @_waitPointer
   203    203       def searchRegex (self):
   204    204           self.initSpellChecker()
   205    205           sFlexPattern = self.xFlexion.Text.strip()
   206    206           sTagsPattern = self.xTags.Text.strip()
   207    207           try:
   208    208               if sFlexPattern:
   209    209                   re.compile(sFlexPattern)
   210    210           except:
   211         -            MessageBox(self.xDocument, self.dUI.get("regex_error_flexion", "#err"), self.dUI.get("error", "#err"), nBoxType=ERRORBOX)
          211  +            MessageBox(self.xDocument, ui.get("regex_error_flexion"), ui.get("error"), nBoxType=ERRORBOX)
   212    212               sFlexPattern = ""
   213    213           try:
   214    214               if sTagsPattern:
   215    215                   re.compile(sTagsPattern)
   216    216           except:
   217         -            MessageBox(self.xDocument, self.dUI.get("regex_error_tags", "#err"), self.dUI.get("error", "#err"), nBoxType=ERRORBOX)
          217  +            MessageBox(self.xDocument, ui.get("regex_error_tags"), ui.get("error"), nBoxType=ERRORBOX)
   218    218               sTagsPattern = ""
   219    219           xGridDataModel = self.xGridModel.GridDataModel
   220    220           xGridDataModel.removeAllRows()
   221    221           for i, aEntry in enumerate(self.oSpellChecker.select(sFlexPattern, sTagsPattern)):
   222    222               xGridDataModel.addRow(i, aEntry)
   223    223               i += 1
   224    224               if i >= 2000:
   225    225                   break

Modified gc_lang/fr/oxt/DictOptions/TagsInfo.py from [190c0fe5da] to [e74861f733].

     3      3   # License: MPL 2
     4      4   
     5      5   import unohelper
     6      6   import uno
     7      7   import traceback
     8      8   
     9      9   import helpers
    10         -import ti_strings
           10  +import ti_strings as ui
    11     11   
    12     12   import grammalecte.graphspell.lexgraph_fr as lxg
    13     13   
    14     14   from com.sun.star.task import XJobExecutor
    15     15   from com.sun.star.awt import XActionListener
    16     16   
    17     17   
................................................................................
    54     54           for k, w in kwargs.items():
    55     55               setattr(xGridModel, k, w)
    56     56           self.xDialog.insertByName(name, xGridModel)
    57     57           return xGridModel
    58     58   
    59     59       def run (self, sLang):
    60     60           # ui lang
    61         -        self.dUI = ti_strings.getUI(sLang)
           61  +        ui.selectLang(sLang)
    62     62   
    63     63           # dialog
    64     64           self.xDialog = self.xSvMgr.createInstanceWithContext('com.sun.star.awt.UnoControlDialogModel', self.ctx)
    65     65           self.xDialog.Width = 360
    66     66           self.xDialog.Height = 305
    67         -        self.xDialog.Title = self.dUI.get('title', "#title#")
           67  +        self.xDialog.Title = ui.get('title')
    68     68           #xWindowSize = helpers.getWindowSize()
    69     69           #self.xDialog.PositionX = int((xWindowSize.Width / 2) - (self.xDialog.Width / 2))
    70     70           #self.xDialog.PositionY = int((xWindowSize.Height / 2) - (self.xDialog.Height / 2))
    71     71   
    72     72           # fonts
    73     73           xFDTitle = uno.createUnoStruct("com.sun.star.awt.FontDescriptor")
    74     74           xFDTitle.Height = 9
................................................................................
    92     92           nY4 = nY3 + 80
    93     93   
    94     94           nXB = nX1 + 110
    95     95   
    96     96           nHeight = 10
    97     97   
    98     98           #### Add word
    99         -        self._addWidget("add_section", 'FixedLine', nX1, nY0, 100, nHeight, Label = self.dUI.get("information_section", "#err"), FontDescriptor = xFDTitle)
           99  +        self._addWidget("add_section", 'FixedLine', nX1, nY0, 100, nHeight, Label = ui.get("information_section"), FontDescriptor = xFDTitle)
          100  +
          101  +        self._addWidget('save_label', 'FixedText', nX1, nY1, 100, nHeight, Label = ui.get('save'), FontDescriptor = xFDTitle)
          102  +        self._addWidget('save_desc_label', 'FixedText', nX1, nY1+10, 100, nHeight*5, Label = ui.get('save_desc'), MultiLine=True)
   100    103   
   101         -        self._addWidget('save_label', 'FixedText', nX1, nY1, 100, nHeight, Label = self.dUI.get('save', "#err"), FontDescriptor = xFDTitle)
   102         -        self._addWidget('save_desc_label', 'FixedText', nX1, nY1+10, 100, nHeight*5, Label = self.dUI.get('save_desc', "#err"), MultiLine=True)
          104  +        self._addWidget('duplicates_label', 'FixedText', nX1, nY2, 100, nHeight, Label = ui.get('duplicates'), FontDescriptor = xFDTitle)
          105  +        self._addWidget('duplicates_desc_label', 'FixedText', nX1, nY2+10, 100, nHeight*5, Label = ui.get('duplicates_desc'), MultiLine=True)
   103    106   
   104         -        self._addWidget('duplicates_label', 'FixedText', nX1, nY2, 100, nHeight, Label = self.dUI.get('duplicates', "#err"), FontDescriptor = xFDTitle)
   105         -        self._addWidget('duplicates_desc_label', 'FixedText', nX1, nY2+10, 100, nHeight*5, Label = self.dUI.get('duplicates_desc', "#err"), MultiLine=True)
          107  +        self._addWidget('compilation_label', 'FixedText', nX1, nY3, 100, nHeight, Label = ui.get('compilation'), FontDescriptor = xFDTitle)
          108  +        self._addWidget('compilation_desc_label', 'FixedText', nX1, nY3+10, 100, nHeight*7, Label = ui.get('compilation_desc'), MultiLine=True)
   106    109   
   107         -        self._addWidget('compilation_label', 'FixedText', nX1, nY3, 100, nHeight, Label = self.dUI.get('compilation', "#err"), FontDescriptor = xFDTitle)
   108         -        self._addWidget('compilation_desc_label', 'FixedText', nX1, nY3+10, 100, nHeight*7, Label = self.dUI.get('compilation_desc', "#err"), MultiLine=True)
   109         -
   110         -        self._addWidget('warning_label', 'FixedText', nX1, nY4, 100, nHeight, Label = self.dUI.get('warning', "#err"), FontDescriptor = xFDTitle)
   111         -        self._addWidget('warning_desc_label', 'FixedText', nX1, nY4+10, 100, nHeight*7, Label = self.dUI.get('warning_desc', "#err"), MultiLine=True)
          110  +        self._addWidget('warning_label', 'FixedText', nX1, nY4, 100, nHeight, Label = ui.get('warning'), FontDescriptor = xFDTitle)
          111  +        self._addWidget('warning_desc_label', 'FixedText', nX1, nY4+10, 100, nHeight*7, Label = ui.get('warning_desc'), MultiLine=True)
   112    112   
   113    113           #### Tags
   114         -        self._addWidget("tags_section", 'FixedLine', nXB, nY0, 230, nHeight, Label = self.dUI.get("tags_section", "#err"), FontDescriptor = xFDTitle)
          114  +        self._addWidget("tags_section", 'FixedLine', nXB, nY0, 230, nHeight, Label = ui.get("tags_section"), FontDescriptor = xFDTitle)
   115    115           self.xGridModel = self._addGrid("list_grid_tags", nXB, nY0+10, 230, 265, [
   116         -            {"Title": self.dUI.get("tags", "#err"), "ColumnWidth": 40},
   117         -            {"Title": self.dUI.get("meaning", "#err"), "ColumnWidth": 190}
          116  +            {"Title": ui.get("tags"), "ColumnWidth": 40},
          117  +            {"Title": ui.get("meaning"), "ColumnWidth": 190}
   118    118           ])
   119    119   
   120         -        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)
          120  +        self._addWidget('close_button', 'Button', self.xDialog.Width-50, self.xDialog.Height-20, 40, 12, Label = ui.get('close_button'), FontDescriptor = xFDSubTitle, TextColor = 0x550000)
   121    121   
   122    122           self.loadData()
   123    123   
   124    124           # container
   125    125           self.xContainer = self.xSvMgr.createInstanceWithContext('com.sun.star.awt.UnoControlDialog', self.ctx)
   126    126           self.xContainer.setModel(self.xDialog)
   127    127           self.xGridControlInfo = self.xContainer.getControl('list_grid_tags')

Modified gc_lang/fr/oxt/DictOptions/do_strings.py from [0a191cd7cc] to [b3a084563a].

     1         -def getUI (sLang):
            1  +# Strings for Dictionary Options
            2  +
            3  +
            4  +sUI = "fr"
            5  +
            6  +
            7  +def selectLang (sLang):
            8  +    global sUI
     2      9       if sLang in dStrings:
     3         -        return dStrings[sLang]
     4         -    return dStrings["fr"]
           10  +        sUI = sLang
           11  +
           12  +
           13  +def get (sMsgCode):
           14  +    try:
           15  +        return dStrings[sUI].get(sMsgCode, sMsgCode)
           16  +    except:
           17  +        return "#error"
           18  +
     5     19   
     6     20   dStrings = {
     7     21       "fr": {
     8     22           "title": "Grammalecte · Options orthographiques",
     9     23   
    10     24           "spelling_section": "Correcteur orthographique",
    11     25           "activate_main": "Activer le correcteur orthographique de Grammalecte",

Modified gc_lang/fr/oxt/DictOptions/lxe_strings.py from [18be362df4] to [bdca2671c1].

     1         -def getUI (sLang):
            1  +# Strings for Lexicon Editor
            2  +
            3  +
            4  +sUI = "fr"
            5  +
            6  +
            7  +def selectLang (sLang):
            8  +    global sUI
     2      9       if sLang in dStrings:
     3         -        return dStrings[sLang]
     4         -    return dStrings["fr"]
           10  +        sUI = sLang
           11  +
           12  +
           13  +def get (sMsgCode):
           14  +    try:
           15  +        return dStrings[sUI].get(sMsgCode, sMsgCode)
           16  +    except:
           17  +        return "#error"
           18  +
     5     19   
     6     20   dStrings = {
     7     21       "fr": {
     8     22           "title": "Grammalecte · Éditeur lexical",
     9     23   
    10     24           # Ajout
    11     25           "add_section": "Nouveau mot (lemme)",

Modified gc_lang/fr/oxt/DictOptions/sw_strings.py from [ae09aedf5b] to [4a00265ae2].

     1         -def getUI (sLang):
            1  +# Strings for Search Word
            2  +
            3  +
            4  +sUI = "fr"
            5  +
            6  +
            7  +def selectLang (sLang):
            8  +    global sUI
     2      9       if sLang in dStrings:
     3         -        return dStrings[sLang]
     4         -    return dStrings["fr"]
           10  +        sUI = sLang
           11  +
           12  +
           13  +def get (sMsgCode):
           14  +    try:
           15  +        return dStrings[sUI].get(sMsgCode, sMsgCode)
           16  +    except:
           17  +        return "#error"
           18  +
     5     19   
     6     20   dStrings = {
     7     21       "fr": {
     8     22           "title": "Grammalecte · Recherche et informations",
     9     23   
    10     24           "search_section": "Recherche",
    11     25   
................................................................................
    18     32           "regex_search_button": "Chercher",
    19     33           "result_warning": "La recherche par expressions régulières peut générer un nombre gigantesque de résultats. Seules les 2000 premières occurrences trouvées seront affichées. La recherche peut être longue, parce tout le graphe de mots, qui contient 500 000 flexions, sera parcouru si besoin.",
    20     34   
    21     35           "result_section": "Résultats",
    22     36           "res_flexion": "Flexions",
    23     37           "res_lemma": "Lemmes",
    24     38           "res_tags": "Étiquettes",
    25         -        
           39  +
    26     40           "close_button": "Fermer",
    27     41   
    28     42           "error": "Erreur",
    29     43           "regex_error_flexion": "L’expression régulière du champ ‹Flexion› est erronée.",
    30     44           "regex_error_tags": "L’expression régulière du champ ‹Étiquettes› est erronée."
    31     45       },
    32     46   
    33     47       "en": {
    34     48           "title": "Grammalecte · Search and informations",
    35         -        
           49  +
    36     50           "search_section": "Search",
    37     51   
    38     52           "similar_search_section": "Similar words",
    39     53           "similar_search_button": "Search",
    40     54   
    41     55           "regex_search_section": "Regular expressions",
    42     56           "flexion": "Flexion",
................................................................................
    44     58           "regex_search_button": "Search",
    45     59           "result_warning": "Search via regular expressions can generate a huge amount of results. Only the first 2000 occurrences found will be displayed. Search may be long as the full word graph, which contains 500,000 flexions, will be parsed if required.",
    46     60   
    47     61           "result_section": "Results",
    48     62           "res_flexion": "Flexions",
    49     63           "res_lemma": "Lemmas",
    50     64           "res_tags": "Tags",
    51         -        
           65  +
    52     66           "close_button": "Close",
    53     67   
    54     68           "error": "Error",
    55     69           "regex_error_flexion": "The regular expression in field ‹Flexion› is wrong.",
    56     70           "regex_error_tags": "The regular expression in field ‹Tags› is wrong."
    57     71       },
    58     72   }

Modified gc_lang/fr/oxt/DictOptions/ti_strings.py from [be1117599a] to [a8cb6b2d8a].

     1         -def getUI (sLang):
            1  +# Strings for Tags Info
            2  +
            3  +
            4  +sUI = "fr"
            5  +
            6  +
            7  +def selectLang (sLang):
            8  +    global sUI
     2      9       if sLang in dStrings:
     3         -        return dStrings[sLang]
     4         -    return dStrings["fr"]
           10  +        sUI = sLang
           11  +
           12  +
           13  +def get (sMsgCode):
           14  +    try:
           15  +        return dStrings[sUI].get(sMsgCode, sMsgCode)
           16  +    except:
           17  +        return "#error"
           18  +
     5     19   
     6     20   dStrings = {
     7     21       "fr": {
     8     22           "title": "Grammalecte · Informations",
     9     23   
    10     24           "information_section": "Informations",
    11     25   
................................................................................
    26     40           "meaning": "Signification",
    27     41   
    28     42           "close_button": "Fermer"
    29     43       },
    30     44   
    31     45       "en": {
    32     46           "title": "Grammalecte · Informations",
    33         -        
           47  +
    34     48           "information_section": "Informations",
    35     49   
    36     50           "save": "Save",
    37     51           "save_desc": "Modifications to the lexicon are only saved in the dictionary when you click on ‹Save›.",
    38     52   
    39     53           "duplicates": "Duplicates",
    40     54           "duplicates_desc": "It is useless to expurgate your lexicon from duplicates. Duplicates are automatically deleted when the dictionary is created.",

Modified gc_lang/fr/oxt/GraphicOptions/GraphicOptions.py from [c4f8c66470] to [185a3b1c8e].

     4      4   
     5      5   import unohelper
     6      6   import uno
     7      7   import re
     8      8   import traceback
     9      9   
    10     10   import helpers
    11         -import go_strings
           11  +import go_strings as ui
    12     12   
    13     13   from com.sun.star.task import XJobExecutor
    14     14   from com.sun.star.awt import XActionListener
    15     15   from com.sun.star.beans import PropertyValue
    16     16   
    17     17   
    18     18   class GraphicOptions (unohelper.Base, XActionListener, XJobExecutor):
................................................................................
    32     32           xWidget.Height = h
    33     33           for k, w in kwargs.items():
    34     34               setattr(xWidget, k, w)
    35     35           self.xDialog.insertByName(name, xWidget)
    36     36           return xWidget
    37     37   
    38     38       def run (self, sLang):
    39         -        self.dUI = go_strings.getUI(sLang)
           39  +        ui.selectLang(sLang)
    40     40   
    41     41           self.xDesktop = self.xSvMgr.createInstanceWithContext("com.sun.star.frame.Desktop", self.ctx)
    42     42           self.xDocument = self.xDesktop.getCurrentComponent()
    43     43           self.xGLOptionNode = helpers.getConfigSetting("/org.openoffice.Lightproof_grammalecte/Other/", True)
    44     44   
    45     45           # dialog
    46     46           self.xDialog = self.xSvMgr.createInstanceWithContext('com.sun.star.awt.UnoControlDialogModel', self.ctx)
    47     47           self.xDialog.Width = 200
    48     48           self.xDialog.Height = 220
    49         -        self.xDialog.Title = self.dUI.get('title', "#title#")
           49  +        self.xDialog.Title = ui.get('title')
    50     50           xWindowSize = helpers.getWindowSize()
    51     51           self.xDialog.PositionX = int((xWindowSize.Width / 2) - (self.xDialog.Width / 2))
    52     52           self.xDialog.PositionY = int((xWindowSize.Height / 2) - (self.xDialog.Height / 2))
    53     53   
    54     54           # fonts
    55     55           xFDTitle = uno.createUnoStruct("com.sun.star.awt.FontDescriptor")
    56     56           xFDTitle.Height = 9
................................................................................
    69     69           nY3 = nY2 + 55
    70     70           nY4 = nY3 + 65
    71     71   
    72     72           nWidth = self.xDialog.Width - 20
    73     73           nHeight = 10
    74     74   
    75     75           # Info
    76         -        self._addWidget("graphic_info", 'FixedText', nX, nY1, nWidth, nHeight*2, Label = self.dUI.get("graphic_info", "#err"), MultiLine = True, FontDescriptor = xFDSubTitle)
    77         -        self._addWidget("spell_info", 'FixedText', nX, nY1+20, nWidth, nHeight*2, Label = self.dUI.get("spell_info", "#err"), MultiLine = True)
           76  +        self._addWidget("graphic_info", 'FixedText', nX, nY1, nWidth, nHeight*2, Label = ui.get("graphic_info"), MultiLine = True, FontDescriptor = xFDSubTitle)
           77  +        self._addWidget("spell_info", 'FixedText', nX, nY1+20, nWidth, nHeight*2, Label = ui.get("spell_info"), MultiLine = True)
    78     78   
    79     79           # Line type
    80         -        self._addWidget('linetype_section', 'FixedLine', nX, nY2, nWidth, nHeight, Label = self.dUI.get('linetype_section', "#err"), FontDescriptor = xFDTitle)
    81         -        self.xWaveLine = self._addWidget('wave_line', 'RadioButton', nX, nY2+15, nWidth, nHeight, Label = self.dUI.get('wave_line', "#err"))
    82         -        self.xBoldWaveLine = self._addWidget('boldwave_line', 'RadioButton', nX, nY2+25, nWidth, nHeight, Label = self.dUI.get('boldwave_line', "#err"))
    83         -        self.xBoldLine = self._addWidget('bold_line', 'RadioButton', nX, nY2+35, nWidth, nHeight, Label = self.dUI.get('bold_line', "#err"))
           80  +        self._addWidget('linetype_section', 'FixedLine', nX, nY2, nWidth, nHeight, Label = ui.get('linetype_section'), FontDescriptor = xFDTitle)
           81  +        self.xWaveLine = self._addWidget('wave_line', 'RadioButton', nX, nY2+15, nWidth, nHeight, Label = ui.get('wave_line'))
           82  +        self.xBoldWaveLine = self._addWidget('boldwave_line', 'RadioButton', nX, nY2+25, nWidth, nHeight, Label = ui.get('boldwave_line'))
           83  +        self.xBoldLine = self._addWidget('bold_line', 'RadioButton', nX, nY2+35, nWidth, nHeight, Label = ui.get('bold_line'))
    84     84   
    85     85           # Color
    86         -        self._addWidget("color_section", 'FixedLine', nX, nY3, nWidth, nHeight, Label = self.dUI.get("color_section", "#err"), FontDescriptor = xFDTitle)
    87         -        self.xMulticolor = self._addWidget('multicolor_line', 'CheckBox', nX, nY3+15, nWidth, nHeight, Label = self.dUI.get('multicolor_line', "#err"))
    88         -        self._addWidget('multicolor_descr', 'FixedText', nX, nY3+25, nWidth, nHeight*4, Label = self.dUI.get('multicolor_descr', "#err"), MultiLine = True)
           86  +        self._addWidget("color_section", 'FixedLine', nX, nY3, nWidth, nHeight, Label = ui.get("color_section"), FontDescriptor = xFDTitle)
           87  +        self.xMulticolor = self._addWidget('multicolor_line', 'CheckBox', nX, nY3+15, nWidth, nHeight, Label = ui.get('multicolor_line'))
           88  +        self._addWidget('multicolor_descr', 'FixedText', nX, nY3+25, nWidth, nHeight*4, Label = ui.get('multicolor_descr'), MultiLine = True)
    89     89   
    90     90           # Restart message
    91         -        self._addWidget('restart', 'FixedText', nX, nY4, nWidth, nHeight*2, Label = self.dUI.get('restart', "#err"), FontDescriptor = xFDTitle, MultiLine = True, TextColor = 0x880000)
           91  +        self._addWidget('restart', 'FixedText', nX, nY4, nWidth, nHeight*2, Label = ui.get('restart'), FontDescriptor = xFDTitle, MultiLine = True, TextColor = 0x880000)
    92     92   
    93     93           # Button
    94         -        self._addWidget('apply_button', 'Button', self.xDialog.Width-115, self.xDialog.Height-20, 50, 14, Label = self.dUI.get('apply_button', "#err"), FontDescriptor = xFDTitle, TextColor = 0x005500)
    95         -        self._addWidget('cancel_button', 'Button', self.xDialog.Width-60, self.xDialog.Height-20, 50, 14, Label = self.dUI.get('cancel_button', "#err"), FontDescriptor = xFDTitle, TextColor = 0x550000)
           94  +        self._addWidget('apply_button', 'Button', self.xDialog.Width-115, self.xDialog.Height-20, 50, 14, Label = ui.get('apply_button'), FontDescriptor = xFDTitle, TextColor = 0x005500)
           95  +        self._addWidget('cancel_button', 'Button', self.xDialog.Width-60, self.xDialog.Height-20, 50, 14, Label = ui.get('cancel_button'), FontDescriptor = xFDTitle, TextColor = 0x550000)
    96     96   
    97     97           self._loadOptions()
    98     98   
    99     99           # container
   100    100           self.xContainer = self.xSvMgr.createInstanceWithContext('com.sun.star.awt.UnoControlDialog', self.ctx)
   101    101           self.xContainer.setModel(self.xDialog)
   102    102           self.xContainer.getControl('apply_button').addActionListener(self)

Modified gc_lang/fr/oxt/GraphicOptions/go_strings.py from [fd57d7ab87] to [46318c07da].

     1         -def getUI (sLang):
            1  +# strings for Graphic Options
            2  +
            3  +sUI = "fr"
            4  +
            5  +
            6  +def selectLang (sLang):
            7  +    global sUI
     2      8       if sLang in dStrings:
     3         -        return dStrings[sLang]
     4         -    return dStrings["fr"]
            9  +        sUI = sLang
           10  +
           11  +
           12  +def get (sMsgCode):
           13  +    try:
           14  +        return dStrings[sUI].get(sMsgCode, sMsgCode)
           15  +    except:
           16  +        return "#error"
           17  +
     5     18   
     6     19   dStrings = {
     7     20       "fr": {
     8     21           "title": "Grammalecte · Options graphiques",
     9     22   
    10     23           "graphic_info": "Apparence du soulignement des erreurs grammaticales et typographiques",
    11     24           "spell_info": "L’apparence du soulignement des erreurs orthographiques (trait ondulé rouge) n’est pas modifiable",

Modified gc_lang/fr/oxt/Lexicographer/Enumerator.py from [6f8637a9b7] to [d6e795f3c6].

     4      4   
     5      5   import unohelper
     6      6   import uno
     7      7   import traceback
     8      8   import platform
     9      9   
    10     10   import helpers
    11         -import enum_strings
           11  +import enum_strings as ui
    12     12   import grammalecte.graphspell as sc
    13     13   
    14     14   from com.sun.star.task import XJobExecutor
    15     15   from com.sun.star.awt import XActionListener
    16     16   from com.sun.star.awt import XTopWindowListener
    17     17   
    18     18   from com.sun.star.awt.MessageBoxButtons import BUTTONS_OK
................................................................................
    99     99               xColumnModel.addColumn(xCol)
   100    100           for k, w in kwargs.items():
   101    101               setattr(xGridModel, k, w)
   102    102           self.xDialog.insertByName(name, xGridModel)
   103    103           return xGridModel
   104    104   
   105    105       def run (self, sLang):
   106         -        self.dUI = enum_strings.getUI(sLang)
          106  +        ui.selectLang(sLang)
   107    107   
   108    108           # dialog
   109    109           self.xDialog = self.xSvMgr.createInstanceWithContext('com.sun.star.awt.UnoControlDialogModel', self.ctx)
   110    110           self.xDialog.Width = 240
   111    111           self.xDialog.Height = 280
   112         -        self.xDialog.Title = self.dUI.get('title', "#title#")
          112  +        self.xDialog.Title = ui.get('title')
   113    113           xWindowSize = helpers.getWindowSize()
   114    114           self.xDialog.PositionX = int((xWindowSize.Width / 2) - (self.xDialog.Width / 2))
   115    115           self.xDialog.PositionY = int((xWindowSize.Height / 2) - (self.xDialog.Height / 2))
   116    116   
   117    117           # fonts
   118    118           xFDTitle = uno.createUnoStruct("com.sun.star.awt.FontDescriptor")
   119    119           xFDTitle.Height = 9
................................................................................
   130    130           nY1 = 5
   131    131           nY2 = nY1 + 225
   132    132   
   133    133           nWidth = self.xDialog.Width - 20
   134    134           nHeight = 10
   135    135   
   136    136           # List
   137         -        self._addWidget("list_section", 'FixedLine', nX, nY1, nWidth, nHeight, Label = self.dUI.get("list_section", "#err"), FontDescriptor = xFDTitle)
   138         -        self._addWidget('count_button', 'Button', nX, nY1+12, 70, 11, Label = self.dUI.get('count_button', "#err"))
   139         -        self._addWidget('count2_button', 'Button', nX+75, nY1+12, 70, 11, Label = self.dUI.get('count2_button', "#err"))
   140         -        self._addWidget('unknown_button', 'Button', nX+150, nY1+12, 70, 11, Label = self.dUI.get('unknown_button', "#err"))
          137  +        self._addWidget("list_section", 'FixedLine', nX, nY1, nWidth, nHeight, Label = ui.get("list_section"), FontDescriptor = xFDTitle)
          138  +        self._addWidget('count_button', 'Button', nX, nY1+12, 70, 11, Label = ui.get('count_button'))
          139  +        self._addWidget('count2_button', 'Button', nX+75, nY1+12, 70, 11, Label = ui.get('count2_button'))
          140  +        self._addWidget('unknown_button', 'Button', nX+150, nY1+12, 70, 11, Label = ui.get('unknown_button'))
   141    141           self.xGridModel = self._addGrid("list_grid", nX, nY1+25, nWidth, 181, \
   142         -            [ {"Title": self.dUI.get("words", "#err"), "ColumnWidth": 175}, {"Title": "Occurrences", "ColumnWidth": 45} ], \
          142  +            [ {"Title": ui.get("words"), "ColumnWidth": 175}, {"Title": "Occurrences", "ColumnWidth": 45} ], \
   143    143               SelectionModel = uno.Enum("com.sun.star.view.SelectionType", "MULTI") \
   144    144           )
   145         -        self._addWidget('num_of_entries', 'FixedText', nX, nY1+210, 30, nHeight, Label = self.dUI.get('num_of_entries', "#err"), Align = 2)
          145  +        self._addWidget('num_of_entries', 'FixedText', nX, nY1+210, 30, nHeight, Label = ui.get('num_of_entries'), Align = 2)
   146    146           self.xNumWord = self._addWidget('num_of_entries_res', 'FixedText', nX+35, nY1+210, 25, nHeight, Label = "—")
   147         -        self._addWidget('tot_of_entries', 'FixedText', nX+60, nY1+210, 30, nHeight, Label = self.dUI.get('tot_of_entries', "#err"), Align = 2)
          147  +        self._addWidget('tot_of_entries', 'FixedText', nX+60, nY1+210, 30, nHeight, Label = ui.get('tot_of_entries'), Align = 2)
   148    148           self.xTotWord = self._addWidget('tot_of_entries_res', 'FixedText', nX+95, nY1+210, 30, nHeight, Label = "—")
   149         -        self.xSearch = self._addWidget('search_button', 'Button', nX+145, nY1+210, 30, nHeight, Label = ">>>", HelpText=self.dUI.get('goto', "#err"), Enabled = False)
   150         -        self.xExport = self._addWidget('export_button', 'Button', nX+180, nY1+210, 40, nHeight, Label = self.dUI.get('export', "#err"), Enabled = False)
          149  +        self.xSearch = self._addWidget('search_button', 'Button', nX+145, nY1+210, 30, nHeight, Label = ">>>", HelpText=ui.get('goto'), Enabled = False)
          150  +        self.xExport = self._addWidget('export_button', 'Button', nX+180, nY1+210, 40, nHeight, Label = ui.get('export'), Enabled = False)
   151    151   
   152    152           # Tag
   153    153           # Note: the only way to group RadioButtons is to create them successively
   154         -        self._addWidget("charstyle_section", 'FixedLine', nX, nY2, 200, nHeight, Label = self.dUI.get("charstyle_section", "#err"), FontDescriptor = xFDTitle)
   155         -        self.xAccent = self._addWidget('emphasis', 'RadioButton', nX, nY2+12, 55, nHeight, Label = self.dUI.get('emphasis', "#err"))
   156         -        self.xStrongAccent = self._addWidget('strong_emphasis', 'RadioButton', nX+60, nY2+12, 70, nHeight, Label = self.dUI.get('strong_emphasis', "#err"))
   157         -        self.xNoAccent = self._addWidget('nostyle', 'RadioButton', nX+140, nY2+12, 45, nHeight, Label = self.dUI.get('nostyle', "#err"))
          154  +        self._addWidget("charstyle_section", 'FixedLine', nX, nY2, 200, nHeight, Label = ui.get("charstyle_section"), FontDescriptor = xFDTitle)
          155  +        self.xAccent = self._addWidget('emphasis', 'RadioButton', nX, nY2+12, 55, nHeight, Label = ui.get('emphasis'))
          156  +        self.xStrongAccent = self._addWidget('strong_emphasis', 'RadioButton', nX+60, nY2+12, 70, nHeight, Label = ui.get('strong_emphasis'))
          157  +        self.xNoAccent = self._addWidget('nostyle', 'RadioButton', nX+140, nY2+12, 45, nHeight, Label = ui.get('nostyle'))
   158    158   
   159         -        self.xTag = self._addWidget('tag_button', 'Button', self.xDialog.Width-40, nY2+10, 30, 11, Label = self.dUI.get('tag_button', "#err"), FontDescriptor = xFDTitle, TextColor = 0x005500, Enabled=False)
          159  +        self.xTag = self._addWidget('tag_button', 'Button', self.xDialog.Width-40, nY2+10, 30, 11, Label = ui.get('tag_button'), FontDescriptor = xFDTitle, TextColor = 0x005500, Enabled=False)
   160    160   
   161    161           # Progress bar
   162    162           self.xProgressBar = self._addWidget('progress_bar', 'ProgressBar', nX, self.xDialog.Height-25, 160, 14)
   163    163           self.xProgressBar.ProgressValueMin = 0
   164    164           self.xProgressBar.ProgressValueMax = 1 # to calculate later
   165    165   
   166    166           # Close
   167         -        self._addWidget('close_button', 'Button', self.xDialog.Width-60, self.xDialog.Height-25, 50, 14, Label = self.dUI.get('close_button', "#err"), FontDescriptor = xFDTitle, TextColor = 0x550000)
          167  +        self._addWidget('close_button', 'Button', self.xDialog.Width-60, self.xDialog.Height-25, 50, 14, Label = ui.get('close_button'), FontDescriptor = xFDTitle, TextColor = 0x550000)
   168    168   
   169    169           # container
   170    170           self.xContainer = self.xSvMgr.createInstanceWithContext('com.sun.star.awt.UnoControlDialog', self.ctx)
   171    171           self.xContainer.setModel(self.xDialog)
   172    172           self.xGridControl = self.xContainer.getControl('list_grid')
   173    173           self.xContainer.getControl('count_button').addActionListener(self)
   174    174           self.xContainer.getControl('count_button').setActionCommand('Count')
................................................................................
   190    190           self.xContainer.createPeer(xToolkit, None)
   191    191           #self.xContainer.execute()          # Don’t excute for non modal dialog
   192    192   
   193    193       # XActionListener
   194    194       def actionPerformed (self, xActionEvent):
   195    195           try:
   196    196               if xActionEvent.ActionCommand == "Count":
   197         -                self.count(self.dUI.get("words", "#err"))
          197  +                self.count(ui.get("words"))
   198    198                   self.xTag.Enabled = True
   199    199                   self.xSearch.Enabled = True
   200    200                   self.xExport.Enabled = True
   201    201               elif xActionEvent.ActionCommand == "CountByLemma":
   202         -                self.count(self.dUI.get("lemmas", "#err"), bByLemma=True)
          202  +                self.count(ui.get("lemmas"), bByLemma=True)
   203    203                   self.xTag.Enabled = False
   204    204                   self.xSearch.Enabled = False
   205    205                   self.xExport.Enabled = True
   206    206               elif xActionEvent.ActionCommand == "UnknownWords":
   207         -                self.count(self.dUI.get("unknown_words", "#err"), bOnlyUnknownWords=True)
          207  +                self.count(ui.get("unknown_words"), bOnlyUnknownWords=True)
   208    208                   self.xTag.Enabled = True
   209    209                   self.xSearch.Enabled = True
   210    210                   self.xExport.Enabled = True
   211    211               elif xActionEvent.ActionCommand == "Search":
   212    212                   if not self.xGridControl.hasSelectedRows():
   213    213                       return
   214    214                   lRow = self.xGridControl.getSelectedRows()
................................................................................
   344    344                   if platform.system() != "Windows":
   345    345                       spfExported = "/" + spfExported
   346    346                   #spfExported = os.path.join(os.path.expanduser("~"), "fr.personal.json")
   347    347                   with open(spfExported, "w", encoding="utf-8") as hDst:
   348    348                       hDst.write(sText)
   349    349           except:
   350    350               sMessage = traceback.format_exc()
   351         -            MessageBox(self.xDocument, sMessage, self.dUI.get('export_title', "#err"), ERRORBOX)
          351  +            MessageBox(self.xDocument, sMessage, ui.get('export_title'), ERRORBOX)
   352    352   
   353    353       @_waitPointer
   354    354       def tagText (self, aWord, sAction=""):
   355    355           if not sAction:
   356    356               return
   357    357           self.xProgressBar.ProgressValueMax = self._countParagraph()
   358    358           self.xProgressBar.ProgressValue = 0

Modified gc_lang/fr/oxt/Lexicographer/enum_strings.py from [566a315685] to [2ba14d763e].

     1         -def getUI (sLang):
            1  +# strings for Enumerator
            2  +
            3  +sUI = "fr"
            4  +
            5  +
            6  +def selectLang (sLang):
            7  +    global sUI
     2      8       if sLang in dStrings:
     3         -        return dStrings[sLang]
     4         -    return dStrings["fr"]
            9  +        sUI = sLang
           10  +
           11  +
           12  +def get (sMsgCode):
           13  +    try:
           14  +        return dStrings[sUI].get(sMsgCode, sMsgCode)
           15  +    except:
           16  +        return "#error"
           17  +
     5     18   
     6     19   dStrings = {
     7     20       "fr": {
     8     21           "title": "Grammalecte · Recenseur de mots",
     9     22   
    10     23           "list_section": "Énumération des occurrences",
    11     24           "count_button": "Compter tout",

Modified gc_lang/fr/rules.grx from [28c18e3796] to [4effd688cb].

 21257  21257           <<- /conf/ -3>> fonds                   && Confusion : fonds (ce qui constitue une richesse) ≠ fond (partie la plus basse/profonde).
 21258  21258   
 21259  21259       à [fond|fonts] [perdu+ses]
 21260  21260           <<- /conf/ ->> à fonds perdus           && Confusion : fonds (ce qui constitue une richesse) ≠ fond (partie la plus basse/profonde).
 21261  21261   
 21262  21262       [fond|fonts] [>monétaire|spéculatif+s|>international|souverain+s]
 21263  21263       [fond|fonts] [de|d’] [commerce|garantie|roulement|pension|placement|retraite|roulement|solidarité]
 21264         -    [fond|fonts] d’ [aide|investissement|indemnisation]
        21264  +    [fond|fonts] d’ [aide|investissement|indemnisation|urgence]
 21265  21265           <<- /conf/ -1>> fonds                   && Confusion : fonds (ce qui constitue une richesse) ≠ fond (partie la plus basse/profonde).
 21266  21266   
 21267  21267       fonds baptismaux
 21268  21268           <<- /conf/ -1>> fonts                   && Confusion. Écrivez “fonts”, qui vient du mot latin ‹fons› et signifie « fontaine, source ».
 21269  21269   
 21270  21270       [un|le|du|ce] [fonds|fonts] [de|d’] ?[la|l’]¿ [assiette|bouteille|cuve|casserolle|marmite|poêle]
 21271  21271       [un|le|du|ce] [fonds|fonts] du [seau|tupperware|wok]