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

View file

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

View file

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

View file

@ -1,17 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!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:styles>
<dlg:style dlg:style-id="0" dlg:border="none"/>
</dlg:styles>
<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: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="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="Label7" dlg:tab-index="10" dlg:left="17" dlg:top="28" dlg:width="122" dlg:height="10" dlg:value="0 - возврат к стандартной нумерации"/>
<dlg:numericfield dlg:id="level" dlg:tab-index="6" dlg:left="77" dlg:top="55" dlg:width="17" dlg:height="10"/>
<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: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:window>

View file

@ -7,18 +7,18 @@ Private Sub convertHyphInDoc()
Dim description As String
Dim allNotes As Object
dim aNote As Object
description = &quot;Запустить конвертацию автоматических переносов в ручные?&quot;
description = getTranslation(&quot;hyphenationConfirmation&quot;)
If NOT confirm(description) Then
Exit Sub
EndIf
Dim statusIndicator as Object
statusIndicator = ThisComponent.getCurrentController.StatusIndicator
statusIndicator.Start(&quot;Произвожу конвертацию, подождите&quot;,10)
statusIndicator.Start(getTranslation(&quot;hyphenationsInProgress&quot;),10)
turnOffTracking
AcceptAllTrackedChanges
convertHyphInText(ThisComponent.Text)
&apos; Globalscope.BasicLibraries.LoadLibrary( &quot;MRILib&quot; )
statusIndicator.Start(&quot;Произвожу конвертацию, подождите&quot;,70)
statusIndicator.Start(getTranslation(&quot;hyphenationsInProgress&quot;),70)
allNotes = ThisComponent.FootNotes
For x = 0 to allNotes.Count -1
aNote = allNotes.getByIndex(x)
@ -26,7 +26,7 @@ Private Sub convertHyphInDoc()
Next
&apos;disableAutoHyph()
statusIndicator.end()
MsgBox &quot;Конвертация переносов успешно завершена.&quot;
MsgBox getTranslation(&quot;hyphenationsSuccess&quot;)
End Sub
@ -153,7 +153,7 @@ Private Sub verifyHyphenation(lineEnds() As Object)
For i = (Lbound(lineEnds)) To (Ubound(lineEnds))
vCurs.goToRange(lineEnds(i),false)
If NOT (vCurs.isAtEndOfLine() OR vCurs.isAtStartOfLine()) Then
MsgBox &quot;Конвертация прервана. Обратитесь к разработчику.&quot;
MsgBox getTranslation(&quot;hyphenationsFailed&quot;)
Stop
EndIf
Next i
@ -200,7 +200,7 @@ Private Sub replaceHyphen(tCurs As Object,lineNumber As Integer)
EndIf
EndIf
If vCurs.isAtEndOfLine() = false AND vCurs.isAtStartOfLine() = false Then
MsgBox &quot;Конвертация переносов не выполнена. Алгоритм нуждается в доработке. Обратитесь к разработчику.&quot;
MsgBox getTranslation(&quot;hyphenationsFailed&quot;)
Stop
EndIf
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(outline) + 1) MOD (Ubound(heading) + 1 ) = 0 Then
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
createAnchor(heading(i Mod (Ubound(heading) + 1)),oAnchor2Name)
EndIf
createLink(outline(i),&quot;&quot;,oAnchor2Name)
Next i
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
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
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
End Sub
@ -127,7 +127,6 @@ Function getOutlineWithLevel(curNum)
Wend
Next i
Else
Mri enum1Element
EndIf
Wend
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"?>
<!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
Dim templateName As String
@ -25,7 +25,7 @@ Private Sub makeUpIssue
Dim tmp As String
Dim nSections As Long
description = &quot;Вы уверены, что хотите запустить сборку выпуска ?&quot;
description = getTranslation(&quot;complileJournalIssueConfirmation&quot;)
If NOT confirm(description) Then
Exit Sub
EndIf
@ -42,7 +42,7 @@ Private Sub makeUpIssue
&apos;Exit if no sections in document or document not saved
If oFilename = &quot;&quot; Then
MsgBox &quot;Сначала сохраните выпуск в папке с файлами статьей&quot;
MsgBox getTranslation(&quot;compileJournalIssueNoCurFilename&quot;)
Exit Sub
End If
@ -63,7 +63,7 @@ Private Sub makeUpIssue
firstPage = page
oViewCursor.jumpToPage(page)
oTextCursor = oViewCursor.Text.createTextCursorByRange(oViewCursor)
statusIndicator.Start(&quot;Сборка выпуска начата, подождите&quot;,30)
statusIndicator.Start(getTranslation(&quot;compileJournalIssueStatusInProgerss&quot;),30)
For i = 1 To 25
&apos;Find section file
FilePath = findArticleFile(path,i)
@ -138,7 +138,7 @@ Private Sub makeUpIssue
&apos;ThisComponent.FootnoteSettings.FootnoteCounting=1
&apos;setHeadingsOutlineLevels
statusIndicator.end()
MsgBox &quot;Сборка выпуска завершена.&quot;
MsgBox getTranslation(&quot;compileJournalIssueFinished&quot;)
End Sub
Private Sub setPageNumbers()
@ -197,7 +197,7 @@ Private Function lastPageNum(i As Integer)
Exit Do
End If
If curPageNum = 0 Then
MsgBox &quot;Произошла ошибка при нахождении последней страницы статьи&quot;
MsgBox getTranslation(&quot;lastPageNumNotFound&quot;)
Exit Do
End If
@ -222,7 +222,7 @@ Private Function getUDK()
getFirstTextInStyle(&quot;УДК&quot;)
foundUDK = oViewCursor.Text.createTextCursorByRange(oViewCursor).getString()
If foundUDK = &quot;&quot; Then
getUDK = &quot;Задать УДК&quot;
getUDK = getTranslation(&quot;compileJournalIssueSetUDKDummyText&quot;)
Else
getUDK = foundUDK
backspace
@ -262,7 +262,7 @@ Private Function getCopyright()
oViewCursor.goToRange(oSavePosition, false)
Exit Function
Else
getCopyright = &quot;© &quot; + &quot;Фамилия И.О.&quot;
getCopyright = getTranslation(&quot;compileJournalIssueCopyrightDummyText&quot;)
EndIf
End If
oViewCursor.goToRange(oSavePosition, false)
@ -279,7 +279,7 @@ Private Function getAuthor()
If authors &lt;&gt; &quot;&quot; Then
getAuthor = authors
Else
getAuthor = &quot;Фамилия И.О.&quot;
getAuthor = getTranslation(&quot;compileJournalIssueAuthorDummyText&quot;)
End If
oViewCursor.goToRange(oSavePosition, false)
End Function
@ -295,7 +295,7 @@ Private Function getArticleHeader()
If articleHeader &lt;&gt; &quot;&quot; Then
getArticleHeader = articleHeader
Else
getArticleHeader = &quot;Название статьи&quot;
getArticleHeader = getTranslation(&quot;compileJournalIssueArticleTitleDummyText&quot;)
End If
oViewCursor.goToRange(oSavePosition, false)
End Function
@ -306,7 +306,7 @@ Private Function getSectionX(section As String)
Dim startPage As String
Dim endPage As String
If section = &quot;&quot; Then
section = &quot;Задайте название радела!&quot;
section = getTranslation(&quot;compileJournalIssueSectionDummyText&quot;)
End If
oViewCursor = ThisComponent.CurrentController.getViewCursor()
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; )
&apos;Footer without table
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
@ -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; )
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
@ -499,10 +499,10 @@ Private Sub setEIFNFirstPageMetadata(curStyle,i)
oViewCursor.gotoEndOfLine(false)
oViewCursor.goright(1,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)
&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
rightHeaderCell = oHeaderTable.getCellByPosition(1,0).getStart()
@ -511,22 +511,22 @@ Private Sub setEIFNFirstPageMetadata(curStyle,i)
oViewCursor.gotoEndOfLine(false)
oViewCursor.goright(1,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
oViewCursor.goright(1,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
rightHeaderCell = oFooterTableLeft.getCellByPosition(1,0).getStart()
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
oFooterTableRight = curStyle.FooterTextRight.CreateEnumeration().nextElement
leftHeaderCell = oFooterTableRight.getCellByPosition(0,0).getStart()
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
@ -545,7 +545,7 @@ Private Sub setAritclePageHeaders(i)
oViewCursor = ThisComponent.CurrentController.getViewCursor()
oSavePosition = oViewCursor.Text.createTextCursorByRange(oViewCursor)
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)
articleStartPosition = oViewCursor.Text.createTextCursorByRange(oViewCursor)
@ -573,11 +573,11 @@ Private Sub setAritclePageHeaders(i)
rightHeaderCell = rightHeaderTable.getCellByPosition(0,0).getStart()
oViewCursor.goToRange(rightHeaderCell, false)
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
insertUserField(oViewCursor,&quot;rightHeader&quot; + i ,&quot;Фамилия И.О. Название статьи&quot; + i )
insertUserField(oViewCursor,&quot;rightHeader&quot; &amp; i ,&quot;Фамилия И.О. Название статьи&quot; &amp; i )
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()
oViewCursor.goToRange(rightHeaderCell, false)
insertLinkedImage(CStr(i),&quot;headerImageRight&quot;)
@ -588,15 +588,15 @@ Private Sub setAritclePageHeaders(i)
If templateName = &quot;&quot; Then
leftHeaderCell = leftHeaderTable.getCellByPosition(1,0).getStart()
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
leftHeaderCell = leftHeaderTable.getCellByPosition(1,0).getStart()
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
leftHeaderCell = leftHeaderTable.getCellByPosition(2,0).getStart()
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()
oViewCursor.goToRange(leftHeaderCell, false)
insertLinkedImage(CStr(i),&quot;headerImageLeft&quot;)

View file

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!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: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"/>
</dlg:menulist>
</dlg:bulletinboard>

View file

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

BIN
translations.ods Normal file

Binary file not shown.