[Libreoffice-commits] online.git: 3 commits - ios/config.h.in ios/Mobile ios/Mobile.xcodeproj

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Dec 13 14:44:00 UTC 2018


 ios/Mobile.xcodeproj/project.pbxproj           |    6 +++++
 ios/Mobile/L10n.h                              |   13 +++++++++++
 ios/Mobile/L10n.mm                             |   28 +++++++++++++++++++++++++
 ios/Mobile/TemplateCollectionViewController.h  |    2 -
 ios/Mobile/TemplateCollectionViewController.mm |    7 +++---
 ios/config.h.in                                |    3 ++
 6 files changed, 54 insertions(+), 5 deletions(-)

New commits:
commit 600c3a8969f9613deb18ac501479675c38daef18
Author:     Tor Lillqvist <tml at collabora.com>
AuthorDate: Thu Dec 13 16:17:12 2018 +0200
Commit:     Tor Lillqvist <tml at collabora.com>
CommitDate: Thu Dec 13 16:17:12 2018 +0200

    Add a dummy VEREIGN_URL here, too
    
    Change-Id: I01f22ec18a2e56286520bb1f14fcd02bd43352cb

diff --git a/ios/config.h.in b/ios/config.h.in
index 0911b21fc..18ca58e4e 100644
--- a/ios/config.h.in
+++ b/ios/config.h.in
@@ -111,5 +111,8 @@
 /* Define to 1 if you have the ANSI C header files. */
 #define STDC_HEADERS 1
 
+/* Default value of per_documents.document_signing_url */
+#define VEREIGN_URL ""
+
 /* Version number of package */
 /* #undef VERSION */
commit f3f1b1e228e84074d05f1523ef66a7bd06427a8c
Author:     Tor Lillqvist <tml at collabora.com>
AuthorDate: Thu Dec 13 16:02:04 2018 +0200
Commit:     Tor Lillqvist <tml at collabora.com>
CommitDate: Thu Dec 13 16:14:42 2018 +0200

    Adapt to LibreOfficeKitClass no longer having the translateGet() method
    
    This is a somewhat temporary quick solution. It bluntly uses the same
    code here that I had added for a while as the implementation of
    translateGet() for LibreOfficeKitClass in LO core.
    
    Ideally we should have a script here in online to pick the needed
    translation from the translations submodule of core and keep them
    around even if a translation happens to evaporate from
    core/translations. The same idea as in the scripts/unocommands.py, but
    I did not yet start modifying or copying that.
    
    Change-Id: I455ad6044e321ef59873d60f8e5f3e7032f2447e

diff --git a/ios/Mobile.xcodeproj/project.pbxproj b/ios/Mobile.xcodeproj/project.pbxproj
index 5f5252c6e..7fcce4ae4 100644
--- a/ios/Mobile.xcodeproj/project.pbxproj
+++ b/ios/Mobile.xcodeproj/project.pbxproj
@@ -63,6 +63,7 @@
 		BEA2835D21498AD400848631 /* Socket.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BEA2835C21498AD400848631 /* Socket.cpp */; };
 		BEA28360214ACA8500848631 /* FakeSocket.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BEA2835F214ACA8500848631 /* FakeSocket.cpp */; };
 		BEA28377214FFD8C00848631 /* Unit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BEA28376214FFD8C00848631 /* Unit.cpp */; };
+		BEFB1EE121C29CC70081D757 /* L10n.mm in Sources */ = {isa = PBXBuildFile; fileRef = BEFB1EE021C29CC70081D757 /* L10n.mm */; };
 /* End PBXBuildFile section */
 
 /* Begin PBXFileReference section */
@@ -552,6 +553,8 @@
 		BEB6524E216FD0CA00B8C09A /* stream.cxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = stream.cxx; path = "../../ios-device/tools/source/stream/stream.cxx"; sourceTree = "<group>"; };
 		BEB6524F216FD0CA00B8C09A /* strmwnt.cxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = strmwnt.cxx; path = "../../ios-device/tools/source/stream/strmwnt.cxx"; sourceTree = "<group>"; };
 		BEB65250216FD0CA00B8C09A /* strmunx.cxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = strmunx.cxx; path = "../../ios-device/tools/source/stream/strmunx.cxx"; sourceTree = "<group>"; };
+		BEFB1EDF21C29CC70081D757 /* L10n.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = L10n.h; sourceTree = "<group>"; };
+		BEFB1EE021C29CC70081D757 /* L10n.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = L10n.mm; sourceTree = "<group>"; };
 /* End PBXFileReference section */
 
 /* Begin PBXFrameworksBuildPhase section */
@@ -1081,6 +1084,8 @@
 				BE8D77312136762500AC58EA /* DocumentViewController.mm */,
 				BE8D77332136762500AC58EA /* Document.h */,
 				BE8D77342136762500AC58EA /* Document.mm */,
+				BEFB1EDF21C29CC70081D757 /* L10n.h */,
+				BEFB1EE021C29CC70081D757 /* L10n.mm */,
 				BE80E45C21B6CEF100859C97 /* TemplateSectionHeaderView.h */,
 				BE80E45D21B6CEF200859C97 /* TemplateSectionHeaderView.m */,
 				BE80E45621B68F5000859C97 /* TemplateCollectionViewController.h */,
