Grammalecte  Changes On Branch 97d7e3a4f3c90b26

Changes In Branch tbso Through [97d7e3a4f3] Excluding Merge-Ins

This is equivalent to a diff from d740296469 to 97d7e3a4f3

2020-01-22
18:38
[fr] ajustements check-in: 6a609d9bae user: olr tags: fr, trunk
2020-01-20
23:35
[tb] text formatter: progressbar Closed-Leaf check-in: ee415784e6 user: olr tags: tb, tbso
12:20
[tb] dictionaries: spelling option check-in: 97d7e3a4f3 user: olr tags: tb, tbso
10:16
merge trunk check-in: afed5163f0 user: olr tags: tbso
10:09
[fr] faux positif et ajustements check-in: d740296469 user: olr tags: fr, trunk
09:19
[fr] ajustements check-in: ba470a877e user: olr tags: fr, trunk

Modified gc_core/py/oxt/helpers.py from [c3e413f4e7] to [730b24becd].

17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
        xContext.ServiceManager.createInstance("apso.python.script.organizer.impl")
        # now we can import apso_utils library
        from apso_utils import console
        console()
    except:
        try:
            xContext = uno.getComponentContext()
            xSvMgr = xContext.getServiceManager()
            xPathSettings = xSvMgr.createInstanceWithContext("com.sun.star.util.PathSettings", xContext)
            spPyInstallion = uno.fileUrlToSystemPath(xPathSettings.Module)
            subprocess.Popen(spPyInstallion + os.sep + "python")  # Start Python interactive Shell
        except:
            traceback.print_exc()


def xray (xObject):







<
|







17
18
19
20
21
22
23

24
25
26
27
28
29
30
31
        xContext.ServiceManager.createInstance("apso.python.script.organizer.impl")
        # now we can import apso_utils library
        from apso_utils import console
        console()
    except:
        try:
            xContext = uno.getComponentContext()

            xPathSettings = xContext.ServiceManager.createInstanceWithContext("com.sun.star.util.PathSettings", xContext)
            spPyInstallion = uno.fileUrlToSystemPath(xPathSettings.Module)
            subprocess.Popen(spPyInstallion + os.sep + "python")  # Start Python interactive Shell
        except:
            traceback.print_exc()


def xray (xObject):

Modified gc_lang/fr/mailext/content/overlay.js from [3152c4204d] to [fc3e43bc6f].

40
41
42
43
44
45
46








