Translations

This commit is contained in:
Georgy Litvinov 2020-05-05 14:01:41 +02:00
parent fd39bd91ff
commit dc13387975
11 changed files with 187 additions and 70 deletions

View file

@ -23,7 +23,7 @@ Sub makePageAlbum
curPageStyleName = getCurPageStyleName() curPageStyleName = getCurPageStyleName()
findBestAnchor() findBestAnchor()
If checkPageSettings(curPageStyleName) Then If checkPageSettings(curPageStyleName) Then
MsgBox "Проверьте размеры колонтитулов и перезапустите макрос" MsgBox getTranslation("albumRotationCheckPageSettings")
Exit Sub Exit Sub
EndIf EndIf
rotatePageClockwise(curPageStyleName) rotatePageClockwise(curPageStyleName)
@ -44,7 +44,7 @@ Sub findBestAnchor()
If curPageStyleName = getCurPageStyleName() Then If curPageStyleName = getCurPageStyleName() Then
Exit Sub Exit Sub
EndIf EndIf
MsgBox "Произошла ошибка. Обратитесь к разработчику." MsgBox getTranslation("unrecoverableError")
End Sub End Sub
Sub undoPageAlbum Sub undoPageAlbum
@ -61,14 +61,14 @@ sub applyPortraitPageStyle(pageStyleName As String)
pageStyles = ThisComponent.StyleFamilies.getByName("PageStyles") pageStyles = ThisComponent.StyleFamilies.getByName("PageStyles")
pageStyle = pageStyles.getByName(pageStyleName) pageStyle = pageStyles.getByName(pageStyleName)
If NOT pageStyle.IsLandScape Then If NOT pageStyle.IsLandScape Then
MsgBox "Страница уже имеет портретную ориентацию. Ничего не делаем. Выходим." MsgBox getTranslation("albumRotationPageIsAlreadyAlbum")
Exit sub Exit sub
EndIf EndIf
If pageStyles.hasByName("portrait_" & pageStyleName) Then If pageStyles.hasByName("portrait_" & pageStyleName) Then
replacePageStyleByPortrait(pageStyleName) replacePageStyleByPortrait(pageStyleName)
removeAlbumFrames(pageStyleName) removeAlbumFrames(pageStyleName)
Else Else
MsgBox "Стиль страницы с портретной ориентацией portrait_" & pageStyleName & " не был найден. " MsgBox getTranslation("albumRotationBackupStyleNotFound1") & " portrait_" & pageStyleName & " " & getTranslation("albumRotationBackupStyleNotFound2")
EndIf EndIf
End Sub End Sub
@ -161,7 +161,7 @@ Sub rotatePageClockwise(pageStyleName As String)
pageStyles = ThisComponent.StyleFamilies.getByName("PageStyles") pageStyles = ThisComponent.StyleFamilies.getByName("PageStyles")
pageStyle = pageStyles.getByName(pageStyleName) pageStyle = pageStyles.getByName(pageStyleName)
If pageStyle.IsLandScape Then If pageStyle.IsLandScape Then
MsgBox "Страница уже имеет альбомную ориентацию. Ничего не делаем. Выходим." MsgBox getTranslation("albumRotationPageIsAlreadyAlbum")
Exit sub Exit sub
EndIf EndIf
If NOT pageStyle.IsUserDefined() Then If NOT pageStyle.IsUserDefined() Then
@ -261,24 +261,24 @@ Function checkPageSettings(pageStyleName As String) As Boolean
If pageStyle.HeaderIsDynamicHeight Then If pageStyle.HeaderIsDynamicHeight Then
checkPageSettings = true checkPageSettings = true
pageStyle.HeaderIsDynamicHeight = false pageStyle.HeaderIsDynamicHeight = false
MsgBox "Высота верхнего колонтитула была задана динамической. Отключаем." MsgBox getTranslation("albumRotationDynamicHeaderHeight")
EndIf EndIf
If pageStyle.HeaderDynamicSpacing Then If pageStyle.HeaderDynamicSpacing Then
checkPageSettings = true checkPageSettings = true
pageStyle.HeaderDynamicSpacing = false pageStyle.HeaderDynamicSpacing = false
MsgBox "Отступ верхнего колонтитула от тела страницы был задан динамическим. Отключаем." MsgBox getTranslation("albumRotationDynamicHeaderOffset")
EndIf EndIf
EndIf EndIf
If pageStyle.FooterIsOn Then If pageStyle.FooterIsOn Then
If pageStyle.FooterIsDynamicHeight Then If pageStyle.FooterIsDynamicHeight Then
checkPageSettings = true checkPageSettings = true
pageStyle.FooterIsDynamicHeight = false pageStyle.FooterIsDynamicHeight = false
MsgBox "Высота нижнего колонтитула была задана динамической. Отключаем." MsgBox getTranslation("albumRotationDynamicFooterHeight")
EndIf EndIf
If pageStyle.FooterDynamicSpacing Then If pageStyle.FooterDynamicSpacing Then
checkPageSettings = true checkPageSettings = true
pageStyle.FooterDynamicSpacing = false pageStyle.FooterDynamicSpacing = false
MsgBox "Отступ нижнего колонтитула от тела страницы был задан динамическим. Отключаем." MsgBox getTranslation("albumRotationDynamicFooterOffset")
EndIf EndIf
EndIf EndIf
'Workaround to force Writer reread new page settings 'Workaround to force Writer reread new page settings

View file

