diff options
author | László Németh <nemeth@numbertext.org> | 2018-02-20 11:38:24 +0100 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2018-05-03 11:42:20 +0200 |
commit | f1579d3d6c5f5f3a651825e035b93bee7a4f43c6 (patch) | |
tree | 302e93db63f5029f521a0dba446e2c7b91d08a10 /external | |
parent | f5a56c367fba1c42b4f9719b10ff3e86ad5e2ab1 (diff) |
tdf#117171 support localized number name numbering styles
in page number, chapter and outline numbering
in ~30 languages by integrating libnumbertext library.
- offapi: add linguistic2::NumberText
New NumberingType constants:
- ordinal indicators (1st, 2nd, 3rd...)
- cardinal number names (One, Two, Three...)
- ordinal number names (First, Second, Third...)
Note: these numberings are parts of OOXML, too.
Plain text files of Libnumbertext's language data
are installed in share/numbertext (similar to
share/fingerprint), allowing further customization.
Change-Id: I4034da0a40a8c926f14a3f591749a89a8d807d5a
Reviewed-on: https://gerrit.libreoffice.org/53313
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'external')
-rw-r--r-- | external/Module_external.mk | 1 | ||||
-rw-r--r-- | external/libnumbertext/ExternalPackage_numbertext.mk | 54 | ||||
-rw-r--r-- | external/libnumbertext/ExternalProject_libnumbertext.mk | 43 | ||||
-rw-r--r-- | external/libnumbertext/Makefile | 7 | ||||
-rw-r--r-- | external/libnumbertext/Module_libnumbertext.mk | 32 | ||||
-rw-r--r-- | external/libnumbertext/README | 3 | ||||
-rw-r--r-- | external/libnumbertext/StaticLibrary_libnumbertext.mk | 22 | ||||
-rw-r--r-- | external/libnumbertext/UnpackedTarball_libnumbertext.mk | 16 |
8 files changed, 178 insertions, 0 deletions
diff --git a/external/Module_external.mk b/external/Module_external.mk index 317c14d64d87..33800e8147a6 100644 --- a/external/Module_external.mk +++ b/external/Module_external.mk @@ -59,6 +59,7 @@ $(eval $(call gb_Module_add_moduledirs,external,\ $(call gb_Helper_optional,LIBEXTTEXTCAT,libexttextcat) \ $(call gb_Helper_optional,LIBGPGERROR,libgpg-error) \ $(call gb_Helper_optional,LIBLANGTAG,liblangtag) \ + $(call gb_Helper_optional,LIBNUMBERTEXT,libnumbertext) \ $(call gb_Helper_optional,LIBPNG,libpng) \ $(call gb_Helper_optional,LIBXML2,libxml2) \ $(call gb_Helper_optional,LIBXSLT,libxslt) \ diff --git a/external/libnumbertext/ExternalPackage_numbertext.mk b/external/libnumbertext/ExternalPackage_numbertext.mk new file mode 100644 index 000000000000..e76e8d6da43d --- /dev/null +++ b/external/libnumbertext/ExternalPackage_numbertext.mk @@ -0,0 +1,54 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# 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/. +# + +$(eval $(call gb_ExternalPackage_ExternalPackage,libnumbertext_numbertext,libnumbertext)) + +$(eval $(call gb_ExternalPackage_add_unpacked_files,libnumbertext_numbertext,$(LIBO_SHARE_FOLDER)/numbertext,\ + data/af.sor \ + data/ca.sor \ + data/cs.sor \ + data/da.sor \ + data/de.sor \ + data/el.sor \ + data/en.sor \ + data/eo.sor \ + data/es.sor \ + data/fi.sor \ + data/fr.sor \ + data/fr.sor \ + data/he.sor \ + data/hr.sor \ + data/hu.sor \ + data/Hung.sor \ + data/id.sor \ + data/it.sor \ + data/ja.sor \ + data/ko.sor \ + data/lb.sor \ + data/lt.sor \ + data/lv.sor \ + data/ms.sor \ + data/nl.sor \ + data/pl.sor \ + data/pt.sor \ + data/Roman.sor \ + data/ro.sor \ + data/ru.sor \ + data/sh.sor \ + data/sl.sor \ + data/sr.sor \ + data/Suzhou.sor \ + data/sv.sor \ + data/th.sor \ + data/tr.sor \ + data/vi.sor \ + data/zh.sor \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/external/libnumbertext/ExternalProject_libnumbertext.mk b/external/libnumbertext/ExternalProject_libnumbertext.mk new file mode 100644 index 000000000000..04b957667ae6 --- /dev/null +++ b/external/libnumbertext/ExternalProject_libnumbertext.mk @@ -0,0 +1,43 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# 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/. +# + +$(eval $(call gb_ExternalProject_ExternalProject,libnumbertext)) + +$(eval $(call gb_ExternalProject_use_externals,libnumbertext, \ +)) + +$(eval $(call gb_ExternalProject_register_targets,libnumbertext,\ + build \ +)) + +libnumbertext_CXXFLAGS=$(CXXFLAGS) $(CXXFLAGS_CXX11) + +ifneq (,$(filter ANDROID DRAGONFLY FREEBSD IOS LINUX NETBSD OPENBSD,$(OS))) +ifneq (,$(gb_ENABLE_DBGUTIL)) +libnumbertext_CPPFLAGS+=-D_GLIBCXX_DEBUG +endif +endif + +libnumbertext_LIBS+=-L$(gb_StaticLibrary_WORKDIR) + +$(call gb_ExternalProject_get_state_target,libnumbertext,build): + $(call gb_ExternalProject_run,build,\ + $(if $(libnumbertext_LIBS),LIBS='$(libnumbertext_LIBS)') \ + $(if $(filter IOS MACOSX,$(OS)),ACLOCAL="aclocal -I $(SRCDIR)/m4/mac") \ + LIBS="$(gb_STDLIBS) $(LIBS)" \ + autoreconf && \ + $(SHELL) ./configure --disable-shared --with-pic \ + $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM))\ + $(if $(filter AIX,$(OS)),CFLAGS="-D_LINUX_SOURCE_COMPAT") \ + $(if $(libnumbertext_CPPFLAGS),CPPFLAGS='$(libnumbertext_CPPFLAGS)') \ + CXXFLAGS="$(libnumbertext_CXXFLAGS) $(if $(ENABLE_OPTIMIZED) $(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS)) $(if $(debug),$(gb_DEBUGINFO_FLAGS) $(gb_DEBUG_CXXFLAGS))" \ + && cd src && $(MAKE) \ + ) + +# vim: set noet sw=4 ts=4: diff --git a/external/libnumbertext/Makefile b/external/libnumbertext/Makefile new file mode 100644 index 000000000000..e4968cf85fb6 --- /dev/null +++ b/external/libnumbertext/Makefile @@ -0,0 +1,7 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- + +module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST)))) + +include $(module_directory)/../../solenv/gbuild/partial_build.mk + +# vim: set noet sw=4 ts=4: diff --git a/external/libnumbertext/Module_libnumbertext.mk b/external/libnumbertext/Module_libnumbertext.mk new file mode 100644 index 000000000000..1bca2233caa8 --- /dev/null +++ b/external/libnumbertext/Module_libnumbertext.mk @@ -0,0 +1,32 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# 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/. +# + +$(eval $(call gb_Module_Module,libnumbertext)) + +$(eval $(call gb_Module_add_targets,libnumbertext,\ + ExternalPackage_numbertext \ + UnpackedTarball_libnumbertext \ +)) +ifeq ($(COM),MSC) +$(eval $(call gb_Module_add_targets,libnumbertext,\ + StaticLibrary_libnumbertext \ +)) +else + +ifeq ($(ENABLE_LIBNUMBERTEXT),TRUE) + +$(eval $(call gb_Module_add_targets,libnumbertext,\ + ExternalProject_libnumbertext \ +)) + +endif + +endif + +# vim: set noet sw=4 ts=4: diff --git a/external/libnumbertext/README b/external/libnumbertext/README new file mode 100644 index 000000000000..922f19df1d2e --- /dev/null +++ b/external/libnumbertext/README @@ -0,0 +1,3 @@ +Number to Number Name Conversion Library + +It is hosted at: [https://github.com/Numbertext/libnumbertext] diff --git a/external/libnumbertext/StaticLibrary_libnumbertext.mk b/external/libnumbertext/StaticLibrary_libnumbertext.mk new file mode 100644 index 000000000000..838fbd4fd498 --- /dev/null +++ b/external/libnumbertext/StaticLibrary_libnumbertext.mk @@ -0,0 +1,22 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# 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/. +# + +$(eval $(call gb_StaticLibrary_StaticLibrary,libnumbertext)) + +$(eval $(call gb_StaticLibrary_use_unpacked,libnumbertext,libnumbertext)) + +$(eval $(call gb_StaticLibrary_set_warnings_not_errors,libnumbertext)) + +$(eval $(call gb_StaticLibrary_add_generated_exception_objects,libnumbertext,\ + UnpackedTarball/libnumbertext/src/Soros \ + UnpackedTarball/libnumbertext/src/Numbertext \ +)) + + +# vim: set noet sw=4 ts=4: diff --git a/external/libnumbertext/UnpackedTarball_libnumbertext.mk b/external/libnumbertext/UnpackedTarball_libnumbertext.mk new file mode 100644 index 000000000000..ac2a14133205 --- /dev/null +++ b/external/libnumbertext/UnpackedTarball_libnumbertext.mk @@ -0,0 +1,16 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# 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/. +# + +$(eval $(call gb_UnpackedTarball_UnpackedTarball,libnumbertext)) + +$(eval $(call gb_UnpackedTarball_set_tarball,libnumbertext,$(LIBNUMBERTEXT_TARBALL))) + +$(eval $(call gb_UnpackedTarball_update_autoconf_configs,libnumbertext)) + +# vim: set noet sw=4 ts=4: |