diff options
-rw-r--r-- | configure.in | 11 | ||||
-rw-r--r-- | i18npool/Library_i18nisolang1.mk | 6 | ||||
-rw-r--r-- | i18npool/source/languagetag/languagetag.cxx | 125 |
3 files changed, 139 insertions, 3 deletions
diff --git a/configure.in b/configure.in index c9e625da930c..66354736b4f5 100644 --- a/configure.in +++ b/configure.in @@ -10975,16 +10975,23 @@ GLIB_CFLAGS='' GLIB_LIBS='' if test "$SYSTEM_GLIB" = YES; then PKG_CHECK_MODULES( GLIB, glib-2.0 ) -else +elif test "$enable_librsvg" = fully-internal; then BUILD_TYPE="$BUILD_TYPE GLIB" fi AC_SUBST(GLIB_CFLAGS) AC_SUBST(GLIB_LIBS) dnl So far AFAIK no system has liblangtag, set this unconditionally for now. +dnl Except for Android and iOS where we don't want liblangtag. SYSTEM_LIBLANGTAG=NO -BUILD_TYPE="$BUILD_TYPE LIBLANGTAG" +case "$_os" in +iOS|Android) + ;; +*) + BUILD_TYPE="$BUILD_TYPE LIBLANGTAG" + ;; +esac AC_SUBST(SYSTEM_LIBLANGTAG) diff --git a/i18npool/Library_i18nisolang1.mk b/i18npool/Library_i18nisolang1.mk index 066f6f9a79d9..e022680790db 100644 --- a/i18npool/Library_i18nisolang1.mk +++ b/i18npool/Library_i18nisolang1.mk @@ -53,9 +53,13 @@ $(eval $(call gb_Library_add_exception_objects,i18nisolang1,\ i18npool/source/languagetag/languagetag \ )) -$(eval $(call gb_Library_use_external,i18nisolang1,glib)) +ifneq ($(OS),ANDROID) +ifneq ($(OS),IOS) +$(eval $(call gb_Library_use_external,i18nisolang1,glib)) $(eval $(call gb_Library_use_external,i18nisolang1,liblangtag)) +endif +endif $(eval $(call gb_Library_use_external,i18nisolang1,libxml2)) diff --git a/i18npool/source/languagetag/languagetag.cxx b/i18npool/source/languagetag/languagetag.cxx index d5cfacdc3e02..728e70a43e43 100644 --- a/i18npool/source/languagetag/languagetag.cxx +++ b/i18npool/source/languagetag/languagetag.cxx @@ -12,8 +12,133 @@ #include <rtl/ustrbuf.hxx> #include <rtl/bootstrap.hxx> #include <osl/file.hxx> + +#if !defined(ANDROID) && !defined(IOS) #include <liblangtag/langtag.h> +#elif defined(ANDROID) || defined(IOS) + +// Completely dummy implementation, once this actually starts getting used at +// run-time will need to do something. + +// For iOS probably can use NSLocale, that should have more or less required +// functionality. If it is good enough, it could be used for Mac OS X, +// too. For Android, maybe java.util.Locale, although it definitely lacks in +// functionality. + +typedef char gchar; +typedef struct { + char *message; +} GError; + +static void g_free(void *p) +{ + free(p); +} + +static void g_error_free(GError *error) +{ + (void) error; +} + +typedef void lt_tag_t; +typedef void lt_lang_t; +typedef void lt_script_t; +typedef void lt_region_t; + +static void lt_db_initialize(void) +{ +} + +static void lt_db_finalize(void) +{ +} + +static void lt_db_set_datadir(const char *dir) +{ + (void) dir; +} + +static lt_tag_t *lt_tag_new(void) +{ + return NULL; +} + +static lt_tag_t *lt_tag_copy(lt_tag_t *tag) +{ + (void) tag; + return NULL; +} + +static void lt_tag_unref(lt_tag_t *tag) +{ + (void) tag; +} + +static int lt_tag_parse(lt_tag_t *tag, + const char *tag_string, + GError **error) +{ + (void) tag; + (void) tag_string; + (void) error; + + return -1; +} + +static char *lt_tag_canonicalize(lt_tag_t *tag, + GError **error) +{ + (void) tag; + (void) error; + + return NULL; +} + +static const lt_lang_t *lt_tag_get_language(const lt_tag_t *tag) +{ + (void) tag; + + return NULL; +} + +static const lt_script_t *lt_tag_get_script(const lt_tag_t *tag) +{ + (void) tag; + + return NULL; +} + +static const lt_region_t *lt_tag_get_region(const lt_tag_t *tag) +{ + (void) tag; + + return NULL; +} + +static const gchar *lt_lang_get_tag(const lt_lang_t *lang) +{ + (void) lang; + + return NULL; +} + +static const gchar *lt_script_get_tag(const lt_script_t *script) +{ + (void) script; + + return NULL; +} + +static const gchar *lt_region_get_tag(const lt_region_t *region) +{ + (void) region; + + return NULL; +} + +#endif + //#define erDEBUG using rtl::OUString; |