Index: gc_lang/fr/modules-js/textformatter.js ================================================================== --- gc_lang/fr/modules-js/textformatter.js +++ gc_lang/fr/modules-js/textformatter.js @@ -55,10 +55,11 @@ [/«[  ]+/g, "« "], [/([a-zA-Zà-ö0-9À-Öø-ÿØ-ßĀ-ʯ.!?])»/g, "$1 »"], [/[  ]+»/g, " »"] ], "nnbsp_within_numbers": [ [/(\d)[  ](\d)/g, "$1 $2"] ], // common + "nbsp_titles": [ [/\bM(mes?|ᵐᵉˢ?|grs?|ᵍʳˢ?|lles?|ˡˡᵉˢ?|rs?|ʳˢ?|M[.]) /g, "M$1 "] ], "nbsp_before_symbol": [ [/(\d) ?([%‰€$£¥˚Ω℃])/g, "$1 $2"] ], "nbsp_before_units": [ [/([0-9⁰¹²³⁴⁵⁶⁷⁸⁹]) ?([kcmµn]?(?:[slgJKΩ]|m[²³]?|Wh?|Hz|dB)|[%‰]|°C)\b/g, "$1 $2"] ], "nbsp_repair": [ [/([\[(])[   ]([!?:;])/g, "$1$2"], [/(https?|ftp)[   ]:\/\//g, "$1://"], [/&([a-z]+)[   ];/g, "&$1;"], @@ -213,10 +214,11 @@ ["nbsp_within_quotation_marks", true], ["nbsp_within_numbers", true], ["nnbsp_before_punctuation", false], ["nnbsp_within_quotation_marks", false], ["nnbsp_within_numbers", false], + ["nbsp_titles", false], ["nbsp_before_symbol", true], ["nbsp_before_units", true], ["nbsp_repair", true], ["add_space_after_punctuation", true], ["add_space_around_hyphens", true], Index: gc_lang/fr/modules/textformatter.py ================================================================== --- gc_lang/fr/modules/textformatter.py +++ gc_lang/fr/modules/textformatter.py @@ -37,10 +37,11 @@ ("«[  ]+", "« "), ("(?<=[\\w.!?])»", " »"), ("[  ]+»", " »")], "nnbsp_within_numbers": [("(\\d)[  ](\\d)", "\\1 \\2")], # common + "nbsp_titles": [("M(mes?|ᵐᵉˢ?|grs?|ᵍʳˢ?|lles?|ˡˡᵉˢ?|rs?|ʳˢ?|M\\.) ", "M\\1 ")], "nbsp_before_symbol": [("(\\d) ?([%‰€$£¥˚Ω℃])", "\\1 \\2")], "nbsp_before_units": [("(?<=[0-9⁰¹²³⁴⁵⁶⁷⁸⁹]) ?([kcmµn]?(?:[slgJKΩ]|m[²³]?|Wh?|Hz|dB)|[%‰]|°C)\\b", " \\1")], "nbsp_repair": [("(?<=[[(])[   ]([!?:;])", "\\1"), ("(https?|ftp)[   ]:(?=//)", "\\1:"), ("&([a-z]+)[   ];", "&\\1;"), @@ -194,10 +195,11 @@ ("nbsp_within_quotation_marks", True), ("nbsp_within_numbers", True), ("nnbsp_before_punctuation", False), ("nnbsp_within_quotation_marks", False), ("nnbsp_within_numbers", False), + ("nbsp_titles", False), ("nbsp_before_symbol", True), ("nbsp_before_units", True), ("nbsp_repair", True), ("add_space_after_punctuation", True), ("add_space_around_hyphens", True), Index: gc_lang/fr/oxt/TextFormatter/TextFormatter.py ================================================================== --- gc_lang/fr/oxt/TextFormatter/TextFormatter.py +++ gc_lang/fr/oxt/TextFormatter/TextFormatter.py @@ -124,29 +124,31 @@ self.space1_res = self._addWidget('space1_res', 'FixedText', nPosRes, y+15, 20, nHeight, Label = "", Align = 2) self.space2_res = self._addWidget('space2_res', 'FixedText', nPosRes, y+25, 20, nHeight, Label = "", Align = 2) # group box // non-breaking spaces x = 10; y = 145 - gbm3 = self._addWidget('groupbox3', 'GroupBox', x-5, y, nGroupBoxWith, 70, Label = " " * len(self.dUI.get('nbsp', "#err")), FontDescriptor = xFD1) + gbm3 = self._addWidget('groupbox3', 'GroupBox', x-5, y, nGroupBoxWith, 80, Label = " " * len(self.dUI.get('nbsp', "#err")), FontDescriptor = xFD1) self.nbsp = self._addWidget('nbsp', 'CheckBox', x, y+2, nWidth, nHeight, Label = self.dUI.get('nbsp', "#err"), FontDescriptor = xFD1, \ FontRelief = 1, TextColor = nColor, State = True) self.nbsp1 = self._addWidget('nbsp1', 'CheckBox', x, y+15, 85, nHeight, Label = self.dUI.get('nbsp1', "#err"), State = True) self.nbsp2 = self._addWidget('nbsp2', 'CheckBox', x, y+25, 85, nHeight, Label = self.dUI.get('nbsp2', "#err"), State = True) self.nbsp3 = self._addWidget('nbsp3', 'CheckBox', x, y+35, nWidth, nHeight, Label = self.dUI.get('nbsp3', "#err"), State = True) self.nbsp4 = self._addWidget('nbsp4', 'CheckBox', x, y+45, 85, nHeight, Label = self.dUI.get('nbsp4', "#err"), State = True) self.nbsp5 = self._addWidget('nbsp5', 'CheckBox', x, y+55, 85, nHeight, Label = self.dUI.get('nbsp5', "#err"), State = True) + self.nbsp6 = self._addWidget('nbsp6', 'CheckBox', x, y+65, 85, nHeight, Label = self.dUI.get('nbsp6', "#err"), State = True) self.nnbsp1 = self._addWidget('nnbsp1', 'CheckBox', x+85, y+15, 30, nHeight, Label = self.dUI.get('nnbsp', "#err"), HelpText = self.dUI.get('nnbsp_help', "#err"), State = False) self.nnbsp2 = self._addWidget('nnbsp2', 'CheckBox', x+85, y+25, 30, nHeight, Label = self.dUI.get('nnbsp', "#err"), State = False) self.nnbsp4 = self._addWidget('nnbsp4', 'CheckBox', x+85, y+45, 30, nHeight, Label = self.dUI.get('nnbsp', "#err"), State = False) self.nbsp1_res = self._addWidget('nbsp1_res', 'FixedText', nPosRes, y+15, 20, nHeight, Label = "", Align = 2) self.nbsp2_res = self._addWidget('nbsp2_res', 'FixedText', nPosRes, y+25, 20, nHeight, Label = "", Align = 2) self.nbsp3_res = self._addWidget('nbsp3_res', 'FixedText', nPosRes, y+35, 20, nHeight, Label = "", Align = 2) self.nbsp4_res = self._addWidget('nbsp4_res', 'FixedText', nPosRes, y+45, 20, nHeight, Label = "", Align = 2) self.nbsp5_res = self._addWidget('nbsp5_res', 'FixedText', nPosRes, y+55, 20, nHeight, Label = "", Align = 2) + self.nbsp6_res = self._addWidget('nbsp6_res', 'FixedText', nPosRes, y+65, 20, nHeight, Label = "", Align = 2) # group box // deletion - x = 10; y = 220 + x = 10; y = 230 gbm7 = self._addWidget('groupbox7', 'GroupBox', x-5, y, nGroupBoxWith, 50, Label = " " * len(self.dUI.get('delete', "#err")), FontDescriptor = xFD1) self.delete = self._addWidget('delete', 'CheckBox', x, y+2, nWidth, nHeight, Label = self.dUI.get('delete', "#err"), FontDescriptor = xFD1, \ FontRelief = 1, TextColor = nColor, State = True) self.delete1 = self._addWidget('delete1', 'CheckBox', x, y+15, nWidth, nHeight, Label = self.dUI.get('delete1', "#err"), State = True) self.delete2 = self._addWidget('delete2', 'CheckBox', x, y+25, nWidth, nHeight, Label = self.dUI.get('delete2', "#err"), State = True) @@ -225,20 +227,20 @@ self.struct1_res = self._addWidget('struct1_res', 'FixedText', nPosRes, y+15, 20, nHeight, Label = "", Align = 2) self.struct2_res = self._addWidget('struct2_res', 'FixedText', nPosRes, y+25, 20, nHeight, Label = "", Align = 2) self.struct3_res = self._addWidget('struct3_res', 'FixedText', nPosRes, y+35, 20, nHeight, Label = "", Align = 2) # dialog height - self.xDialog.Height = 292 + self.xDialog.Height = 302 xWindowSize = helpers.getWindowSize() self.xDialog.PositionX = int((xWindowSize.Width / 2) - (self.xDialog.Width / 2)) self.xDialog.PositionY = int((xWindowSize.Height / 2) - (self.xDialog.Height / 2)) # lists of checkbox widgets self.dCheckboxWidgets = { "ssp": [self.ssp1, self.ssp2, self.ssp3, self.ssp4, self.ssp5, self.ssp6, self.ssp7], "space": [self.space1, self.space2], - "nbsp": [self.nbsp1, self.nbsp2, self.nbsp3, self.nbsp4, self.nbsp5, self.nnbsp1, self.nnbsp2, self.nnbsp4], + "nbsp": [self.nbsp1, self.nbsp2, self.nbsp3, self.nbsp4, self.nbsp5, self.nbsp6, self.nnbsp1, self.nnbsp2, self.nnbsp4], "delete": [self.delete1, self.delete2, self.delete2a, self.delete2b, self.delete2c], "typo": [self.typo1, self.typo2, self.typo3, self.typo3a, self.typo3b, self.typo4, self.typo4a, self.typo4b, self.typo5, self.typo6, \ self.typo7, self.typo8, self.typo8a, self.typo8b, self.typo_ff, self.typo_fi, self.typo_ffi, self.typo_fl, self.typo_ffl, \ self.typo_ft, self.typo_st], "misc": [self.misc1, self.misc2, self.misc3, self.misc5, self.misc1a, self.misc5b, self.misc5c], #self.misc4, @@ -246,11 +248,11 @@ } # progress bar self.pbar = self._addWidget('pbar', 'ProgressBar', 22, self.xDialog.Height-16, 210, 10) self.pbar.ProgressValueMin = 0 - self.pbar.ProgressValueMax = 31 + self.pbar.ProgressValueMax = 32 # time counter self.time_res = self._addWidget('time_res', 'FixedText', self.xDialog.Width-80, self.xDialog.Height-15, 20, nHeight, Label = "", Align = 2) # buttons self.bdefault = self._addWidget('default', 'Button', 5, self.xDialog.Height-19, 15, 15, Label = self.dUI.get('default', "#err"), \ @@ -514,17 +516,17 @@ self.pbar.ProgressValue += 1 if self.nbsp5.State: n = self._replaceList(xElem, "nbsp5") self.nbsp5_res.Label = str(n) self.pbar.ProgressValue += 1 - if False: + if self.nbsp6.State: n = self._replaceList(xElem, "nbsp6") - self.nbsp3_res.Label = str(n) + self.nbsp6_res.Label = str(n) self.pbar.ProgressValue += 1 self.nbsp.State = False self._switchCheckBox(self.nbsp) - self.pbar.ProgressValue = 15 + self.pbar.ProgressValue = 16 # points médians if self.typo.State: if self.typo6.State: n = self._replaceList(xElem, "typo6") self.typo6_res.Label = str(n) @@ -541,11 +543,11 @@ n = self._replaceList(xElem, "space2") self.space2_res.Label = str(n) self.pbar.ProgressValue += 1 self.space.State = False self._switchCheckBox(self.space) - self.pbar.ProgressValue = 17 + self.pbar.ProgressValue = 18 # Suppression if self.delete.State: if self.delete1.State: n = self._replaceList(xElem, "delete1") self.delete1_res.Label = str(n) @@ -554,11 +556,11 @@ n = self._replaceBulletsByEmDash(xElem) self.delete2_res.Label = str(n) self.pbar.ProgressValue += 1 self.delete.State = False self._switchCheckBox(self.delete) - self.pbar.ProgressValue = 20 + self.pbar.ProgressValue = 21 # signes typographiques if self.typo.State: if self.typo1.State: n = self._replaceList(xElem, "typo1") self.typo1_res.Label = str(n) @@ -628,11 +630,11 @@ n += self._replaceText(xElem, "st", "st", False, True) self.typo8_res.Label = str(n) self.pbar.ProgressValue += 1 self.typo.State = False self._switchCheckBox(self.typo) - self.pbar.ProgressValue = 28 + self.pbar.ProgressValue = 29 # divers if self.misc.State: if self.misc1.State: if self.misc1a.State: n = self._replaceList(xElem, "misc1a") Index: gc_lang/fr/oxt/TextFormatter/tf_options.py ================================================================== --- gc_lang/fr/oxt/TextFormatter/tf_options.py +++ gc_lang/fr/oxt/TextFormatter/tf_options.py @@ -1,18 +1,18 @@ dDefaultOpt = { 'ssp': 1, 'ssp1': 1, 'ssp2': 1, 'ssp3': 1, 'ssp4': 1, 'ssp5': 1, 'ssp6': 1, 'ssp7': 1, - 'nbsp': 1, 'nbsp1': 1, 'nbsp2': 1, 'nbsp3': 1, 'nbsp4': 1, 'nbsp5': 1, 'nnbsp1': 0, 'nnbsp2': 0, 'nnbsp4': 0, + 'nbsp': 1, 'nbsp1': 1, 'nbsp2': 1, 'nbsp3': 1, 'nbsp4': 1, 'nbsp5': 1, 'nbsp6': 1, 'nnbsp1': 0, 'nnbsp2': 0, 'nnbsp4': 0, 'space': 1, 'space1': 1, 'space2': 1, 'delete': 0, 'delete1': 1, 'delete2': 1, 'delete2a': 0, 'delete2b': 1, 'delete2c': 0, 'typo': 1, 'typo1': 1, 'typo2': 1, 'typo3': 1, 'typo4': 1, 'typo5': 1, 'typo6': 1, 'typo7': 1, 'typo8': 0, 'typo3a': 0, 'typo3b': 1, 'typo4a': 1, 'typo4b': 0, 'typo8a': 0, 'typo8b': 1, 'typo_ff': 1, 'typo_fi':1, 'typo_ffi':1, 'typo_fl':1, 'typo_ffl':1, 'typo_ft':1, 'typo_st': 1, 'misc': 1, 'misc1': 1, 'misc2': 1, 'misc3': 1, 'misc5': 1, 'misc1a': 0, 'misc5b': 0, 'misc5c': 0, 'struct': 0, 'struct1': 1, 'struct2': 1, 'struct3': 0, } dOpt = { 'ssp': 1, 'ssp1': 1, 'ssp2': 1, 'ssp3': 1, 'ssp4': 1, 'ssp5': 1, 'ssp6': 1, 'ssp7': 1, - 'nbsp': 1, 'nbsp1': 1, 'nbsp2': 1, 'nbsp3': 1, 'nbsp4': 1, 'nbsp5': 1, 'nnbsp1': 0, 'nnbsp2': 0, 'nnbsp4': 0, + 'nbsp': 1, 'nbsp1': 1, 'nbsp2': 1, 'nbsp3': 1, 'nbsp4': 1, 'nbsp5': 1, 'nbsp6': 1, 'nnbsp1': 0, 'nnbsp2': 0, 'nnbsp4': 0, 'space': 1, 'space1': 1, 'space2': 1, 'delete': 0, 'delete1': 1, 'delete2': 1, 'delete2a': 0, 'delete2b': 1, 'delete2c': 0, 'typo': 1, 'typo1': 1, 'typo2': 1, 'typo3': 1, 'typo4': 1, 'typo5': 1, 'typo6': 1, 'typo7': 1, 'typo8': 0, 'typo3a': 0, 'typo3b': 1, 'typo4a': 1, 'typo4b': 0, 'typo8a': 0, 'typo8b': 1, 'typo_ff': 1, 'typo_fi':1, 'typo_ffi':1, 'typo_fl':1, 'typo_ffl':1, 'typo_ft':1, 'typo_st': 1, 'misc': 1, 'misc1': 1, 'misc2': 1, 'misc3': 1, 'misc5': 1, 'misc1a': 0, 'misc5b': 0, 'misc5c': 0, 'struct': 0, 'struct1': 1, 'struct2': 1, 'struct3': 0, } Index: gc_lang/fr/oxt/TextFormatter/tf_strings.py ================================================================== --- gc_lang/fr/oxt/TextFormatter/tf_strings.py +++ gc_lang/fr/oxt/TextFormatter/tf_strings.py @@ -26,10 +26,11 @@ "nbsp1": "Avant : ; ? et !", "nbsp2": "Avec les guillemets « et »", "nbsp3": "Avant % ‰ € $ £ ¥ ˚C", "nbsp4": "À l’intérieur des nombres", "nbsp5": "Avant les unités de mesure", + "nbsp6": "Après les titres de civilité", "nnbsp": "fins", "nnbsp_help": "sauf avec “:”", "delete": "Su~ppressions", "delete1": "Tirets conditionnels", @@ -108,10 +109,11 @@ "nbsp1": "Before : ; ? and !", "nbsp2": "With quoting marks « and »", "nbsp3": "Before % ‰ € $ £ ¥ ˚C", "nbsp4": "Within numbers", "nbsp5": "Before units of measurement", + "nbsp6": "After titles", "nnbsp": "narrow", "nnbsp_help": "except with “:”", "delete": "~Deletions", "delete1": "Soft hyphens", Index: gc_lang/fr/oxt/TextFormatter/tf_tabrep.py ================================================================== --- gc_lang/fr/oxt/TextFormatter/tf_tabrep.py +++ gc_lang/fr/oxt/TextFormatter/tf_tabrep.py @@ -119,11 +119,11 @@ ], "nbsp5": [ ("(?<=[0-9⁰¹²³⁴⁵⁶⁷⁸⁹]) ?([kcmµnd]?(?:[slgJKΩΩℓ]|m[²³]?|Wh?|Hz|dB)|[%‰]|°C)\\b", " $1", True, True) ], "nbsp6": [ - ("\\b(MM?\\.|Mlle|Mgr) ", "$1 ", True, True) + ("\\bM(mes?|ᵐᵉˢ?|grs?|ᵍʳˢ?|lles?|ˡˡᵉˢ?|rs?|ʳˢ?|M\\.) ", "M$1 ", True, True) ], # espaces manquants "space1": [ (";(?=[:alnum:])", "; ", True, True), Index: gc_lang/fr/tb/content/overlay.js ================================================================== --- gc_lang/fr/tb/content/overlay.js +++ gc_lang/fr/tb/content/overlay.js @@ -692,11 +692,11 @@ document.getElementById("o_group_ssp").checked = false; this.switchGroup("o_group_ssp"); } document.getElementById('progressbar').value = 1; - // espaces typographiques + // espaces insécables if (document.getElementById("o_group_nbsp").checked) { if (document.getElementById("o_nbsp_before_punctuation").checked) { [sText, n1] = this.formatText(sText, "nbsp_before_punctuation"); [sText, n2] = this.formatText(sText, "nbsp_repair"); document.getElementById('res_o_nbsp_before_punctuation').textContent = n1 - n2; @@ -715,10 +715,14 @@ } if (document.getElementById("o_nbsp_before_units").checked) { [sText, n1] = this.formatText(sText, "nbsp_before_units"); document.getElementById('res_o_nbsp_before_units').textContent = n1; } + if (document.getElementById("o_nbsp_titles").checked) { + [sText, n1] = this.formatText(sText, "nbsp_titles"); + document.getElementById('res_o_nbsp_titles').textContent = n1; + } document.getElementById("o_group_nbsp").checked = false; this.switchGroup("o_group_nbsp"); } document.getElementById('progressbar').value = 2; Index: gc_lang/fr/tb/content/overlay.xul ================================================================== --- gc_lang/fr/tb/content/overlay.xul +++ gc_lang/fr/tb/content/overlay.xul @@ -169,10 +169,15 @@ + + + + Index: gc_lang/fr/tb/locale/en/overlay.dtd ================================================================== --- gc_lang/fr/tb/locale/en/overlay.dtd +++ gc_lang/fr/tb/locale/en/overlay.dtd @@ -35,10 +35,11 @@ + Index: gc_lang/fr/tb/locale/fr/overlay.dtd ================================================================== --- gc_lang/fr/tb/locale/fr/overlay.dtd +++ gc_lang/fr/tb/locale/fr/overlay.dtd @@ -35,10 +35,11 @@ + Index: gc_lang/fr/webext/content_scripts/panel_tf.js ================================================================== --- gc_lang/fr/webext/content_scripts/panel_tf.js +++ gc_lang/fr/webext/content_scripts/panel_tf.js @@ -34,10 +34,11 @@ xNBSP.appendChild(this._createBlockOption("o_nbsp_before_punctuation", true, "Avant : ; ? et !")); xNBSP.appendChild(this._createBlockOption("o_nbsp_within_quotation_marks", true, "Avec les guillemets « et »")); xNBSP.appendChild(this._createBlockOption("o_nbsp_before_symbol", true, "Avant % ‰ € $ £ ¥ ˚C")); xNBSP.appendChild(this._createBlockOption("o_nbsp_within_numbers", true, "À l’intérieur des nombres")); xNBSP.appendChild(this._createBlockOption("o_nbsp_before_units", true, "Avant les unités de mesure")); + xNBSP.appendChild(this._createBlockOption("o_nbsp_titles", true, "Après les titres de civilité")); let xDelete = this._createFieldset("group_delete", true, "Suppressions"); xDelete.appendChild(this._createBlockOption("o_erase_non_breaking_hyphens", true, "Tirets conditionnels")); let xColumn2 = oGrammalecte.createNode("div", {className: "grammalecte_tf_column"}); let xTypo = this._createFieldset("group_typo", true, "Signes typographiques"); xTypo.appendChild(this._createBlockOption("o_ts_apostrophe", true, "Apostrophe (’)")); @@ -308,11 +309,11 @@ this.setOption("o_group_ssp", false); this.switchGroup("o_group_ssp"); } document.getElementById('grammalecte_tf_progressbar').value = 2; - // espaces typographiques + // espaces insécables if (this.isSelected("o_group_nbsp")) { if (this.isSelected("o_nbsp_before_punctuation")) { [sText, n1] = this.formatText(sText, "nbsp_before_punctuation"); [sText, n2] = this.formatText(sText, "nbsp_repair"); document.getElementById('res_o_nbsp_before_punctuation').textContent = n1 - n2; @@ -331,10 +332,14 @@ } if (this.isSelected("o_nbsp_before_units")) { [sText, n1] = this.formatText(sText, "nbsp_before_units"); document.getElementById('res_o_nbsp_before_units').textContent = n1; } + if (this.isSelected("o_nbsp_titles")) { + [sText, n1] = this.formatText(sText, "nbsp_titles"); + document.getElementById('res_o_nbsp_titles').textContent = n1; + } this.setOption("o_group_nbsp", false); this.switchGroup("o_group_nbsp"); } document.getElementById('grammalecte_tf_progressbar').value = 3;