[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - unotools/source

Jan Holesovsky (via logerrit) logerrit at kemper.freedesktop.org
Thu Dec 19 00:02:47 UTC 2019


 unotools/source/i18n/resmgr.cxx |    8 ++++++++
 1 file changed, 8 insertions(+)

New commits:
commit ccd8a05b417361fdbe9c3736e9097e5c12efa479
Author:     Jan Holesovsky <kendy at collabora.com>
AuthorDate: Wed Dec 18 23:07:11 2019 +0100
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Thu Dec 19 01:01:40 2019 +0100

    android: Use correct path for the .mo resource files.
    
    They are read by boost::locale, so we cannot have them as normal assets,
    instead we have to have them in asset's 'unpack', so that they are
    unpacked to the filesystem and can be read as normal files.
    
    Change-Id: I5e902ee4b5294d1f693f51993b8bc2069f1c835a
    Reviewed-on: https://gerrit.libreoffice.org/85442
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>

diff --git a/unotools/source/i18n/resmgr.cxx b/unotools/source/i18n/resmgr.cxx
index ca384cf42a72..a7a1606a6aaa 100644
--- a/unotools/source/i18n/resmgr.cxx
+++ b/unotools/source/i18n/resmgr.cxx
@@ -68,6 +68,10 @@
 #include <unordered_map>
 #include <memory>
 
+#ifdef ANDROID
+#include <osl/detail/android-bootstrap.h>
+#endif
+
 #if defined(_WIN32) && defined(DBG_UTIL)
 #include <o3tl/char16_t2wchar_t.hxx>
 #include <prewin.h>
@@ -140,11 +144,15 @@ namespace Translate
         boost::locale::generator gen;
         gen.characters(boost::locale::char_facet);
         gen.categories(boost::locale::message_facet | boost::locale::information_facet);
+#if defined(ANDROID)
+        OString sPath(OString(lo_get_app_data_dir()) + "/program/resource");
+#else
         OUString uri("$BRAND_BASE_DIR/$BRAND_SHARE_RESOURCE_SUBDIR/");
         rtl::Bootstrap::expandMacros(uri);
         OUString path;
         osl::File::getSystemPathFromFileURL(uri, path);
         OString sPath(OUStringToOString(path, osl_getThreadTextEncoding()));
+#endif
         gen.add_messages_path(sPath.getStr());
 #if defined UNX && !defined MACOSX && !defined IOS && !defined ANDROID
         bindtextdomain(pPrefixName, sPath.getStr());


More information about the Libreoffice-commits mailing list