[gimp-help/gimp-help-2-10] tools: fix not checking for a space between < and / when closing a tag



commit faa920381032042fae53dece4ae219190b81adf6
Author: Jacob Boerema <jgboerema gmail com>
Date:   Thu Mar 10 18:49:25 2022 -0500

    tools: fix not checking for a space between < and / when closing a tag
    
    (cherry picked from commit f36f0200ce8419bd4bcf6c0ee5708d123b22ab40)

 tools/test/test.po   | 23 +++++++++++++++++++++++
 tools/validate_po.py |  7 +++++++
 2 files changed, 30 insertions(+)
---
diff --git a/tools/test/test.po b/tools/test/test.po
index 800da9e67..89889681b 100644
--- a/tools/test/test.po
+++ b/tools/test/test.po
@@ -132,3 +132,26 @@ msgstr ""
 msgid "translator-credits"
 msgstr "Jacob Boerema <jgboerema gmail com>, 2021, 2022"
 
+#: src/using/getting-unstuck.xml:4700(para)
+# ERROR: no space allowed between < and / when closing a tag
+msgid ""
+"<emphasis>How to solve:</emphasis> Right click on the floating selection to "
+"open the Layer menu and select either <guimenuitem>Anchor Layer</"
+"guimenuitem> (shortcut <keycombo><keycap>Ctrl</keycap><keycap>H</keycap></"
+"keycombo>) to anchor the floating selection to the layer below it, or "
+"convert it into an ordinary layer by selecting <guimenuitem>To New Layer </"
+"guimenuitem> (shortcut <keycombo><keycap>Shift</keycap><keycap>Ctrl</"
+"keycap><keycap>N</keycap></keycombo>). If you need more help on how to do "
+"this, see <link linkend=\"anchor-floating-selection\">Floating Selections</"
+"link>."
+msgstr ""
+"<emphasis>Τρόπος επίλυσης:</emphasis> Δεξιοπατήστε στην αιωρούμενη επιλογή "
+"για να ανοίξετε το μενού Στρώσεις και επιλέξτε είτε <guimenuitem>Αγκύρωση "
+"στρώσης</guimenuitem> (συντόμευση <keycombo><keycap>Ctrl</keycap><keycap> H</"
+"keycap></keycombo>) για να αγκυρώσετε την αιωρούμενη επιλογή στην από κάτω "
+"στρώση, ή να τη μετατρέψετε σε μια συνηθισμένη στρώση επιλέγοντας "
+"<guimenuitem>Σε νέα στρώση </guimenuitem> (συντόμευση "
+"<keycombo><keycap>Shift< /keycap><keycap>Ctrl</keycap><keycap>N</keycap></"
+"keycombo>). Εάν χρειάζεστε περισσότερη βοήθεια για το πώς να το κάνετε αυτό, "
+"ανατρέξτε στις <link linkend=\"anchor-floating-selection\">Αιωρούμενες "
+"επιλογές</link>."
diff --git a/tools/validate_po.py b/tools/validate_po.py
index b70c0a926..b1ec4fad8 100644
--- a/tools/validate_po.py
+++ b/tools/validate_po.py
@@ -95,6 +95,13 @@ class Validate(object):
                 # Check that it's not a tag that closes itself and comment tags starting with <!
                 if textblock[end_tag-1] != '/' and textblock[0] != '!':
                     # check for closing tag first
+                    if len(tag) > 2 and tag[0] == ' ' and tag[1] == '/':
+                        # space not allowed when closing tag between < and /
+                        err += 1
+                        self.printErrorHeader(entry, self.log)
+                        tag = tag[1:]
+                        print(f"ERROR: No space allowed between '<' and '/' when closing a tag, in this case 
[{tag}].", file=self.log)
+
                     if len(tag) > 0 and tag[0] == '/':
                         if tag[1] == ' ':
                             # space not allowed when closing tag between / and tag


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]