@ -37,17 +37,17 @@ Sub createBidirectLink
Dim oAnchor2Name As String Dim oAnchor2Name As String
If IsNull(ThisComponent) Then If IsNull(ThisComponent) Then
MsgBox "Ничего не выбрано" MsgBox getTranslation("bidirectLinkSuggestion")
Exit Sub Exit Sub
End If End If
oSelections = ThisComponent.getCurrentSelection() oSelections = ThisComponent.getCurrentSelection()
If IsNull(oSelections) Then If IsNull(oSelections) Then
MsgBox "Ничего не выбрано" MsgBox getTranslation("bidirectLinkSuggestion")
Exit Sub Exit Sub
End If End If
objectsCount = oSelections.getCount() - 1 objectsCount = oSelections.getCount() - 1
If objectsCount < 2 OR objectsCount > 2 Then If objectsCount < 2 OR objectsCount > 2 Then
MsgBox "Нужно выделить два объекта" MsgBox getTranslation("bidirectLinkSuggestion")
Exit Sub Exit Sub
End If End If
@ -124,7 +124,7 @@ End Function
sub convertIndesignPageBreaks sub convertIndesignPageBreaks
Dim description As String Dim description As String
description = "Запустить восстановление разрывов страниц?" description = getTranslation("convertIndesignPageBreaksConfirmation")
If NOT confirm(description) Then If NOT confirm(description) Then
Exit Sub Exit Sub
EndIf EndIf
@ -187,7 +187,7 @@ sub convertIndesignPageBreaks
End If End If
oFound = ThisComponent.findNext(oFound.End, oSearch) oFound = ThisComponent.findNext(oFound.End, oSearch)
Loop Loop
MsgBox "Восстановление разрывов страниц завершено." MsgBox getTranslation("convertIndesignPageBreaksFinish")
end Sub end Sub
Sub adjustLastLine(oTextCursor) Sub adjustLastLine(oTextCursor)
@ -302,7 +302,7 @@ End Sub
Sub convertBookmarksToFootnotes() Sub convertBookmarksToFootnotes()
Dim description As String Dim description As String
description = "Запустить восстановление сносок из текста?" description = getTranslation("convertIndesignFoonotesConfirmation")
If NOT confirm(description) Then If NOT confirm(description) Then
Exit Sub Exit Sub
EndIf EndIf
@ -341,7 +341,7 @@ Sub convertBookmarksToFootnotes()
Next i Next i
resetNotesStyle resetNotesStyle
MsgBox "Восстановление сносок завершено." MsgBox getTranslation("convertIndesignFootnotesFinish")
End Sub End Sub
Sub convertLinkToFootnote(forwardLink,backwardLink) Sub convertLinkToFootnote(forwardLink,backwardLink)
@ -451,6 +451,7 @@ Sub replaceParaStyle
oDialog = CreateUnoDialog( DialogLibraries.ePublishing.replaceParaStyle ) oDialog = CreateUnoDialog( DialogLibraries.ePublishing.replaceParaStyle )
listBox = oDialog.getControl("ListBox1") listBox = oDialog.getControl("ListBox1")
listBox.addItems(sortedDPSN , 0) listBox.addItems(sortedDPSN , 0)
oDialog.Title = getTranslation("replaceParaStyleDialogTitle")
oDialog.Execute() oDialog.Execute()
newStyleName = oDialog.model.Tag newStyleName = oDialog.model.Tag
If newStyleName="0" or newStyleName="" Then If newStyleName="0" or newStyleName="" Then
@ -461,14 +462,14 @@ Sub replaceParaStyle
newStyleName = paraStyleNames(foundIndex) newStyleName = paraStyleNames(foundIndex)
If newStyleName = oldStyleName Then If newStyleName = oldStyleName Then
MsgBox "Стили не различаются" MsgBox getTranslation("replaceParaStyleStylesEqualsNotification")
Exit sub Exit sub
EndIf EndIf
If oldStyleName <> "" Then If oldStyleName <> "" Then
oldStyle = paraStyles.getByName(oldStyleName) oldStyle = paraStyles.getByName(oldStyleName)
If NOT oldStyle.isUserDefined Then If NOT oldStyle.isUserDefined Then
MsgBox "Невозвожно заменять встроенные стили" MsgBox getTranslation("replaceParaStyleCurrentStyleIsStandard")
Exit sub Exit sub
EndIf EndIf
oldStyle.ParentStyle = newStyleName oldStyle.ParentStyle = newStyleName

View file

@ -7,6 +7,14 @@ Sub openFootNotesDialog
Dim dialog As Object Dim dialog As Object
DialogLibraries.LoadLibrary("ePublishing") DialogLibraries.LoadLibrary("ePublishing")
dialog = CreateUnoDialog(DialogLibraries.ePublishing.FootnotesConfig) dialog = CreateUnoDialog(DialogLibraries.ePublishing.FootnotesConfig)
dialog.getControl("buttonOK").Label = getTranslation("buttonOk")
dialog.getControl("buttonCancel").Label = getTranslation("buttonCancel")
dialog.getControl("configText1").setText(getTranslation("configText1"))
dialog.getControl("configText2").setText(getTranslation("configText2"))
dialog.getControl("configText3").setText(getTranslation("configText3"))
dialog.getControl("configText4").setText(getTranslation("configText4"))
dialog.getControl("configText5").setText(getTranslation("configText5"))
dialog.Title = getTranslation("footnotesConfigDialogTitle")
dialog.setVisible(true) dialog.setVisible(true)
Select Case dialog.Execute() Select Case dialog.Execute()
Case 1 Case 1
@ -25,10 +33,10 @@ Sub setFootnotesNumberingFrom(dialog)
targetLevel = dialog.getControl("level").Value targetLevel = dialog.getControl("level").Value
If targetLevel > -1 AND targetLevel < 11 Then If targetLevel > -1 AND targetLevel < 11 Then
statusIndicator.Start("Нумерую сноски",100) statusIndicator.Start(getTranslation("statusNumberingInProcess"),100)
setFootnotesNumberingLevel(targetLevel) setFootnotesNumberingLevel(targetLevel)
Else Else
MsgBox "Значение уровня заголовков вне допустимого диапазона. Введите число от 0 до 10." MsgBox getTranslation("numberingInputOutOfRange")
EndIf EndIf
statusIndicator.end() statusIndicator.end()
@ -50,7 +58,7 @@ Sub setFootnotesNumberingLevel(level)
Dim statusIndicator as Object Dim statusIndicator as Object
statusIndicator = ThisComponent.getCurrentController.statusIndicator statusIndicator = ThisComponent.getCurrentController.statusIndicator
statusIndicator.Start("Нумерация сносок запущена, подождите",30) statusIndicator.Start(getTranslation("statusNumberingInProcess"),30)
curNum = 1 curNum = 1
@ -126,7 +134,7 @@ Sub setFootnotesNumberingLevel(level)
EndIf EndIf
Wend Wend
statusIndicator.end() statusIndicator.end()
MsgBox "Нумерация сносок успешно завершена." MsgBox getTranslation("statusNumberingFinished")
End Sub End Sub
Private Sub doNotTrack Private Sub doNotTrack

