diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-05-24 17:33:50 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-05-25 14:53:07 +0100 |
commit | da543e4efbb53e25a60f8557a0b8cd307e46ebf4 (patch) | |
tree | b973a6c31cf3432b9ed81ca0d9f40bf150a7fec0 /wizards/source/tools | |
parent | 264ac75d4ddba5ef35105689df3c51d45c259b17 (diff) |
convert starbasic wizards to .properties for translations
Change-Id: I165f85ee993995b54163061c7d378eea90eb276a
Diffstat (limited to 'wizards/source/tools')
-rw-r--r-- | wizards/source/tools/Misc.xba | 46 | ||||
-rw-r--r-- | wizards/source/tools/ModuleControls.xba | 12 | ||||
-rw-r--r-- | wizards/source/tools/UCB.xba | 4 |
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("Tools", "com") Then + If InitResources("Tools") Then ProductName = GetProductName() - sError = GetResText(1006) + sError = GetResText("RID_COMMON_6") sError = ReplaceString(sError, ProductName, "%PRODUCTNAME") sError = ReplaceString(sError, chr(13), "<BR>") 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("com.sun.star.configuration.ConfigurationProvider") - xResource = getProcessServiceManager().createInstanceWithArguments( "org.libreoffice.resource.ResourceIndexAccess", aArgs() ) - If (IsNull(xResource)) then + sOfficeDir = "$BRAND_BASE_DIR/$BRAND_SHARE_SUBDIR/wizards/" + sOfficeDir = GetDefaultContext.getByName("/singletons/com.sun.star.util.theMacroExpander").ExpandMacros(sOfficeDir) + aArgs(0) = sOfficeDir + aArgs(1) = true + aArgs(2) = GetStarOfficeLocale() + aArgs(3) = "resources" + aArgs(4) = "" + aArgs(5) = NULL + oResSrv = getProcessServiceManager().createInstanceWithArguments( "com.sun.star.resource.StringResourceWithLocation", aArgs() ) + If (IsNull(oResSrv)) then InitResources = FALSE MsgBox("could not initialize ResourceIndexAccess") Else InitResources = TRUE - oResSrv = xResource.getByName( "String" ) End If Exit Function ErrorOcurred: Dim nSolarVer InitResources = FALSE nSolarVer = GetSolarVersion() - MsgBox("Resource file missing (" & ShortDescription & trim(str(nSolarVer)) + "*.res)", 16, GetProductName()) + MsgBox("Resource file missing", 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(), "%PRODUCTNAME") Else GetResText = "" End If Exit Function ErrorOcurred: GetResText = "" - MsgBox("Resource with ID =" + str( nID ) + " not found!", 16, GetProductName()) + MsgBox("Resource with ID =" + sID + " not found!", 16, GetProductName()) Resume CLERROR CLERROR: End Function @@ -775,18 +783,18 @@ Dim ErrMsg as String oDocument = StarDesktop.LoadComponentFromURL(sUrl,"_default",0, NoArgs()) NOMODULEINSTALLED: If (Err <> 0) OR IsNull(oDocument) Then - If InitResources("", "com") Then + If InitResources("") Then Select Case sType Case "swriter" - ErrMsg = GetResText(1001) + ErrMsg = GetResText("RID_COMMON_1") Case "scalc" - ErrMsg = GetResText(1002) + ErrMsg = GetResText("RID_COMMON_2") Case "simpress" - ErrMsg = GetResText(1003) + ErrMsg = GetResText("RID_COMMON_3") Case "sdraw" - ErrMsg = GetResText(1004) + ErrMsg = GetResText("RID_COMMON_4") Case "smath" - ErrMsg = GetResText(1005) + ErrMsg = GetResText("RID_COMMON_5") Case Else ErrMsg = "Invalid Document Type!" 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(), "dbw") Then - QueryString = GetResText(507) + If InitResources(GetProductName()) Then + QueryString = GetResText("RID_COMMON_7") QueryString = ReplaceString(QueryString, ConvertFromUrl(FilePath), "<PATH>") If Len(QueryString) > 190 Then QueryString = DeleteStr(QueryString, ".<BR>") End If QueryString = ReplaceString(QueryString, chr(13), "<BR>") - lblYes = GetResText(508) - lblYesToAll = GetResText(509) - lblNo = GetResText(510) - lblCancel = GetResText(511) + lblYes = GetResText("RID_COMMON_8") + lblYesToAll = GetResText("RID_COMMON_9") + lblNo = GetResText("RID_COMMON_10") + lblCancel = GetResText("RID_COMMON_11") DlgOverwrite = LoadDialog("Tools", "DlgOverwriteAll") 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 <> 0 Then - If InitResources("", "dbw") Then - ErrMsg = GetResText(500) + If InitResources("") Then + ErrMsg = GetResText("RID_COMMON_0") ErrMsg = ReplaceString(ErrMsg, chr(13), "<BR>") ErrMsg = ReplaceString(ErrMsg, sNewFolder, "%1") Msgbox(ErrMsg, 48, GetProductName()) |