summaryrefslogtreecommitdiff
path: root/wizards/source/scriptforge/SF_Services.xba
diff options
context:
space:
mode:
Diffstat (limited to 'wizards/source/scriptforge/SF_Services.xba')
-rw-r--r--wizards/source/scriptforge/SF_Services.xba19
1 files changed, 11 insertions, 8 deletions
diff --git a/wizards/source/scriptforge/SF_Services.xba b/wizards/source/scriptforge/SF_Services.xba
index 4bd57c9e1b64..9533a4741b23 100644
--- a/wizards/source/scriptforge/SF_Services.xba
+++ b/wizards/source/scriptforge/SF_Services.xba
@@ -535,16 +535,17 @@ Dim sEncoding As String ' Alias for Encoding
Check:
If IsMissing(pvArgs) Then pvArgs = Array()
- If UBound(pvArgs) < 0 Then
- sPOFile = ""
- sEncoding = ""
- Else
- If Not SF_Utils._ValidateFile(pvArgs(0), "Folder (Arg0)") Then GoTo Catch
+ sPOFile = ""
+ sEncoding = ""
+ If UBound(pvArgs) >= 0 Then
+ If Not SF_Utils._ValidateFile(pvArgs(0), "Folder (Arg0)", , True) Then GoTo Catch
sFolderName = pvArgs(0)
+ sLocale = ""
If UBound(pvArgs) >= 1 Then
If Not SF_Utils._Validate(pvArgs(1), "Locale (Arg1)", V_STRING) Then GoTo Catch
sLocale = pvArgs(1)
- Else
+ End If
+ If Len(sLocale) = 0 Then ' Called from Python, the Locale argument may be the zero-length string
Set oLocale = SF_Utils._GetUNOService("Locale")
sLocale = oLocale.Language & "-" & oLocale.Country
End If
@@ -554,8 +555,10 @@ Check:
Else
sEncoding = "UTF-8"
End If
- sPOFile = SF_FileSystem.BuildPath(sFolderName, sLocale & ".po")
- If Not SF_FileSystem.FileExists(sPOFile) Then GoTo CatchNotExists
+ If Len(sFolderName) > 0 Then
+ sPOFile = SF_FileSystem.BuildPath(sFolderName, sLocale & ".po")
+ If Not SF_FileSystem.FileExists(sPOFile) Then GoTo CatchNotExists
+ End If
End If
Try: