Translated validation

This commit is contained in:
Georgy Litvinov 2020-05-04 15:52:04 +02:00
parent c8634a88fe
commit fce72b8a2d
5 changed files with 95 additions and 12 deletions

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> <!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Clean" script:language="StarBasic">Sub mark49 <script:module xmlns:script="http://openoffice.org/2000/script" script:name="Clean" script:language="StarBasic">Sub mark50
End Sub End Sub

View file

@ -143,7 +143,48 @@ Function getRussian(identifier As String) As String
Case &quot;statusRemovedUnusedStyles&quot; Case &quot;statusRemovedUnusedStyles&quot;
getRussian = &quot;Удаляем неиспользуемые стили&quot; getRussian = &quot;Удаляем неиспользуемые стили&quot;
Exit Function Exit Function
Case &quot;validationSuccess&quot;
getRussian = &quot;Документ успешно прошел проверку. &quot; &amp; chr(10) &amp; &quot;Проблем не было найдено&quot;
Exit Function
Case &quot;validationWarning&quot;
getRussian = &quot;Перед публикацией документа следует исправить все найденные замечания.&quot;
Exit Function
Case &quot;validationBadSymbolsNotification&quot;
getRussian = &quot;В тексте обнаружены неподходящие для публикции символы.&quot; &amp; chr(10) &amp; &quot; Далее будет представлен список отрывков текста с подобными символами.&quot;
Exit Function
Case &quot;validationBadDrawings&quot;
getRussian = &quot;В документе найдены рисунки (&quot;
Exit Function
Case &quot;validationBadEmbeededObjects&quot;
getRussian = &quot;В документе найдены встроенные объекты (&quot;
Exit Function
Case &quot;validationExcerptNotSuitable&quot;
getRussian = &quot;), неподходящие для публикации. &quot;
Exit Function
Case &quot;validateFootnotes1&quot;
getRussian = &quot;Символ&quot;
Exit Function
Case &quot;validateFootnotes2&quot;
getRussian = &quot;в сноске (абсолютный номер)&quot;
Exit Function
Case &quot;validateFootnotes3&quot;
getRussian = &quot;не подходит для публикации&quot;
Exit Function
Case &quot;validateNumberingsReportFonts&quot;
getRussian = &quot;В следующих списках нумерации найдены шрифты&quot;
Exit Function
Case &quot;validateNumberingsReportSymbols&quot;
getRussian = &quot;В качестве маркера в следующих списках нумерации задан некорректный символ&quot;
Exit Function
Case &quot;validateNumberingLevel&quot;
getRussian = &quot;Уровень&quot;
Exit Function
Case &quot;validateNumberingFont&quot;
getRussian = &quot;шрифт&quot;
Exit Function
Case &quot;validateNumberingSymbol&quot;
getRussian = &quot;символ&quot;
Exit Function
Case Else Case Else
getRussian = &quot;Перевод не найден&quot; getRussian = &quot;Перевод не найден&quot;
End Select End Select
@ -278,6 +319,48 @@ Function getEnglish(identifier As String) As String
Case &quot;statusRemovedUnusedStyles&quot; Case &quot;statusRemovedUnusedStyles&quot;
getEnglish = &quot;Removing unused styles&quot; getEnglish = &quot;Removing unused styles&quot;
Exit Function Exit Function
Case &quot;validationSuccess&quot;
getEnglish = &quot;Validation completed successfully&quot; &amp; chr(10) &amp; &quot;No problems found.&quot;
Exit Function
Case &quot;validationWarning&quot;
getEnglish = &quot;It is recommended to fix all problems before publication.&quot;
Exit Function
Case &quot;validationBadSymbolsNotification&quot;
getEnglish = &quot;Unsuitable symbols were found&quot; &amp; chr(10) &amp; &quot; Now you will get the list with bad symbols.&quot;
Exit Function
Case &quot;validationBadDrawings&quot;
getEnglish = &quot;Drawings was found (&quot;
Exit Function
Case &quot;validationBadEmbeededObjects&quot;
getEnglish = &quot;Embeeded objects were found (&quot;
Exit Function
Case &quot;validationExcerptNotSuitable&quot;
getEnglish = &quot;), which are not suitable for digital publication&quot;
Exit Function
Case &quot;validateFootnotes1&quot;
getEnglish = &quot;Symbol&quot;
Exit Function
Case &quot;validateFootnotes2&quot;
getEnglish = &quot;in footnote (absolute number)&quot;
Exit Function
Case &quot;validateFootnotes3&quot;
getEnglish = &quot;is not suitable for publication&quot;
Exit Function
Case &quot;validateNumberingsReportFonts&quot;
getEnglish = &quot;In next numbering lists found fonts &quot;
Exit Function
Case &quot;validateNumberingsReportSymbols&quot;
getEnglish = &quot;Incorrect symbol used as a marker in following numbering lists&quot;
Exit Function
Case &quot;validateNumberingLevel&quot;
getEnglish = &quot;Level&quot;
Exit Function
Case &quot;validateNumberingFont&quot;
getEnglish = &quot;font&quot;
Exit Function
Case &quot;validateNumberingSymbol&quot;
getEnglish = &quot;symbol&quot;
Exit Function
Case Else Case Else
getEnglish = &quot;No translation&quot; getEnglish = &quot;No translation&quot;
End Select End Select

View file

@ -61,13 +61,13 @@ Sub validateButton
printNumberingSymbols(needExtendedInfo) printNumberingSymbols(needExtendedInfo)
If badText OR badNumberings OR badFootnoteSigns OR badGraphics Then If badText OR badNumberings OR badFootnoteSigns OR badGraphics Then
MsgBox &quot;Перед публикацией документа следует исправить все найденные замечания.&quot; MsgBox getTranslation(&quot;validationWarning&quot;)
If badText Then If badText Then
MsgBox &quot;В тексте обнаружены неподходящие для публикции символы.&quot; &amp; chr(10) &amp; &quot; Далее будет представлен список отрывков текста с подобными символами.&quot; MsgBox getTranslation(&quot;validationBadSymbolsNotification&quot;)
removeBadCharacters removeBadCharacters
EndIf EndIf
Else Else
MsgBox &quot;Документ успешно прошел проверку. &quot; &amp; chr(10) &amp; &quot;Все изображения и символы корректны.&quot; MsgBox getTranslation(&quot;validationSuccess&quot;)
EndIf EndIf
End Sub End Sub
@ -108,10 +108,10 @@ Private Function checkGraphics() As String
EndIf EndIf
Next i Next i
If drawingN &lt;&gt; 0 Then If drawingN &lt;&gt; 0 Then
result = result &amp;&quot;В документе найдены рисунки (&quot; &amp; drawingN &amp; &quot;), неподходящие для публикации.&quot; &amp; chr(10) result = result &amp; getTranslation(&quot;validationBadDrawings&quot;) &amp; drawingN &amp; getTranslation(&quot;validationExcerptNotSuitable&quot;) &amp; chr(10)
EndIf EndIf
If badFrame &lt;&gt; 0 Then If badFrame &lt;&gt; 0 Then
result = result &amp;&quot;В документе найдены встроенные объекты (&quot; &amp; badFrame &amp; &quot;), неподходящие для публикации.&quot; &amp; chr(10) result = result &amp; getTranslation(&quot;validationBadEmbeededObjects&quot;) &amp; badFrame &amp; getTranslation(&quot;validationExcerptNotSuitable&quot;) &amp; chr(10)
EndIf EndIf
checkGraphics = result checkGraphics = result
End Function End Function
@ -142,7 +142,7 @@ Private Function checkAllFootnotes() As String
For j = 1 to charNum For j = 1 to charNum
char = Asc(Right(Left(label,j),1)) char = Asc(Right(Left(label,j),1))
If char &gt;= 57344 AND char &lt;= 63743 then If char &gt;= 57344 AND char &lt;= 63743 then
result = result &amp; &quot;Символ &quot;&amp; Chr(char) &amp;&quot; сноски &quot;&amp; i &amp;&quot; не подходит для публикации&quot;&amp; chr(10) result = result &amp; getTranslation(&quot;validateFootnotes1&quot;) &amp; &quot; &quot; &amp; Chr(char) &amp; &quot; &quot; &amp; getTranslation(&quot;validateFootnotes2&quot;) &amp; &quot; &quot; &amp; i &amp; &quot; &quot; &amp; getTranslation(&quot;validateFootnotes3&quot;) &amp; chr(10)
End If End If
Next j Next j
Next i Next i
@ -195,7 +195,7 @@ Private Sub printNumberingSymbols(needExtendedInfo)
exLength = Len(excerpt) exLength = Len(excerpt)
EndIf EndIf
If fontChar &lt;&gt; &quot;&quot; Then If fontChar &lt;&gt; &quot;&quot; Then
tmp = &quot;Уровень &quot; &amp; (j + 1) &amp; &quot; шрифт &quot; &amp; fontName &amp; &quot; символ &quot; &amp; fontChar &amp; &quot; (&quot; &amp; Hex(Asc(fontChar)) &amp; &quot;) &quot;&amp; Left(excerpt,exLength) &amp; chr(10) tmp = getTranslation(&quot;validateNumberingLevel&quot;) &amp;&quot; &quot; &amp; (j + 1) &amp; &quot; &quot; &amp; getTranslation(&quot;validateNumberingFont&quot;) &amp; &quot; &quot; &amp; fontName &amp; &quot; &quot; &amp; getTranslation(&quot;validateNumberingSymbol&quot;) &amp; &quot; &quot; &amp; fontChar &amp; &quot; (&quot; &amp; Hex(Asc(fontChar)) &amp; &quot;) &quot;&amp; Left(excerpt,exLength) &amp; chr(10)
If Asc(fontChar) &gt; 57344 AND Asc(fontChar) &lt; 63743 Then If Asc(fontChar) &gt; 57344 AND Asc(fontChar) &lt; 63743 Then
resultBad = resultBad &amp; tmp resultBad = resultBad &amp; tmp
ElseIf fontName &lt;&gt; &quot;IPH Astra Serif&quot; _ ElseIf fontName &lt;&gt; &quot;IPH Astra Serif&quot; _
@ -218,10 +218,10 @@ Private Sub printNumberingSymbols(needExtendedInfo)
Exit sub Exit sub
Else Else
If resultBad &lt;&gt; &quot;&quot; Then If resultBad &lt;&gt; &quot;&quot; Then
report = &quot;В качестве маркера в следующих списках нумерации задан некорректный символ&quot;&amp; chr(10) &amp; resultBad report = getTranslation(&quot;validateNumberingsReportSymbols&quot;) &amp; chr(10) &amp; resultBad
EndIf EndIf
If result &lt;&gt; &quot;&quot; Then If result &lt;&gt; &quot;&quot; Then
report = report &amp; &quot;В следующих списках нумерации найдены шрифты &quot;&amp; chr(10)&amp; result report = report &amp; getTranslation(&quot;validateNumberingsReportFonts&quot;) &amp; &quot; &quot;&amp; chr(10)&amp; result
EndIf EndIf
EndIf EndIf
MsgBox report MsgBox report

View file

@ -3,7 +3,7 @@
xmlns:dep="http://openoffice.org/extensions/description/2006" xmlns:dep="http://openoffice.org/extensions/description/2006"
xmlns:xlink="http://www.w3.org/1999/xlink"> xmlns:xlink="http://www.w3.org/1999/xlink">
<identifier value="pro.litvinovg.Redaction" /> <identifier value="pro.litvinovg.Redaction" />
<version value="0.7.7" /> <version value="0.7.8" />
<platform value="all" /> <platform value="all" />
<display-name> <display-name>
<name lang="en">Cleaning and validation documents for publishing in html and epub with pagination</name> <name lang="en">Cleaning and validation documents for publishing in html and epub with pagination</name>

Binary file not shown.