47
48
49
50
51
52
53
            this.xGCEWorker = new BasePromiseWorker('chrome://promiseworker/content/gce_worker.js');
            let that = this;
            let xPromise = this.xGCEWorker.post('loadGrammarChecker', [prefs.getCharPref("sGCOptions"), "Thunderbird"]);
            xPromise.then(
                function (aVal) {
                    console.log(aVal);
                    prefs.setCharPref("sGCOptions", aVal);








                    if (prefs.getBoolPref("bPersonalDictionary")) {
                        let sDicJSON = oFileHandler.loadFile("fr.personal.json");
                        if (sDicJSON) {
                            that.xGCEWorker.post('setDictionary', ["personal", sDicJSON]);
                        }
                    }
                },







>
>
>
>
>
>
>
>







40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
            this.xGCEWorker = new BasePromiseWorker('chrome://promiseworker/content/gce_worker.js');
            let that = this;
            let xPromise = this.xGCEWorker.post('loadGrammarChecker', [prefs.getCharPref("sGCOptions"), "Thunderbird"]);
            xPromise.then(
                function (aVal) {
                    console.log(aVal);
                    prefs.setCharPref("sGCOptions", aVal);
                    // spelling dictionary
                    if (prefs.getCharPref("sMainDicName")) {
                        let sMainDicName = prefs.getCharPref("sMainDicName");
                        if (sMainDicName == "fr-classic.json" || sMainDicName == "fr-reform.json") {
                            that.xGCEWorker.post("setDictionary", ["main", sMainDicName]);
                        }
                    }
                    // personal dictionary
                    if (prefs.getBoolPref("bPersonalDictionary")) {
                        let sDicJSON = oFileHandler.loadFile("fr.personal.json");
                        if (sDicJSON) {
                            that.xGCEWorker.post('setDictionary', ["personal", sDicJSON]);
                        }
                    }
                },

Modified gc_lang/fr/mailext/content/spell_options.css from [e88f1b0c74] to [377d800f5a].

1
2
3
4
5
6
7
8
9
10
11
12










13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/* CSS */

#grouptitle {
	font-size: 16px;
	font-weight: bold;
	color: hsl(0, 50%, 50%);
}

.option {
	font-size: 16px;
	font-weight: bold;
	color: hsl(210, 50%, 50%);










}

description {
	width: 340px;
}

.dicdescr {
	margin-left: 27px;
}

.disabled {
  opacity: .25;
}


.dialogheader-title {
  margin: 5px;
  padding: 5px 8px;
  border: 1px solid hsl(210, 50%, 80%);
  background-color: hsl(210, 50%, 50%);
  color: hsl(210, 10%, 90%);
  font-size: larger;
  font-weight: bold;
}



|
|
|



|
|
|
>
>
>
>
>
>
>
>
>
>



|



|



|




|
|
|
|
|
|
|

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/* CSS */

#grouptitle {
    font-size: 16px;
    font-weight: bold;
    color: hsl(0, 50%, 50%);
}

.option {
    font-size: 16px;
    font-weight: bold;
    color: hsl(210, 50%, 50%);
}

.suboption {
    margin-left: 30px;
    font-size: 16px;
    font-weight: bold;
    color: hsl(210, 50%, 50%);
}
.suboption2 {
    margin-left: 30px;
}

description {
    width: 340px;
}

.dicdescr {
      margin-left: 27px;
}

.disabled {
    opacity: .25;
}


.dialogheader-title {
    margin: 5px;
    padding: 5px 8px;
    border: 1px solid hsl(210, 50%, 80%);
    background-color: hsl(210, 50%, 50%);
    color: hsl(210, 10%, 90%);
    font-size: larger;
    font-weight: bold;
}

Modified gc_lang/fr/mailext/content/spell_options.js from [2d7adbf6a9] to [d5cdd1e710].

10
11
12
13
14
15
16












17
18

19
20
21
22
23
24
25
26
27
28









29





30
31
32
33
34














35
36
37
38


var oDialogControl = {
    load: function () {
        try {
            // center window
            document.getElementById('grammalecte-spelloptions-window').centerWindowOnScreen();












            // Graphspell dictionaries
            document.getElementById('personal_dic').checked = prefs.getBoolPref('bPersonalDictionary');

            this.listen();
        }
        catch (e) {
            console.error(e);
        }
    },
    listen: function () {
        document.addEventListener("dialogaccept", (event) => {
            oDialogControl.setDictionaries();
        });









    },





    setDictionaries: function () {
        oSpellControl.init();
        this._setGraphspellDictionaries();
    },
    _setGraphspellDictionaries: function () {














        let bActivate = document.getElementById('personal_dic').checked;
        prefs.setBoolPref("bPersonalDictionary", bActivate);
    }
};







>
>
>
>
>
>
>
>
>
>
>
>
|

>










>
>
>
>
>
>
>
>
>

>
>
>
>
>

|
<
<
<
>
>
>
>
>
>
>
>
>
>
>
>
>
>




10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58



59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76


