summaryrefslogtreecommitdiff
path: root/unotools/source/i18n
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2022-12-28 13:47:26 +0200
committerTor Lillqvist <tml@collabora.com>2022-12-28 13:08:56 +0000
commitde3b4b02008d708a66f8d6a8a365974eac7de3b3 (patch)
tree6155bc059c83706117233e445ce6cc1f78b4c129 /unotools/source/i18n
parenta510543a466aca0d152f82af24d16563f28455f0 (diff)
Introduce lo_get_app_data_dir() for Emscripten, too
And not just Android. Hardcoded to return "/instdir" to match what is in the emscripten_fs_image. Change-Id: I26d4ec5e02ec9900e35ca47f1565a13ad2b723b6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144849 Tested-by: Jenkins Reviewed-by: Tor Lillqvist <tml@collabora.com>
Diffstat (limited to 'unotools/source/i18n')
-rw-r--r--unotools/source/i18n/resmgr.cxx10
1 files changed, 7 insertions, 3 deletions
diff --git a/unotools/source/i18n/resmgr.cxx b/unotools/source/i18n/resmgr.cxx
index 3a7116350062..04f27b916db3 100644
--- a/unotools/source/i18n/resmgr.cxx
+++ b/unotools/source/i18n/resmgr.cxx
@@ -36,7 +36,7 @@
#include <string.h>
#include <stdio.h>
-#if defined UNX && !defined MACOSX && !defined IOS && !defined ANDROID
+#if defined UNX && !defined MACOSX && !defined IOS && !defined ANDROID && !defined EMSCRIPTEN
# include <libintl.h>
#endif
@@ -57,6 +57,10 @@
#include <osl/detail/android-bootstrap.h>
#endif
+#ifdef EMSCRIPTEN
+#include <osl/detail/emscripten-bootstrap.h>
+#endif
+
#if defined(_WIN32) && defined(DBG_UTIL)
#include <o3tl/char16_t2wchar_t.hxx>
#include <prewin.h>
@@ -134,7 +138,7 @@ namespace Translate
gen.characters(boost::locale::char_facet_t::char_f);
gen.categories(boost::locale::category_t::message | boost::locale::category_t::information);
#endif
-#if defined(ANDROID)
+#if defined(ANDROID) || defined(EMSCRIPTEN)
OString sPath(OString(lo_get_app_data_dir()) + "/program/resource");
#else
OUString uri("$BRAND_BASE_DIR/$BRAND_SHARE_RESOURCE_SUBDIR/");
@@ -151,7 +155,7 @@ namespace Translate
OString sPath(OUStringToOString(path, eEncoding));
#endif
gen.add_messages_path(sPath.getStr());
-#if defined UNX && !defined MACOSX && !defined IOS && !defined ANDROID
+#if defined UNX && !defined MACOSX && !defined IOS && !defined ANDROID && !defined EMSCRIPTEN
// allow gettext to find these .mo files e.g. so gtk dialogs can use them
bindtextdomain(aPrefixName.data(), sPath.getStr());
// tdf#131069 gtk, and anything sane, always wants utf-8 strings as output