summaryrefslogtreecommitdiff
path: root/unotools
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2019-12-18 23:07:11 +0100
committerMichael Meeks <michael.meeks@collabora.com>2020-05-16 19:23:57 +0100
commit6e69240276aa8aa473e3417a819a7d5a8a6bc796 (patch)
treeccb90e8a2d860a0ccc7e1660b8a0e9ec2a6ee0f0 /unotools
parent8a1abb99996df357ea806248f6cc9e0ab476d4c1 (diff)
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@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/85458 Tested-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'unotools')
-rw-r--r--unotools/source/i18n/resmgr.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/unotools/source/i18n/resmgr.cxx b/unotools/source/i18n/resmgr.cxx
index 786c83df2e7b..197816b21fc3 100644
--- a/unotools/source/i18n/resmgr.cxx
+++ b/unotools/source/i18n/resmgr.cxx
@@ -51,6 +51,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>
@@ -123,11 +127,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
// allow gettext to find these .mo files e.g. so gtk dialogs can use them