File tree 1 file changed +15
-1
lines changed
1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -130,9 +130,23 @@ def check_all_translations():
130
130
# pick all numerusforms
131
131
if numerus :
132
132
translations = [i .text for i in translation_node .findall ('numerusform' )]
133
+ if len (translations ) == 0 :
134
+ print (f'Numerus message without numerusform translations, needs fix.' , sanitize_string (source ))
135
+ have_errors = True
136
+ if translation_node .text is not None and not translation_node .text .isspace ():
137
+ print (f'Numerus message contains extra text { translation_node .text } , needs fix.' )
138
+ have_errors = True
139
+ for child in list (translation_node .iter ())[1 :]: # exclude root
140
+ if child .tag != 'numerusform' :
141
+ print ('Numerus message contains extra child node, needs fix.' , sanitize_string (source ))
142
+ have_errors = True
143
+ break
133
144
else :
134
145
translations = [translation_node .text ]
135
-
146
+ if len (list (translation_node .iter ())) != 1 :
147
+ print ('Non-numerus message contains child node in translation, needs fix.' , sanitize_string (source ))
148
+ have_errors = True
149
+
136
150
for translation in translations :
137
151
if translation is None :
138
152
continue
You can’t perform that action at this time.
0 commit comments