summaryrefslogtreecommitdiff
path: root/wizards/source/tools
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-05-24 17:33:50 +0100
committerCaolán McNamara <caolanm@redhat.com>2017-05-25 14:53:07 +0100
commitda543e4efbb53e25a60f8557a0b8cd307e46ebf4 (patch)
treeb973a6c31cf3432b9ed81ca0d9f40bf150a7fec0 /wizards/source/tools
parent264ac75d4ddba5ef35105689df3c51d45c259b17 (diff)
convert starbasic wizards to .properties for translations
Change-Id: I165f85ee993995b54163061c7d378eea90eb276a
Diffstat (limited to 'wizards/source/tools')
-rw-r--r--wizards/source/tools/Misc.xba46
-rw-r--r--wizards/source/tools/ModuleControls.xba12
-rw-r--r--wizards/source/tools/UCB.xba4
3 files changed, 35 insertions, 27 deletions
diff --git a/wizards/source/tools/Misc.xba b/wizards/source/tools/Misc.xba
index f5950afd1f18..d1b47172283c 100644
--- a/wizards/source/tools/Misc.xba
+++ b/wizards/source/tools/Misc.xba
@@ -276,9 +276,9 @@ Dim oLocResSrv as Object
If bResObjectexists Then
oLocResSrv = oResSrv
End If
- If InitResources(&quot;Tools&quot;, &quot;com&quot;) Then
+ If InitResources(&quot;Tools&quot;) Then
ProductName = GetProductName()
- sError = GetResText(1006)
+ sError = GetResText(&quot;RID_COMMON_6&quot;)
sError = ReplaceString(sError, ProductName, &quot;%PRODUCTNAME&quot;)
sError = ReplaceString(sError, chr(13), &quot;&lt;BR&gt;&quot;)
MsgBox(sError, 16, ProductName)
@@ -290,42 +290,50 @@ Dim oLocResSrv as Object
End Sub
-Function InitResources(Description, ShortDescription as String) as boolean
+Function InitResources(Description) as boolean
Dim xResource as Object
-Dim aArgs(0) as String
+Dim sOfficeDir as String
+Dim aArgs(5) as Any
On Error Goto ErrorOcurred
- aArgs(0) = ShortDescription
- oConfigProvider = createUnoService(&quot;com.sun.star.configuration.ConfigurationProvider&quot;)
- xResource = getProcessServiceManager().createInstanceWithArguments( &quot;org.libreoffice.resource.ResourceIndexAccess&quot;, aArgs() )
- If (IsNull(xResource)) then
+ sOfficeDir = &quot;$BRAND_BASE_DIR/$BRAND_SHARE_SUBDIR/wizards/&quot;
+ sOfficeDir = GetDefaultContext.getByName(&quot;/singletons/com.sun.star.util.theMacroExpander&quot;).ExpandMacros(sOfficeDir)
+ aArgs(0) = sOfficeDir
+ aArgs(1) = true
+ aArgs(2) = GetStarOfficeLocale()
+ aArgs(3) = &quot;resources&quot;
+ aArgs(4) = &quot;&quot;
+ aArgs(5) = NULL
+ oResSrv = getProcessServiceManager().createInstanceWithArguments( &quot;com.sun.star.resource.StringResourceWithLocation&quot;, aArgs() )
+ If (IsNull(oResSrv)) then
InitResources = FALSE
MsgBox(&quot;could not initialize ResourceIndexAccess&quot;)
Else
InitResources = TRUE
- oResSrv = xResource.getByName( &quot;String&quot; )
End If
Exit Function
ErrorOcurred:
Dim nSolarVer
InitResources = FALSE
nSolarVer = GetSolarVersion()
- MsgBox(&quot;Resource file missing (&quot; &amp; ShortDescription &amp; trim(str(nSolarVer)) + &quot;*.res)&quot;, 16, GetProductName())
+ MsgBox(&quot;Resource file missing&quot;, 16, GetProductName())
Resume CLERROR
CLERROR:
End Function
-Function GetResText( nID as integer ) As string
+Function GetResText( sID as String ) As string
+Dim sString as String
On Error Goto ErrorOcurred
If Not IsNull(oResSrv) Then
- GetResText = oResSrv.getByIndex( nID )
+ sString = oResSrv.resolveString(sID)
+ GetResText = ReplaceString(sString, GetProductname(), &quot;%PRODUCTNAME&quot;)
Else
GetResText = &quot;&quot;
End If
Exit Function
ErrorOcurred:
GetResText = &quot;&quot;
- MsgBox(&quot;Resource with ID =&quot; + str( nID ) + &quot; not found!&quot;, 16, GetProductName())
+ MsgBox(&quot;Resource with ID =&quot; + sID + &quot; not found!&quot;, 16, GetProductName())
Resume CLERROR
CLERROR:
End Function
@@ -775,18 +783,18 @@ Dim ErrMsg as String
oDocument = StarDesktop.LoadComponentFromURL(sUrl,&quot;_default&quot;,0, NoArgs())
NOMODULEINSTALLED:
If (Err &lt;&gt; 0) OR IsNull(oDocument) Then
- If InitResources(&quot;&quot;, &quot;com&quot;) Then
+ If InitResources(&quot;&quot;) Then
Select Case sType
Case &quot;swriter&quot;
- ErrMsg = GetResText(1001)
+ ErrMsg = GetResText(&quot;RID_COMMON_1&quot;)
Case &quot;scalc&quot;
- ErrMsg = GetResText(1002)
+ ErrMsg = GetResText(&quot;RID_COMMON_2&quot;)
Case &quot;simpress&quot;
- ErrMsg = GetResText(1003)
+ ErrMsg = GetResText(&quot;RID_COMMON_3&quot;)
Case &quot;sdraw&quot;
- ErrMsg = GetResText(1004)
+ ErrMsg = GetResText(&quot;RID_COMMON_4&quot;)
Case &quot;smath&quot;
- ErrMsg = GetResText(1005)
+ ErrMsg = GetResText(&quot;RID_COMMON_5&quot;)
Case Else
ErrMsg = &quot;Invalid Document Type!&quot;
End Select
diff --git a/wizards/source/tools/ModuleControls.xba b/wizards/source/tools/ModuleControls.xba
index 300b6eea6da6..059956cb1b55 100644
--- a/wizards/source/tools/ModuleControls.xba
+++ b/wizards/source/tools/ModuleControls.xba
@@ -335,17 +335,17 @@ Dim lblNo as String
Dim lblYesToAll as String
Dim lblCancel as String
Dim OverwriteModel as Object
- If InitResources(GetProductName(), &quot;dbw&quot;) Then
- QueryString = GetResText(507)
+ If InitResources(GetProductName()) Then
+ QueryString = GetResText(&quot;RID_COMMON_7&quot;)
QueryString = ReplaceString(QueryString, ConvertFromUrl(FilePath), &quot;&lt;PATH&gt;&quot;)
If Len(QueryString) &gt; 190 Then
QueryString = DeleteStr(QueryString, &quot;.&lt;BR&gt;&quot;)
End If
QueryString = ReplaceString(QueryString, chr(13), &quot;&lt;BR&gt;&quot;)
- lblYes = GetResText(508)
- lblYesToAll = GetResText(509)
- lblNo = GetResText(510)
- lblCancel = GetResText(511)
+ lblYes = GetResText(&quot;RID_COMMON_8&quot;)
+ lblYesToAll = GetResText(&quot;RID_COMMON_9&quot;)
+ lblNo = GetResText(&quot;RID_COMMON_10&quot;)
+ lblCancel = GetResText(&quot;RID_COMMON_11&quot;)
DlgOverwrite = LoadDialog(&quot;Tools&quot;, &quot;DlgOverwriteAll&quot;)
DlgOverwrite.Title = sTitle
OverwriteModel = DlgOverwrite.Model
diff --git a/wizards/source/tools/UCB.xba b/wizards/source/tools/UCB.xba
index 73d849cc8fea..d849a2ea3488 100644
--- a/wizards/source/tools/UCB.xba
+++ b/wizards/source/tools/UCB.xba
@@ -297,8 +297,8 @@ Dim oUcb as Object
CreateFolder = True
NOSPACEONDRIVE:
If Err &lt;&gt; 0 Then
- If InitResources(&quot;&quot;, &quot;dbw&quot;) Then
- ErrMsg = GetResText(500)
+ If InitResources(&quot;&quot;) Then
+ ErrMsg = GetResText(&quot;RID_COMMON_0&quot;)
ErrMsg = ReplaceString(ErrMsg, chr(13), &quot;&lt;BR&gt;&quot;)
ErrMsg = ReplaceString(ErrMsg, sNewFolder, &quot;%1&quot;)
Msgbox(ErrMsg, 48, GetProductName())