View file

@ -1,17 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE dlg:window PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "dialog.dtd"> <!DOCTYPE dlg:window PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "dialog.dtd">
<dlg:window xmlns:dlg="http://openoffice.org/2000/dialog" xmlns:script="http://openoffice.org/2000/script" dlg:id="FootnotesConfig" dlg:left="99" dlg:top="62" dlg:width="160" dlg:height="98" dlg:closeable="true" dlg:moveable="true"> <dlg:window xmlns:dlg="http://openoffice.org/2000/dialog" xmlns:script="http://openoffice.org/2000/script" dlg:id="FootnotesConfig" dlg:left="99" dlg:top="62" dlg:width="160" dlg:height="98" dlg:closeable="true" dlg:moveable="true">
<dlg:styles>
<dlg:style dlg:style-id="0" dlg:border="none"/>
</dlg:styles>
<dlg:bulletinboard> <dlg:bulletinboard>
<dlg:text dlg:id="Label1" dlg:tab-index="0" dlg:left="16" dlg:top="41" dlg:width="112" dlg:height="10" dlg:value="Начинать нумерацию сносок заново "/>
<dlg:text dlg:id="Label2" dlg:tab-index="1" dlg:left="158" dlg:top="132" dlg:width="0" dlg:height="2" dlg:value="Label2"/> <dlg:text dlg:id="Label2" dlg:tab-index="1" dlg:left="158" dlg:top="132" dlg:width="0" dlg:height="2" dlg:value="Label2"/>
<dlg:button dlg:id="CommandButton1" dlg:tab-index="2" dlg:left="5" dlg:top="78" dlg:width="69" dlg:height="17" dlg:value="OK" dlg:button-type="ok"/>
<dlg:button dlg:id="CommandButton2" dlg:tab-index="3" dlg:left="77" dlg:top="122" dlg:width="2" dlg:height="0" dlg:value="CommandButton2"/> <dlg:button dlg:id="CommandButton2" dlg:tab-index="3" dlg:left="77" dlg:top="122" dlg:width="2" dlg:height="0" dlg:value="CommandButton2"/>
<dlg:button dlg:id="CommandButton3" dlg:tab-index="4" dlg:left="86" dlg:top="78" dlg:width="69" dlg:height="17" dlg:value="Отмена" dlg:button-type="cancel"/>
<dlg:text dlg:id="Label3" dlg:tab-index="5" dlg:left="96" dlg:top="55" dlg:width="24" dlg:height="10" dlg:value="уровня"/>
<dlg:text dlg:id="Label4" dlg:tab-index="7" dlg:left="16" dlg:top="55" dlg:width="58" dlg:height="10" dlg:value="после заголовков"/>
<dlg:text dlg:id="Label5" dlg:tab-index="8" dlg:left="16" dlg:top="15" dlg:width="109" dlg:height="10" dlg:value="Введите в поле число от 0 до 10"/>
<dlg:text dlg:id="Label6" dlg:tab-index="9" dlg:left="9" dlg:top="120" dlg:width="2" dlg:height="0" dlg:value="Label6"/> <dlg:text dlg:id="Label6" dlg:tab-index="9" dlg:left="9" dlg:top="120" dlg:width="2" dlg:height="0" dlg:value="Label6"/>
<dlg:text dlg:id="Label7" dlg:tab-index="10" dlg:left="17" dlg:top="28" dlg:width="122" dlg:height="10" dlg:value="0 - возврат к стандартной нумерации"/> <dlg:numericfield dlg:style-id="0" dlg:id="level" dlg:tab-index="6" dlg:left="77" dlg:top="54" dlg:width="17" dlg:height="10"/>
<dlg:numericfield dlg:id="level" dlg:tab-index="6" dlg:left="77" dlg:top="55" dlg:width="17" dlg:height="10"/> <dlg:button dlg:id="buttonOK" dlg:tab-index="2" dlg:left="5" dlg:top="78" dlg:width="69" dlg:height="17" dlg:value="OK" dlg:button-type="ok"/>
<dlg:button dlg:id="buttonCancel" dlg:tab-index="4" dlg:left="86" dlg:top="78" dlg:width="69" dlg:height="17" dlg:value="Отмена" dlg:button-type="cancel"/>
<dlg:text dlg:id="configText1" dlg:tab-index="8" dlg:left="16" dlg:top="15" dlg:width="109" dlg:height="10" dlg:value="Введите в поле число от 0 до 10"/>
<dlg:text dlg:id="configText3" dlg:tab-index="0" dlg:left="16" dlg:top="41" dlg:width="112" dlg:height="10" dlg:value="Начинать нумерацию сносок заново "/>
<dlg:text dlg:id="configText2" dlg:tab-index="10" dlg:left="16" dlg:top="28" dlg:width="122" dlg:height="10" dlg:value="0 - возврат к стандартной нумерации"/>
<dlg:text dlg:id="configText4" dlg:tab-index="7" dlg:left="16" dlg:top="54" dlg:width="58" dlg:height="10" dlg:value="после заголовков"/>
<dlg:text dlg:id="configText5" dlg:tab-index="5" dlg:left="96" dlg:top="54" dlg:width="24" dlg:height="10" dlg:value="уровня"/>
</dlg:bulletinboard> </dlg:bulletinboard>
</dlg:window> </dlg:window>