@@ -1457,6 +1462,7 @@
 				BE80E45E21B6CEF200859C97 /* TemplateSectionHeaderView.m in Sources */,
 				BE5EB5C3213FE29900E0826C /* Session.cpp in Sources */,
 				BE5EB5D22140039100E0826C /* LOOLWSD.cpp in Sources */,
+				BEFB1EE121C29CC70081D757 /* L10n.mm in Sources */,
 				BE5EB5C6213FE29900E0826C /* SigUtil.cpp in Sources */,
 				BE5EB5C1213FE29900E0826C /* Log.cpp in Sources */,
 				BE5EB5DA2140363100E0826C /* ios.mm in Sources */,
diff --git a/ios/Mobile/L10n.h b/ios/Mobile/L10n.h
new file mode 100644
index 000000000..ce0c50d3e
--- /dev/null
+++ b/ios/Mobile/L10n.h
@@ -0,0 +1,13 @@
+// -*- Mode: ObjC; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*-
+//
+// This file is part of the LibreOffice project.
+//
+// This Source Code Form is subject to the terms of the Mozilla Public
+// 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 _(id, catalog) app_translate(id, catalog)
+
+char *app_translate(const char *id, const char *catalog);
+
+// vim:set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/ios/Mobile/L10n.mm b/ios/Mobile/L10n.mm
new file mode 100644
index 000000000..3f232c361
--- /dev/null
+++ b/ios/Mobile/L10n.mm
@@ -0,0 +1,28 @@
+// -*- Mode: ObjC; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*-
+//
+// This file is part of the LibreOffice project.
+//
+// This Source Code Form is subject to the terms of the Mozilla Public
+// 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/.
+
+#import <cstring>
+
+#define LIBO_INTERNAL_ONLY
+
+#import <i18nlangtag/languagetag.hxx>
+#import <unotools/resmgr.hxx>
+
+#import "AppDelegate.h"
+#import "L10n.h"
+
+char* app_translate(const char *id, const char *catalog)
+{
+    LanguageTag tag(OUString::fromUtf8([app_locale UTF8String]));
+    std::locale locale = Translate::Create(catalog, tag);
+    OUString result = Translate::get(id, locale);
+
+    return strdup(result.toUtf8().getStr());
+}
+
+// vim:set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/ios/Mobile/TemplateCollectionViewController.mm b/ios/Mobile/TemplateCollectionViewController.mm
index cdb6de60d..ca2890e3d 100644
--- a/ios/Mobile/TemplateCollectionViewController.mm
+++ b/ios/Mobile/TemplateCollectionViewController.mm
@@ -12,6 +12,7 @@
 #import <LibreOfficeKit/LibreOfficeKitInit.h>
 
 #import "AppDelegate.h"
+#import "L10n.h"
 #import "TemplateCollectionViewController.h"
 #import "TemplateSectionHeaderView.h"
 
@@ -96,11 +97,11 @@ static NSString *mapTemplateExtensionToActual(NSString *templateName) {
     char *translatedHeader;
 
     if (index == 0)
-        translatedHeader = kit->pClass->translateGet(kit, STR_DESCRIPTION_FACTORY_WRITER, "svt", [app_locale UTF8String]);
+        translatedHeader = _(STR_DESCRIPTION_FACTORY_WRITER, "svt");
     else if (index == 1)
-        translatedHeader = kit->pClass->translateGet(kit, STR_DESCRIPTION_FACTORY_CALC, "svt", [app_locale UTF8String]);
+        translatedHeader = _(STR_DESCRIPTION_FACTORY_CALC, "svt");
     else if (index == 2)
-        translatedHeader = kit->pClass->translateGet(kit, STR_DESCRIPTION_FACTORY_IMPRESS, "svt", [app_locale UTF8String]);
+        translatedHeader = _(STR_DESCRIPTION_FACTORY_IMPRESS, "svt");
     else
         abort();
 
commit 4d038dc3e475064633eb1b025374780e6cd6fef9
Author:     Tor Lillqvist <tml at collabora.com>
AuthorDate: Tue Dec 11 12:35:08 2018 +0200
Commit:     Tor Lillqvist <tml at collabora.com>
CommitDate: Thu Dec 13 16:14:02 2018 +0200

    Bin commented-out #import
    
    Change-Id: I2dc64b95b99d62816be78b3fdf302280714a26f4

diff --git a/ios/Mobile/TemplateCollectionViewController.h b/ios/Mobile/TemplateCollectionViewController.h
index 0668de966..dd166cb0c 100644
--- a/ios/Mobile/TemplateCollectionViewController.h
+++ b/ios/Mobile/TemplateCollectionViewController.h
@@ -8,8 +8,6 @@
 
 #import <UIKit/UIKit.h>
 
-// #import "TemplateCollectionView.h"
-
 @interface TemplateCollectionViewController : UICollectionViewController<UICollectionViewDataSource,UICollectionViewDelegateFlowLayout> {
     NSArray<NSURL*> *templates[3];
     LibreOfficeKit *kit;


More information about the Libreoffice-commits mailing list