From 408838e52900c26824a3e7ace5e4e08982686404 Mon Sep 17 00:00:00 2001 From: Jean-Pierre Ledure Date: Wed, 8 Dec 2021 11:58:20 +0100 Subject: ScriptForge - (SF_Utils) language may have a length > 2 in locales The vaste majority of language codes are 2 characters long. However it is not the norm. A length of 3 is admitted for less spread languages Change-Id: Iabdf6a6cf453169419d0a4a7a3ab6ea80ae4753e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126531 Tested-by: Jean-Pierre Ledure Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure --- wizards/source/scriptforge/SF_Utils.xba | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wizards/source/scriptforge/SF_Utils.xba b/wizards/source/scriptforge/SF_Utils.xba index b3031e33f09a..2968209aafb3 100644 --- a/wizards/source/scriptforge/SF_Utils.xba +++ b/wizards/source/scriptforge/SF_Utils.xba @@ -425,7 +425,7 @@ Dim vNodePath As Variant vNodePath(0) = New com.sun.star.beans.PropertyValue vNodePath(0).Name = "nodepath" : vNodePath(0).Value = "org.openoffice.System/L10N" sLocale = oConfigProvider.createInstanceWithArguments("com.sun.star.configuration.ConfigurationAccess", vNodePath()).getByName("SystemLocale") - .Locale.Language = Left(sLocale, 2) + .Locale.Language = Split(sLocale, "-")(0) ' Language is most often 2 chars long, but not always .Locale.Country = Right(sLocale, 2) End If Set _GetUNOService = .Locale -- cgit