View file

@ -7,18 +7,18 @@ Private Sub convertHyphInDoc()
Dim description As String Dim description As String
Dim allNotes As Object Dim allNotes As Object
dim aNote As Object dim aNote As Object
description = &quot;Запустить конвертацию автоматических переносов в ручные?&quot; description = getTranslation(&quot;hyphenationConfirmation&quot;)
If NOT confirm(description) Then If NOT confirm(description) Then
Exit Sub Exit Sub
EndIf EndIf
Dim statusIndicator as Object Dim statusIndicator as Object
statusIndicator = ThisComponent.getCurrentController.StatusIndicator statusIndicator = ThisComponent.getCurrentController.StatusIndicator
statusIndicator.Start(&quot;Произвожу конвертацию, подождите&quot;,10) statusIndicator.Start(getTranslation(&quot;hyphenationsInProgress&quot;),10)
turnOffTracking turnOffTracking
AcceptAllTrackedChanges AcceptAllTrackedChanges
convertHyphInText(ThisComponent.Text) convertHyphInText(ThisComponent.Text)
&apos; Globalscope.BasicLibraries.LoadLibrary( &quot;MRILib&quot; ) &apos; Globalscope.BasicLibraries.LoadLibrary( &quot;MRILib&quot; )
statusIndicator.Start(&quot;Произвожу конвертацию, подождите&quot;,70) statusIndicator.Start(getTranslation(&quot;hyphenationsInProgress&quot;),70)
allNotes = ThisComponent.FootNotes allNotes = ThisComponent.FootNotes
For x = 0 to allNotes.Count -1 For x = 0 to allNotes.Count -1
aNote = allNotes.getByIndex(x) aNote = allNotes.getByIndex(x)
@ -26,7 +26,7 @@ Private Sub convertHyphInDoc()
Next Next
&apos;disableAutoHyph() &apos;disableAutoHyph()
statusIndicator.end() statusIndicator.end()
MsgBox &quot;Конвертация переносов успешно завершена.&quot; MsgBox getTranslation(&quot;hyphenationsSuccess&quot;)
End Sub End Sub
@ -153,7 +153,7 @@ Private Sub verifyHyphenation(lineEnds() As Object)
For i = (Lbound(lineEnds)) To (Ubound(lineEnds)) For i = (Lbound(lineEnds)) To (Ubound(lineEnds))
vCurs.goToRange(lineEnds(i),false) vCurs.goToRange(lineEnds(i),false)
If NOT (vCurs.isAtEndOfLine() OR vCurs.isAtStartOfLine()) Then If NOT (vCurs.isAtEndOfLine() OR vCurs.isAtStartOfLine()) Then
MsgBox &quot;Конвертация прервана. Обратитесь к разработчику.&quot; MsgBox getTranslation(&quot;hyphenationsFailed&quot;)
Stop Stop
EndIf EndIf
Next i Next i
@ -200,7 +200,7 @@ Private Sub replaceHyphen(tCurs As Object,lineNumber As Integer)
EndIf EndIf
EndIf EndIf
If vCurs.isAtEndOfLine() = false AND vCurs.isAtStartOfLine() = false Then If vCurs.isAtEndOfLine() = false AND vCurs.isAtStartOfLine() = false Then
MsgBox &quot;Конвертация переносов не выполнена. Алгоритм нуждается в доработке. Обратитесь к разработчику.&quot; MsgBox getTranslation(&quot;hyphenationsFailed&quot;)
Stop Stop
EndIf EndIf
End Sub End Sub

View file

@ -24,20 +24,20 @@ Sub makeLinksWithLevel(level)
If Ubound(heading) &lt;&gt; -1 AND Ubound(outline) &lt;&gt; -1 Then If Ubound(heading) &lt;&gt; -1 AND Ubound(outline) &lt;&gt; -1 Then
If (Ubound(outline) + 1) MOD (Ubound(heading) + 1 ) = 0 Then If (Ubound(outline) + 1) MOD (Ubound(heading) + 1 ) = 0 Then
For i = 0 To (Ubound(outline)) For i = 0 To (Ubound(outline))
oAnchor2Name = &quot;Оглавление &quot; + level + &quot;.&quot; + (i Mod (Ubound(heading) + 1)) oAnchor2Name = &quot;Outline &quot; + level + &quot;.&quot; + (i Mod (Ubound(heading) + 1))
If i &lt;= Ubound(heading) Then If i &lt;= Ubound(heading) Then
createAnchor(heading(i Mod (Ubound(heading) + 1)),oAnchor2Name) createAnchor(heading(i Mod (Ubound(heading) + 1)),oAnchor2Name)
EndIf EndIf
createLink(outline(i),&quot;&quot;,oAnchor2Name) createLink(outline(i),&quot;&quot;,oAnchor2Name)
Next i Next i
Else Else
MsgBox (&quot;Число Оглавлений &quot;+ level +&quot; уровня (&quot;+(Ubound(outline)+1) +&quot;) не кратно числу Заголовоков &quot; + level + &quot; уровня (&quot; + (Ubound(heading)+1) + &quot;)&quot; MsgBox (getTranslation(&quot;TOCErrorContentsNotMatchHeadings1&quot;) &amp; &quot; &quot; &amp; level &amp; &quot; (&quot; &amp; (Ubound(outline)+1) &amp; getTranslation(&quot;TOCErrorContentsNotMatchHeadings2&quot;) &amp; &quot; &quot; &amp; level &amp; &quot; &quot; &amp; getTranslation(&quot;TOCErrorContentsNotMatchHeadings3&quot;) &amp; (Ubound(heading)+1) &amp; &quot;)&quot;
EndIf EndIf
ElseIf Ubound(outline) = -1 Then ElseIf Ubound(outline) = -1 Then
&apos;MsgBox (&quot;Не могу сделать ссылки в оглавлении. Оглавлений &quot;+ level + &quot; уровня не найдено.&quot;) MsgBox (getTranslation(&quot;TOCErrorNoContents1&quot;) &amp; &quot; &quot; &amp; level &amp; &quot; &quot; &amp; getTranslation(&quot;TOCErrorNoContents2&quot;))
ElseIf Ubound(heading) = -1 Then ElseIf Ubound(heading) = -1 Then
MsgBox (&quot;Не могу сделать ссылки в оглавлении. Заголовоков &quot;+ level + &quot; уровня не найдено.&quot;) MsgBox (getTranslation(&quot;TOCErrorNoHeadings1&quot;) &amp; &quot; &quot; &amp; level &amp; &quot; &quot; &amp; getTranslation(&quot;TOCErrorNoHeadings2&quot;))
EndIf EndIf
End Sub End Sub
@ -127,7 +127,6 @@ Function getOutlineWithLevel(curNum)
Wend Wend
Next i Next i
Else Else
Mri enum1Element
EndIf EndIf
Wend Wend
getOutlineWithLevel = par() getOutlineWithLevel = par()

View file

@ -0,0 +1,105 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Translations" script:language="StarBasic" script:moduleType="normal">Function getTranslation(identifier As String) As String
Globalscope.BasicLibraries.LoadLibrary( &quot;Tools&quot; )
Dim lang As String
lang = GetStarOfficeLocale().Language
Select Case lang
Case &quot;ru&quot;
getTranslation = getRussian(identifier)
Exit Function
Case Else
getTranslation = getEnglish(identifier)
Exit Function
End Select
End Function
Function getRussian(identifier As String) As String
Select Case identifier
Case &quot;buttonOk&quot;
getRussian = &quot;Применить&quot;
Exit Function
Case &quot;buttonCancel&quot;
getRussian = &quot;Отмена&quot;
Exit Function
Case &quot;configText1&quot;
getRussian = &quot;Введите в поле число от 0 до 10&quot;
Exit Function
Case &quot;configText2&quot;
getRussian = &quot;0 - возврат к автоматической нумерации&quot;
Exit Function
Case &quot;configText3&quot;
getRussian = &quot;Начать нумерацию сноско заново&quot;
Exit Function
Case &quot;configText4&quot;
getRussian = &quot;после заголовков&quot;
Exit Function
Case &quot;configText5&quot;
getRussian = &quot;уровня&quot;
Exit Function
Case &quot;footnotesConfigDialogTitle&quot;
getRussian = &quot;Применение нумерации сносок&quot;
Exit Function
Case &quot;statusNumberingInProcess&quot;
getRussian = &quot;Производится нумерация сносок&quot;
Exit Function
Case &quot;numberingInputOutOfRange&quot;
getRussian = &quot;Введенное число вне допустимого диапазона. Введите число от 0 до 10.&quot;
Exit Function
Case &quot;statusNumberingFinished&quot;
getRussian = &quot;Нумерация сносок успешно завершена.&quot;
Exit Function
Case &quot;replaceParaStyleDialogTitle&quot;
getRussian = &quot;Заменить стиль параграфа (с удалением) на выбранный стиль&quot;
Exit Function
Case Else
getRussian = &quot;Перевод не найден&quot;
End Select
End Function
Function getEnglish(identifier As String) As String
Select Case identifier
Case &quot;buttonOk&quot;
getEnglish = &quot;Apply&quot;
Exit Function
Case &quot;buttonCancel&quot;
getEnglish = &quot;Cancel&quot;
Exit Function
Case &quot;configText1&quot;
getEnglish = &quot;Insert 0 to 10 number in the field below&quot;
Exit Function
Case &quot;configText2&quot;
getEnglish = &quot;0 return to automatic numbering &quot;
Exit Function
Case &quot;configText3&quot;
getEnglish = &quot;Restart footnote numbering&quot;
Exit Function
Case &quot;configText4&quot;
getEnglish = &quot;after heading with&quot;
Exit Function
Case &quot;configText5&quot;
getEnglish = &quot;level&quot;
Exit Function
Case &quot;footnotesConfigDialogTitle&quot;
getEnglish = &quot;Apply footnotes numbering&quot;
Exit Function
Case &quot;statusNumberingInProcess&quot;
getEnglish = &quot;Numbering in process&quot;
Exit Function
Case &quot;numberingInputOutOfRange&quot;
getEnglish = &quot;Input is out of range. Insert number from 0 to 10.&quot;
Exit Function
Case &quot;statusNumberingFinished&quot;
getEnglish = &quot;Footnotes numbering finished successfully.&quot;
Exit Function
Case &quot;replaceParaStyleDialogTitle&quot;
getEnglish = &quot;Replace paragraph style (with removal) by choosen one&quot;
Exit Function
Case Else
getEnglish = &quot;No translation&quot;
End Select
End Function
</script:module>

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="journals" script:language="StarBasic">Private sub journalsMark7 <script:module xmlns:script="http://openoffice.org/2000/script" script:name="journals" script:language="StarBasic">Private sub journalsMark10
End sub End sub
Dim templateName As String Dim templateName As String
@ -25,7 +25,7 @@ Private Sub makeUpIssue
Dim tmp As String Dim tmp As String
Dim nSections As Long Dim nSections As Long
description = &quot;Вы уверены, что хотите запустить сборку выпуска ?&quot; description = getTranslation(&quot;complileJournalIssueConfirmation&quot;)
If NOT confirm(description) Then If NOT confirm(description) Then
Exit Sub Exit Sub
EndIf EndIf
@ -42,7 +42,7 @@ Private Sub makeUpIssue
&apos;Exit if no sections in document or document not saved &apos;Exit if no sections in document or document not saved
If oFilename = &quot;&quot; Then If oFilename = &quot;&quot; Then
MsgBox &quot;Сначала сохраните выпуск в папке с файлами статьей&quot; MsgBox getTranslation(&quot;compileJournalIssueNoCurFilename&quot;)
Exit Sub Exit Sub
End If End If
@ -63,7 +63,7 @@ Private Sub makeUpIssue
firstPage = page firstPage = page
oViewCursor.jumpToPage(page) oViewCursor.jumpToPage(page)
oTextCursor = oViewCursor.Text.createTextCursorByRange(oViewCursor) oTextCursor = oViewCursor.Text.createTextCursorByRange(oViewCursor)
statusIndicator.Start(&quot;Сборка выпуска начата, подождите&quot;,30) statusIndicator.Start(getTranslation(&quot;compileJournalIssueStatusInProgerss&quot;),30)
For i = 1 To 25 For i = 1 To 25
&apos;Find section file &apos;Find section file
FilePath = findArticleFile(path,i) FilePath = findArticleFile(path,i)
@ -138,7 +138,7 @@ Private Sub makeUpIssue
&apos;ThisComponent.FootnoteSettings.FootnoteCounting=1 &apos;ThisComponent.FootnoteSettings.FootnoteCounting=1
&apos;setHeadingsOutlineLevels &apos;setHeadingsOutlineLevels
statusIndicator.end() statusIndicator.end()
MsgBox &quot;Сборка выпуска завершена.&quot; MsgBox getTranslation(&quot;compileJournalIssueFinished&quot;)
End Sub End Sub
Private Sub setPageNumbers() Private Sub setPageNumbers()
@ -197,7 +197,7 @@ Private Function lastPageNum(i As Integer)
Exit Do Exit Do
End If End If
If curPageNum = 0 Then If curPageNum = 0 Then
MsgBox &quot;Произошла ошибка при нахождении последней страницы статьи&quot; MsgBox getTranslation(&quot;lastPageNumNotFound&quot;)
Exit Do Exit Do
End If End If
@ -222,7 +222,7 @@ Private Function getUDK()
getFirstTextInStyle(&quot;УДК&quot;) getFirstTextInStyle(&quot;УДК&quot;)
foundUDK = oViewCursor.Text.createTextCursorByRange(oViewCursor).getString() foundUDK = oViewCursor.Text.createTextCursorByRange(oViewCursor).getString()
If foundUDK = &quot;&quot; Then If foundUDK = &quot;&quot; Then
getUDK = &quot;Задать УДК&quot; getUDK = getTranslation(&quot;compileJournalIssueSetUDKDummyText&quot;)
Else Else
getUDK = foundUDK getUDK = foundUDK
backspace backspace
@ -262,7 +262,7 @@ Private Function getCopyright()
oViewCursor.goToRange(oSavePosition, false) oViewCursor.goToRange(oSavePosition, false)
Exit Function Exit Function
Else Else
getCopyright = &quot;© &quot; + &quot;Фамилия И.О.&quot; getCopyright = getTranslation(&quot;compileJournalIssueCopyrightDummyText&quot;)
EndIf EndIf
End If End If
oViewCursor.goToRange(oSavePosition, false) oViewCursor.goToRange(oSavePosition, false)
@ -279,7 +279,7 @@ Private Function getAuthor()
If authors &lt;&gt; &quot;&quot; Then If authors &lt;&gt; &quot;&quot; Then
getAuthor = authors getAuthor = authors
Else Else
getAuthor = &quot;Фамилия И.О.&quot; getAuthor = getTranslation(&quot;compileJournalIssueAuthorDummyText&quot;)
End If End If
oViewCursor.goToRange(oSavePosition, false) oViewCursor.goToRange(oSavePosition, false)
End Function End Function
@ -295,7 +295,7 @@ Private Function getArticleHeader()
If articleHeader &lt;&gt; &quot;&quot; Then If articleHeader &lt;&gt; &quot;&quot; Then
getArticleHeader = articleHeader getArticleHeader = articleHeader
Else Else
getArticleHeader = &quot;Название статьи&quot; getArticleHeader = getTranslation(&quot;compileJournalIssueArticleTitleDummyText&quot;)
End If End If
oViewCursor.goToRange(oSavePosition, false) oViewCursor.goToRange(oSavePosition, false)
End Function End Function
@ -306,7 +306,7 @@ Private Function getSectionX(section As String)
Dim startPage As String Dim startPage As String
Dim endPage As String Dim endPage As String
If section = &quot;&quot; Then If section = &quot;&quot; Then
section = &quot;Задайте название радела!&quot; section = getTranslation(&quot;compileJournalIssueSectionDummyText&quot;)
End If End If
oViewCursor = ThisComponent.CurrentController.getViewCursor() oViewCursor = ThisComponent.CurrentController.getViewCursor()
startPage = oViewcursor.getPage() startPage = oViewcursor.getPage()
@ -448,7 +448,7 @@ Private Sub setDefaultFirstPageMetadata(curStyle As Object,i As Integer)
insertUserField(oViewCursor,&quot;article&quot; + i + &quot;LastPage&quot;,&quot;00&quot; ) insertUserField(oViewCursor,&quot;article&quot; + i + &quot;LastPage&quot;,&quot;00&quot; )
&apos;Footer without table &apos;Footer without table
oViewCursor.goToRange(curStyle.FooterText.End, false) oViewCursor.goToRange(curStyle.FooterText.End, false)
insertUserField(oViewCursor,&quot;author&quot; + i + &quot;Copyright&quot;,&quot;© Фамилия И.О. &quot; + i ) insertUserField(oViewCursor,&quot;author&quot; + i + &quot;Copyright&quot;,getTranslation(&quot;compileJournalIssueCopyrightDummyText&quot;) &amp; i )
End Sub End Sub
@ -479,7 +479,7 @@ Private Sub setPHAFirstPageMetadata(curStyle As Object,i As Integer)
insertUserField(oViewCursor,&quot;article&quot; + i + &quot;LastPage&quot;,&quot;00&quot; ) insertUserField(oViewCursor,&quot;article&quot; + i + &quot;LastPage&quot;,&quot;00&quot; )
oViewCursor.goToRange(curStyle.FooterText.End, false) oViewCursor.goToRange(curStyle.FooterText.End, false)
insertUserField(oViewCursor,&quot;author&quot; + i + &quot;Copyright&quot;,&quot;© Фамилия И.О. &quot; + i ) insertUserField(oViewCursor,&quot;author&quot; &amp; i &amp; &quot;Copyright&quot;,getTranslation(&quot;compileJournalIssueCopyrightDummyText&quot;) &amp; i )
End Sub End Sub
@ -499,10 +499,10 @@ Private Sub setEIFNFirstPageMetadata(curStyle,i)
oViewCursor.gotoEndOfLine(false) oViewCursor.gotoEndOfLine(false)
oViewCursor.goright(1,false) oViewCursor.goright(1,false)
oViewCursor.gotoEndOfLine(false) oViewCursor.gotoEndOfLine(false)
insertUserField(oViewCursor,&quot;article&quot; + i + &quot;LastPage&quot;,&quot;00&quot; ) insertUserField(oViewCursor,&quot;article&quot; &amp; i &amp; &quot;LastPage&quot;,&quot;00&quot; )
oViewCursor.goright(1,false) oViewCursor.goright(1,false)
&apos;Добавить УДК &apos;Добавить УДК
insertUserField(oViewCursor,&quot;article&quot; + i + &quot;UDK&quot;,&quot;УДК &quot;+ i + &quot;.&quot; + i) insertUserField(oViewCursor,&quot;article&quot; &amp; i &amp; &quot;UDK&quot;,&quot;УДК &quot;+ i + &quot;.&quot; + i)
&apos;rightHeaderCell &apos;rightHeaderCell
rightHeaderCell = oHeaderTable.getCellByPosition(1,0).getStart() rightHeaderCell = oHeaderTable.getCellByPosition(1,0).getStart()
@ -511,22 +511,22 @@ Private Sub setEIFNFirstPageMetadata(curStyle,i)
oViewCursor.gotoEndOfLine(false) oViewCursor.gotoEndOfLine(false)
oViewCursor.goright(1,false) oViewCursor.goright(1,false)
oViewCursor.gotoEndOfLine(false) oViewCursor.gotoEndOfLine(false)
insertUserField(oViewCursor,&quot;article&quot; + i + &quot;LastPage&quot;,&quot;00&quot; ) insertUserField(oViewCursor,&quot;article&quot; &amp; i &amp; &quot;LastPage&quot;,&quot;00&quot; )
&apos; go to page number 2nd place &apos; go to page number 2nd place
oViewCursor.goright(1,false) oViewCursor.goright(1,false)
oViewCursor.gotoEndOfLine(false) oViewCursor.gotoEndOfLine(false)
insertUserField(oViewCursor,&quot;article&quot; + i + &quot;Num&quot;,&quot;&quot; + i ) insertUserField(oViewCursor,&quot;article&quot; &amp; i * &quot;Num&quot;,&quot;&quot; &amp; i )
oFooterTableLeft = curStyle.FooterTextLeft.CreateEnumeration().nextElement oFooterTableLeft = curStyle.FooterTextLeft.CreateEnumeration().nextElement
rightHeaderCell = oFooterTableLeft.getCellByPosition(1,0).getStart() rightHeaderCell = oFooterTableLeft.getCellByPosition(1,0).getStart()
oViewCursor.goToRange(rightHeaderCell, false) oViewCursor.goToRange(rightHeaderCell, false)
insertUserField(oViewCursor,&quot;author&quot; + i + &quot;Copyright&quot;,&quot;© Фамилия И.О. &quot; + i ) insertUserField(oViewCursor,&quot;author&quot; &amp; i &amp; &quot;Copyright&quot;,getTranslation(&quot;compileJournalIssueCopyrightDummyText&quot;) &amp; i )
&apos;TODO!!!!SECOND PAGE &apos;TODO!!!!SECOND PAGE
oFooterTableRight = curStyle.FooterTextRight.CreateEnumeration().nextElement oFooterTableRight = curStyle.FooterTextRight.CreateEnumeration().nextElement
leftHeaderCell = oFooterTableRight.getCellByPosition(0,0).getStart() leftHeaderCell = oFooterTableRight.getCellByPosition(0,0).getStart()
oViewCursor.goToRange(leftHeaderCell, false) oViewCursor.goToRange(leftHeaderCell, false)
insertUserField(oViewCursor,&quot;author&quot; + i + &quot;Copyright&quot;,&quot;© Фамилия И.О. &quot; + i ) insertUserField(oViewCursor,&quot;author&quot; &amp; i &amp; &quot;Copyright&quot;,getTranslation(&quot;compileJournalIssueCopyrightDummyText&quot;) &amp; i )
End Sub End Sub
@ -545,7 +545,7 @@ Private Sub setAritclePageHeaders(i)
oViewCursor = ThisComponent.CurrentController.getViewCursor() oViewCursor = ThisComponent.CurrentController.getViewCursor()
oSavePosition = oViewCursor.Text.createTextCursorByRange(oViewCursor) oSavePosition = oViewCursor.Text.createTextCursorByRange(oViewCursor)
pageStyles = ThisComponent.StyleFamilies.getByName(&quot;PageStyles&quot;) pageStyles = ThisComponent.StyleFamilies.getByName(&quot;PageStyles&quot;)
page = findFirstPageNumberWithStyle(&quot;Статья &quot; + i + &quot; стр.1&quot;) page = findFirstPageNumberWithStyle(&quot;Статья &quot; &amp; i &amp; &quot; стр.1&quot;)
oViewCursor.jumpToPage(page) oViewCursor.jumpToPage(page)
articleStartPosition = oViewCursor.Text.createTextCursorByRange(oViewCursor) articleStartPosition = oViewCursor.Text.createTextCursorByRange(oViewCursor)
@ -573,11 +573,11 @@ Private Sub setAritclePageHeaders(i)
rightHeaderCell = rightHeaderTable.getCellByPosition(0,0).getStart() rightHeaderCell = rightHeaderTable.getCellByPosition(0,0).getStart()
oViewCursor.goToRange(rightHeaderCell, false) oViewCursor.goToRange(rightHeaderCell, false)
If templateName = &quot;&quot; Then If templateName = &quot;&quot; Then
insertUserField(oViewCursor,&quot;rightHeader&quot; + i ,&quot;Фамилия И.О. Название статьи&quot; + i ) insertUserField(oViewCursor,&quot;rightHeader&quot; &amp; i ,&quot;Фамилия И.О. Название статьи&quot; &amp; i )
ElseIf templateName = PHA Then ElseIf templateName = PHA Then
insertUserField(oViewCursor,&quot;rightHeader&quot; + i ,&quot;Фамилия И.О. Название статьи&quot; + i ) insertUserField(oViewCursor,&quot;rightHeader&quot; &amp; i ,&quot;Фамилия И.О. Название статьи&quot; &amp; i )
ElseIf templateName = EIFN Then ElseIf templateName = EIFN Then
insertUserField(oViewCursor,&quot;rightHeader&quot; + i ,&quot;Название статьи &quot; + i ) insertUserField(oViewCursor,&quot;rightHeader&quot; &amp; i ,&quot;Название статьи &quot; + i )
rightHeaderCell = rightHeaderTable.getCellByPosition(2,0).getStart() rightHeaderCell = rightHeaderTable.getCellByPosition(2,0).getStart()
oViewCursor.goToRange(rightHeaderCell, false) oViewCursor.goToRange(rightHeaderCell, false)
insertLinkedImage(CStr(i),&quot;headerImageRight&quot;) insertLinkedImage(CStr(i),&quot;headerImageRight&quot;)
@ -588,15 +588,15 @@ Private Sub setAritclePageHeaders(i)
If templateName = &quot;&quot; Then If templateName = &quot;&quot; Then
leftHeaderCell = leftHeaderTable.getCellByPosition(1,0).getStart() leftHeaderCell = leftHeaderTable.getCellByPosition(1,0).getStart()
oViewCursor.goToRange(leftHeaderCell, false) oViewCursor.goToRange(leftHeaderCell, false)
insertUserField(oViewCursor,&quot;leftHeader&quot; + i ,&quot;Название раздела&quot; + i ) insertUserField(oViewCursor,&quot;leftHeader&quot; &amp; i ,&quot;Название раздела&quot; &amp; i )
ElseIf templateName = PHA Then ElseIf templateName = PHA Then
leftHeaderCell = leftHeaderTable.getCellByPosition(1,0).getStart() leftHeaderCell = leftHeaderTable.getCellByPosition(1,0).getStart()
oViewCursor.goToRange(leftHeaderCell, false) oViewCursor.goToRange(leftHeaderCell, false)
insertUserField(oViewCursor,&quot;leftHeader&quot; + i ,&quot;Название раздела&quot; + i ) insertUserField(oViewCursor,&quot;leftHeader&quot; &amp; i ,&quot;Название раздела&quot; &amp; i )
ElseIf templateName = EIFN Then ElseIf templateName = EIFN Then
leftHeaderCell = leftHeaderTable.getCellByPosition(2,0).getStart() leftHeaderCell = leftHeaderTable.getCellByPosition(2,0).getStart()
oViewCursor.goToRange(leftHeaderCell, false) oViewCursor.goToRange(leftHeaderCell, false)
insertUserField(oViewCursor,&quot;leftHeader&quot; + i ,&quot;И.О. Фамилия&quot; + i ) insertUserField(oViewCursor,&quot;leftHeader&quot; &amp; i ,&quot;И.О. Фамилия&quot; &amp; i )
leftHeaderCell = leftHeaderTable.getCellByPosition(0,0).getStart() leftHeaderCell = leftHeaderTable.getCellByPosition(0,0).getStart()
oViewCursor.goToRange(leftHeaderCell, false) oViewCursor.goToRange(leftHeaderCell, false)
insertLinkedImage(CStr(i),&quot;headerImageLeft&quot;) insertLinkedImage(CStr(i),&quot;headerImageLeft&quot;)

View file

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE dlg:window PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "dialog.dtd"> <!DOCTYPE dlg:window PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "dialog.dtd">
<dlg:window xmlns:dlg="http://openoffice.org/2000/dialog" xmlns:script="http://openoffice.org/2000/script" dlg:id="selectMenu" dlg:left="14" dlg:top="7" dlg:width="182" dlg:height="308" dlg:closeable="true" dlg:moveable="true" dlg:title="Дваждый кликните на выбранный элемент"> <dlg:window xmlns:dlg="http://openoffice.org/2000/dialog" xmlns:script="http://openoffice.org/2000/script" dlg:id="selectMenu" dlg:left="14" dlg:top="7" dlg:width="236" dlg:height="308" dlg:closeable="true" dlg:moveable="true" dlg:title="Дваждый кликните на выбранный элемент">
<dlg:bulletinboard> <dlg:bulletinboard>
<dlg:menulist dlg:id="ListBox1" dlg:tab-index="0" dlg:left="0" dlg:top="3" dlg:width="181" dlg:height="306"> <dlg:menulist dlg:id="ListBox1" dlg:tab-index="0" dlg:left="0" dlg:top="3" dlg:width="234" dlg:height="306">
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:ePublishing.Archive.onSelectMenuItem?language=Basic&amp;location=application" script:language="Script"/> <script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:ePublishing.Archive.onSelectMenuItem?language=Basic&amp;location=application" script:language="Script"/>
</dlg:menulist> </dlg:menulist>
</dlg:bulletinboard> </dlg:bulletinboard>

View file

@ -10,4 +10,5 @@
<library:element library:name="Archive"/> <library:element library:name="Archive"/>
<library:element library:name="MakeUp"/> <library:element library:name="MakeUp"/>
<library:element library:name="PageStyles"/> <library:element library:name="PageStyles"/>
<library:element library:name="Translations"/>
</library:library> </library:library>

BIN
translations.ods Normal file

Binary file not shown.