[Libreoffice-commits] online.git: ios/Mobile

Tor Lillqvist (via logerrit) logerrit at kemper.freedesktop.org
Thu Oct 10 16:47:27 UTC 2019


 ios/Mobile/TemplateCollectionViewController.mm |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit 1cf3bec303bc8b3d10e5dd673731906d3704b7b3
Author:     Tor Lillqvist <tml at collabora.com>
AuthorDate: Thu Oct 10 19:03:50 2019 +0300
Commit:     Tor Lillqvist <tml at collabora.com>
CommitDate: Thu Oct 10 19:35:30 2019 +0300

    tdf#123741: Call LibreOfficeKit::setLanguageTag() also when loading a template
    
    Sadly I have no understanding why not doing that caused such a
    mysterious end result. But I am glad I thought of trying this simple
    thing before spending any more time trying to understand what is going
    on.
    
    Change-Id: I129f8fffa32fa087e21c444f9657394de0e255a1

diff --git a/ios/Mobile/TemplateCollectionViewController.mm b/ios/Mobile/TemplateCollectionViewController.mm
index a31f3a655..153fefb6f 100644
--- a/ios/Mobile/TemplateCollectionViewController.mm
+++ b/ios/Mobile/TemplateCollectionViewController.mm
@@ -6,6 +6,10 @@
 // License, v. 2.0. If a copy of the MPL was not distributed with this
 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
+#define LIBO_INTERNAL_ONLY
+#include <comphelper/lok.hxx>
+#include <i18nlangtag/languagetag.hxx>
+
 #import "svtools/strings.hrc"
 
 #import <LibreOfficeKit/LibreOfficeKitInit.h>
@@ -137,9 +141,10 @@ static NSString *mapTemplateExtensionToActual(NSString *templateName) {
     NSURL *cacheDirectory = [NSFileManager.defaultManager URLsForDirectory:NSCachesDirectory inDomains:NSUserDomainMask][0];
     NSURL *newURL = [cacheDirectory URLByAppendingPathComponent:mapTemplateExtensionToActual(selectedTemplate.lastPathComponent)
                                                     isDirectory:NO];
-
     LibreOfficeKit *lo_kit = lok_init_2(nullptr, nullptr);
 
+    comphelper::LibreOfficeKit::setLanguageTag(LanguageTag(OUString::fromUtf8(OString([app_locale UTF8String])), true));
+
     // Load the template into LibreOffice core, save as the corresponding document type (with the
     // same basename), and then proceed to edit that.
 


More information about the Libreoffice-commits mailing list