var oDialogControl = {
    load: function () {
        try {
            // center window
            document.getElementById('grammalecte-spelloptions-window').centerWindowOnScreen();
            // main spelling dictionary
            let sMainDicName = prefs.getCharPref('sMainDicName');
            console.log("spelling dictionary:", sMainDicName);
            if (sMainDicName == "fr-classic.json") {
                document.getElementById("classic").checked = true;
            }
            else if (sMainDicName == "fr-reform.json") {
                document.getElementById("reform").checked = true;
            }
            else if (sMainDicName == "fr-allvars.json") {
                document.getElementById("allvars").checked = true;
            }
            // personal dictionary
            document.getElementById('personal_dic').checked = prefs.getBoolPref('bPersonalDictionary');
            // listen
            this.listen();
        }
        catch (e) {
            console.error(e);
        }
    },
    listen: function () {
        document.addEventListener("dialogaccept", (event) => {
            oDialogControl.setDictionaries();
        });
        document.getElementById("classic").addEventListener("click", (event) => {
            oDialogControl.changeMainDicUI("classic");
        });
        document.getElementById("reform").addEventListener("click", (event) => {
            oDialogControl.changeMainDicUI("reform");
        });
        document.getElementById("allvars").addEventListener("click", (event) => {
            oDialogControl.changeMainDicUI("allvars");
        });
    },
    changeMainDicUI (sDic) {
        document.getElementById("classic").checked = ("classic" === sDic);
        document.getElementById("reform").checked = ("reform" === sDic);
        document.getElementById("allvars").checked = ("allvars" === sDic);
    },
    setDictionaries: function () {
        //oSpellControl.init();



        // main spelling dictionary
        let sMainDicName = "";
        if (document.getElementById("classic").checked) {
            sMainDicName = "fr-classic.json";
        }
        else if (document.getElementById("reform").checked) {
            sMainDicName = "fr-reform.json";
        }
        else if (document.getElementById("allvars").checked) {
            sMainDicName = "fr-allvars.json";
        }
        console.log("selected spelling dictionary:", sMainDicName);
        prefs.setCharPref("sMainDicName", sMainDicName);
        // personal dictionary
        let bActivate = document.getElementById('personal_dic').checked;
        prefs.setBoolPref("bPersonalDictionary", bActivate);
    }
};

Modified gc_lang/fr/mailext/content/spell_options.xul from [218f35c9f4] to [abb535b915].

6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
..
37
38
39
40
41
42
43











44
45
46
47
48
49
50
51
52
53
54
55
56

<dialog
  id="grammalecte-spelloptions-window"
  title="&window.title;"
  orient="vertical"
  buttons="accept,cancel"
  width="400"
  height="300"
  onload="oDialogControl.load();"
  xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">

  <!-- Other elements go here -->

  <div class="dialogheader-title">&dialogheader.label;</div>

................................................................................

    <groupbox with="380">
      <caption id="grouptitle" label="&grouptitle_graphspell;" />
      <description id="warning">&warning_graphspell;</description>

      <checkbox id="main_dic" class="option" label="&option.main_dic.label;" disabled="true" checked="true" />
      <description class="dicdescr">&option.main_dic.descr;</description>












      <checkbox id="community_dic" class="option disabled" label="&option.community_dic.label;" disabled="true" />
      <description class="dicdescr disabled">&option.community_dic.descr;</description>

      <checkbox id="personal_dic" class="option" label="&option.personal_dic.label;" />
      <description class="dicdescr">&option.personal_dic.descr;</description>
    </groupbox>
  </hbox>

  <script type="application/javascript" src="spell_options.js"/>
  <script type="application/javascript" src="spellchecker.js"/>

</dialog>







|







 







>
>
>
>
>
>
>
>
>
>
>













6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
..
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67

<dialog
  id="grammalecte-spelloptions-window"
  title="&window.title;"
  orient="vertical"
  buttons="accept,cancel"
  width="400"
  height="330"
  onload="oDialogControl.load();"
  xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">

  <!-- Other elements go here -->

  <div class="dialogheader-title">&dialogheader.label;</div>

................................................................................

    <groupbox with="380">
      <caption id="grouptitle" label="&grouptitle_graphspell;" />
      <description id="warning">&warning_graphspell;</description>

      <checkbox id="main_dic" class="option" label="&option.main_dic.label;" disabled="true" checked="true" />
      <description class="dicdescr">&option.main_dic.descr;</description>
      <label class="suboption" value="&option.main_dic.spelling;" />
      <hbox class="suboption2" >
        <checkbox id="classic" label="&option.main_dic.classic;" checked="false" />
        <checkbox id="reform" label="&option.main_dic.reform;" checked="false" />
        <checkbox id="allvars" label="&option.main_dic.allvars;" checked="false" />
      </hbox>
      <!--<radiogroup id="main_dic_name" class="suboption2" orient="horizontal">
        <radio id="classic" label="&option.main_dic.classic;" value="fr-classic.json" />
        <radio id="reform" label="&option.main_dic.reform;" value="fr-reform.json" />
        <radio id="allvars" label="&option.main_dic.allvars;" value="fr-allvars.json" />
      </radiogroup>-->

      <checkbox id="community_dic" class="option disabled" label="&option.community_dic.label;" disabled="true" />
      <description class="dicdescr disabled">&option.community_dic.descr;</description>

      <checkbox id="personal_dic" class="option" label="&option.personal_dic.label;" />
      <description class="dicdescr">&option.personal_dic.descr;</description>
    </groupbox>
  </hbox>

  <script type="application/javascript" src="spell_options.js"/>
  <script type="application/javascript" src="spellchecker.js"/>

</dialog>

Modified gc_lang/fr/mailext/defaults/preferences/grammarchecker.js from [1b1284d83a] to [8769787af8].

1
2
3
4
5
6
7
8
9
10
pref("extensions.grammarchecker.sGCOptions", "");
pref("extensions.grammarchecker.sTFOptions", "");
pref("extensions.grammarchecker.bDictModern", false);
pref("extensions.grammarchecker.bDictClassic", true);
pref("extensions.grammarchecker.bDictReform", false);
pref("extensions.grammarchecker.bDictClassicReform", false);
pref("extensions.grammarchecker.bCheckSignature", true);
pref("extensions.grammarchecker.bExtendedDictionary", false);
pref("extensions.grammarchecker.bCommunityDictionary", false);
pref("extensions.grammarchecker.bPersonalDictionary", true);







|


1
2
3
4
5
6
7
8
9
10
pref("extensions.grammarchecker.sGCOptions", "");
pref("extensions.grammarchecker.sTFOptions", "");
pref("extensions.grammarchecker.bDictModern", false);
pref("extensions.grammarchecker.bDictClassic", true);
pref("extensions.grammarchecker.bDictReform", false);
pref("extensions.grammarchecker.bDictClassicReform", false);
pref("extensions.grammarchecker.bCheckSignature", true);
pref("extensions.grammarchecker.sMainDicName", "fr-allvars.json");
pref("extensions.grammarchecker.bCommunityDictionary", false);
pref("extensions.grammarchecker.bPersonalDictionary", true);

Modified gc_lang/fr/mailext/gce_worker.js from [75d21bf0e4] to [3191c72f90].

351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
    if (!oSpellChecker) {
        postMessage(createResponse("setDictionary", "# Error. SpellChecker not loaded.", dInfo, true));
        return;
    }
    //console.log("setDictionary", sDictionary);
    switch (sDictionary) {
        case "main":
            oSpellChecker.setMainDictionary(oDict);
            break;
        case "community":
            oSpellChecker.setCommunityDictionary(oDict);
            break;
        case "personal":
            oSpellChecker.setPersonalDictionary(oDict);
            break;







|







351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
    if (!oSpellChecker) {
        postMessage(createResponse("setDictionary", "# Error. SpellChecker not loaded.", dInfo, true));
        return;
    }
    //console.log("setDictionary", sDictionary);
    switch (sDictionary) {
        case "main":
            oSpellChecker.setMainDictionary(oDict, dInfo["sExtPath"]+"/grammalecte/graphspell/_dictionaries");
            break;
        case "community":
            oSpellChecker.setCommunityDictionary(oDict);
            break;
        case "personal":
            oSpellChecker.setPersonalDictionary(oDict);
            break;

Modified gc_lang/fr/mailext/locale/en/spell_options.dtd from [d953b5f96a] to [fc8174b93b].

1
2
3
4
5
6
7




8
9
10
11
12
13
14
<!ENTITY window.title "Grammalecte · Spelling options">
<!ENTITY dialogheader.label "Spelling options">

<!ENTITY grouptitle_graphspell "Graphspell Dictionaries (Grammalecte)">
<!ENTITY warning_graphspell "These dictionaries are used only when analyzing texts.">
<!ENTITY option.main_dic.label "Main dictionary">
<!ENTITY option.main_dic.descr "About 83 000 entries, 500 000 flexions. Not editable, not deactivable.">




<!ENTITY option.community_dic.label "Community dictionary">
<!ENTITY option.community_dic.descr "Feature to come..">
<!ENTITY option.personal_dic.label "Personal dictionary">
<!ENTITY option.personal_dic.descr "The personal dictionary is created and edited via the lexicon editor.">

<!ENTITY grouptitle_hunspell "Hunspell Dictionaries (Thunderbird)">
<!ENTITY warning_hunspell "These dictionaries are only used when you are writing texts (red underlining). Select dictionaries you want to see in textareas list. Selected dictionaries are added instantly. Whereas unselected dictionnaries will be removed only at Thunderbird’s restart.">







>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<!ENTITY window.title "Grammalecte · Spelling options">
<!ENTITY dialogheader.label "Spelling options">

<!ENTITY grouptitle_graphspell "Graphspell Dictionaries (Grammalecte)">
<!ENTITY warning_graphspell "These dictionaries are used only when analyzing texts.">
<!ENTITY option.main_dic.label "Main dictionary">
<!ENTITY option.main_dic.descr "About 83 000 entries, 500 000 flexions. Not editable, not deactivable.">
<!ENTITY option.main_dic.spelling "Spelling">
<!ENTITY option.main_dic.classic "Classic">
<!ENTITY option.main_dic.reform "Reform 1990">
<!ENTITY option.main_dic.allvars "All variants">
<!ENTITY option.community_dic.label "Community dictionary">
<!ENTITY option.community_dic.descr "Feature to come..">
<!ENTITY option.personal_dic.label "Personal dictionary">
<!ENTITY option.personal_dic.descr "The personal dictionary is created and edited via the lexicon editor.">

<!ENTITY grouptitle_hunspell "Hunspell Dictionaries (Thunderbird)">
<!ENTITY warning_hunspell "These dictionaries are only used when you are writing texts (red underlining). Select dictionaries you want to see in textareas list. Selected dictionaries are added instantly. Whereas unselected dictionnaries will be removed only at Thunderbird’s restart.">

Modified gc_lang/fr/mailext/locale/fr/spell_options.dtd from [f2b4df7a35] to [5ab4900b2b].

1
2
3
4
5
6
7




8
9
10
11
12
13
14
<!ENTITY window.title "Grammalecte · Options orthographiques">
<!ENTITY dialogheader.label "Options orthographiques">

<!ENTITY grouptitle_graphspell "Dictionnaires de Grammalecte">
<!ENTITY warning_graphspell "Ces dictionnaires ne sont utilisés que lors de l’analyse grammaticale.">
<!ENTITY option.main_dic.label "Dictionnaire principal">
<!ENTITY option.main_dic.descr "Environ 83 000 entrées, 500 000 flexions. Ni éditable, ni désactivable.">




<!ENTITY option.community_dic.label "Dictionnaire communautaire">
<!ENTITY option.community_dic.descr "Fonctionnalité à venir.">
<!ENTITY option.personal_dic.label "Dictionnaire personnel">
<!ENTITY option.personal_dic.descr "Le dictionnaire personnel est créé et édité via l’éditeur lexical.">

<!ENTITY grouptitle_hunspell "Dictionnaires Hunspell (Thunderbird)">
<!ENTITY warning_hunspell "Ces dictionnaires ne sont utilisés que lors de l’écriture de texte (soulignement rouge). Cochez les dictionnaires que vous voulez voir apparaître dans la liste des dictionnaires utilisables. L’ajout des dictionnaires se fait instantanément. En revanche, les dictionnaires ôtés ne disparaîtront qu’au redémarrage de Thunderbird.">







>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<!ENTITY window.title "Grammalecte · Options orthographiques">
<!ENTITY dialogheader.label "Options orthographiques">

<!ENTITY grouptitle_graphspell "Dictionnaires de Grammalecte">
<!ENTITY warning_graphspell "Ces dictionnaires ne sont utilisés que lors de l’analyse grammaticale.">
<!ENTITY option.main_dic.label "Dictionnaire principal">
<!ENTITY option.main_dic.descr "Environ 83 000 entrées, 500 000 flexions. Ni éditable, ni désactivable.">
<!ENTITY option.main_dic.spelling "Orthographe">
<!ENTITY option.main_dic.classic "Classique">
<!ENTITY option.main_dic.reform "Réforme 1990">
<!ENTITY option.main_dic.allvars "Toutes variantes">
<!ENTITY option.community_dic.label "Dictionnaire communautaire">
<!ENTITY option.community_dic.descr "Fonctionnalité à venir.">
<!ENTITY option.personal_dic.label "Dictionnaire personnel">
<!ENTITY option.personal_dic.descr "Le dictionnaire personnel est créé et édité via l’éditeur lexical.">

<!ENTITY grouptitle_hunspell "Dictionnaires Hunspell (Thunderbird)">
<!ENTITY warning_hunspell "Ces dictionnaires ne sont utilisés que lors de l’écriture de texte (soulignement rouge). Cochez les dictionnaires que vous voulez voir apparaître dans la liste des dictionnaires utilisables. L’ajout des dictionnaires se fait instantanément. En revanche, les dictionnaires ôtés ne disparaîtront qu’au redémarrage de Thunderbird.">

Modified gc_lang/fr/mailext/worker/gce_worker.js from [086c0afb9f] to [abd0c9c4ba].

73
74
75
76
77
78
79
80
81
82
83
84
85

86
87
88
89

90
91
92
93
94
95
96
        }
        catch (e) {
            console.log("# Error: " + e.fileName + "\n" + e.name + "\nline: " + e.lineNumber + "\n" + e.message);
        }
    }
}

function setDictionary (sTypeDic, sDicJSON) {
    try {
        console.log("set dictionary: " + sTypeDic);
        let oJSON = JSON.parse(sDicJSON);
        switch (sTypeDic) {
            case "extended":

                break;
            case "community":
                break;
            case "personal":

                oSpellChecker.setPersonalDictionary(oJSON);
                break;
            default:
                console.log("[GCE worker] unknown dictionary type");
        }
    }
    catch (e) {







|


<

|
>




>







73
74
75
76
77
78
79
80
81
82

83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
        }
        catch (e) {
            console.log("# Error: " + e.fileName + "\n" + e.name + "\nline: " + e.lineNumber + "\n" + e.message);
        }
    }
}

function setDictionary (sTypeDic, sDictionary) {
    try {
        console.log("set dictionary: " + sTypeDic);

        switch (sTypeDic) {
            case "main":
                oSpellChecker.setMainDictionary(sDictionary);
                break;
            case "community":
                break;
            case "personal":
                let oJSON = JSON.parse(sDictionary);
                oSpellChecker.setPersonalDictionary(oJSON);
                break;
            default:
                console.log("[GCE worker] unknown dictionary type");
        }
    }
    catch (e) {