Kaydet (Commit) 00657aef authored tarafından Caolán McNamara's avatar Caolán McNamara

migrate to boost::gettext

* all .ui files go from <interface> to <interface domain="MODULE"> e.g. vcl
* all .src files go away and the english source strings folded into the .hrc as NC_("context", "source string")
* ResMgr is dropped in favour of std::locale imbued by boost::locale::generator pointed at matching
  MODULE .mo files
* UIConfig translations are folded into the module .mo, so e.g. UIConfig_cui
  goes from l10n target to normal one, so the res/lang.zips of UI files go away
* translation via Translation::get(hrc-define-key, imbued-std::locale)
* python can now be translated with its inbuilt gettext support (we keep the name strings.hrc there
  to keep finding the .hrc file uniform) so magic numbers can go away there
* java and starbasic components can be translated via the pre-existing css.resource.StringResourceWithLocation
  mechanism
* en-US res files go away, their strings are now the .hrc keys in the source code
* remaining .res files are replaced by .mo files
* in .res/.ui-lang-zip files, the old scheme missing translations of strings
  results in inserting the english original so something can be found, now the
  standard fallback of using the english original from the source key is used, so
  partial translations shrink dramatically in size
* extract .hrc strings with hrcex which backs onto
   xgettext -C --add-comments --keyword=NC_:1c,2 --from-code=UTF-8 --no-wrap
* extract .ui strings with uiex which backs onto
   xgettext --add-comments --no-wrap
* qtz for gettext translations is generated at runtime as ascii-ified crc32 of
   content + "|" + msgid
* [API CHANGE] remove deprecated binary .res resouce loader related uno apis
      com::sun::star::resource::OfficeResourceLoader
      com::sun::star::resource::XResourceBundleLoader
      com::sun::star::resource::XResourceBundle
    when translating strings via uno apis
      com.sun.star.resource.StringResourceWithLocation
    can continue to be used

Change-Id: Ia2594a2672b7301d9c3421fdf31b6cfe7f3f8d0a
üst fa987cbb

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

......@@ -116,7 +116,6 @@ $(eval $(call gb_Top_GbuildModulesRules,$(gbuild_modules)))
gbuild_TARGETS := AllLangHelp \
AllLangPackage \
AllLangResTarget \
AutoInstall \
CliLibrary \
CliNativeLibrary \
......@@ -470,7 +469,7 @@ $(foreach ide,\
eclipsecdt,\
$(eval $(call gb_Top_GbuildToIdeIntegrationNS,$(ide))))
fuzzers: Library_sal Library_salhelper Library_reg Library_store Library_unoidl codemaker Library_cppu Library_i18nlangtag Library_cppuhelper Library_comphelper StaticLibrary_ulingu StaticLibrary_findsofficepath Library_tl Library_basegfx Library_canvastools Library_cppcanvas Library_dbtools Library_deploymentmisc Library_deploymentmisc Library_editeng Library_fwe Library_fwi Library_i18nutil Library_localebe1 Library_sax Library_sofficeapp Library_ucbhelper Library_opencl Rdb_services udkapi offapi Library_clew Library_gie Library_icg Library_reflection Library_invocadapt Library_bootstrap Library_introspection Library_stocservices Library_xmlreader Library_gcc3_uno instsetoo_native more_fonts StaticLibrary_fuzzerstubs StaticLibrary_fuzzer_core StaticLibrary_fuzzer_calc StaticLibrary_fuzzer_draw StaticLibrary_fuzzer_writer Library_forui Executable_wmffuzzer Executable_jpgfuzzer Executable_giffuzzer Executable_xbmfuzzer Executable_xpmfuzzer Executable_pngfuzzer Executable_bmpfuzzer Executable_svmfuzzer Executable_pcdfuzzer Executable_dxffuzzer Executable_metfuzzer Executable_ppmfuzzer Executable_psdfuzzer Executable_epsfuzzer Executable_pctfuzzer Executable_pcxfuzzer Executable_rasfuzzer Executable_tgafuzzer Executable_tiffuzzer Executable_hwpfuzzer Executable_602fuzzer Executable_lwpfuzzer Executable_olefuzzer AllLangResTarget_sd Executable_pptfuzzer Executable_rtffuzzer Executable_cgmfuzzer Executable_ww2fuzzer Executable_ww6fuzzer Executable_ww8fuzzer Executable_qpwfuzzer
fuzzers: Library_sal Library_salhelper Library_reg Library_store Library_unoidl codemaker Library_cppu Library_i18nlangtag Library_cppuhelper Library_comphelper StaticLibrary_ulingu StaticLibrary_findsofficepath Library_tl Library_basegfx Library_canvastools Library_cppcanvas Library_dbtools Library_deploymentmisc Library_deploymentmisc Library_editeng Library_fwe Library_fwi Library_i18nutil Library_localebe1 Library_sax Library_sofficeapp Library_ucbhelper Library_opencl Rdb_services udkapi offapi Library_clew Library_gie Library_icg Library_reflection Library_invocadapt Library_bootstrap Library_introspection Library_stocservices Library_xmlreader Library_gcc3_uno instsetoo_native more_fonts StaticLibrary_fuzzerstubs StaticLibrary_fuzzer_core StaticLibrary_fuzzer_calc StaticLibrary_fuzzer_draw StaticLibrary_fuzzer_writer Library_forui Executable_wmffuzzer Executable_jpgfuzzer Executable_giffuzzer Executable_xbmfuzzer Executable_xpmfuzzer Executable_pngfuzzer Executable_bmpfuzzer Executable_svmfuzzer Executable_pcdfuzzer Executable_dxffuzzer Executable_metfuzzer Executable_ppmfuzzer Executable_psdfuzzer Executable_epsfuzzer Executable_pctfuzzer Executable_pcxfuzzer Executable_rasfuzzer Executable_tgafuzzer Executable_tiffuzzer Executable_hwpfuzzer Executable_602fuzzer Executable_lwpfuzzer Executable_olefuzzer Executable_pptfuzzer Executable_rtffuzzer Executable_cgmfuzzer Executable_ww2fuzzer Executable_ww6fuzzer Executable_ww8fuzzer Executable_qpwfuzzer
endif # MAKE_RESTARTS
......
......@@ -42,6 +42,7 @@ $(eval $(call gb_Helper_register_executables,NONE, \
libtest \
lngconvex \
localize \
localestr \
makedepend \
mbsdiff \
mork_helper \
......@@ -52,14 +53,11 @@ $(eval $(call gb_Helper_register_executables,NONE, \
pocheck \
propex \
regsvrex \
rsc \
saxparser \
sp2bv \
svg2odf \
svidl \
transex3 \
treex \
uiex \
ulfex \
unoidl-read \
unoidl-write \
......@@ -388,7 +386,6 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,ooo, \
pcr \
pdffilter \
$(call gb_Helper_optional,SCRIPTING,protocolhandler) \
res \
sax \
sb \
$(call gb_Helper_optional,DBCONNECTIVITY,sdbt) \
......@@ -1057,60 +1054,39 @@ $(eval $(call gb_ExternalExecutable_register_executables,\
))
# Resources
$(eval $(call gb_Helper_register_resources,\
abp \
$(eval $(call gb_Helper_register_mos,\
acc \
analysis \
avmedia \
$(call gb_Helper_optional,SCRIPTING,basctl) \
$(call gb_Helper_optional,DBCONNECTIVITY,bib) \
chartcontroller \
chart \
cnr \
cui \
date \
$(call gb_Helper_optional,DBCONNECTIVITY,\
dba \
dbmm \
dbp \
dbu \
) \
dbw \
deployment \
deploymentgui \
$(call gb_Helper_optional,DBCONNECTIVITY,dba) \
dkt \
editeng \
eps \
flt \
for \
forui \
$(call gb_Helper_optional,DESKTOP,fps_office) \
$(call gb_Helper_optional,DESKTOP,fps) \
frm \
fwe \
gal \
$(call gb_Helper_optional,DBCONNECTIVITY,pcr) \
pdffilter \
pricing \
fwk \
pcr \
rpt \
rptui \
$(call gb_Helper_optional,SCRIPTING,sb) \
sc \
scn \
sca \
$(if $(ENABLE_COINMP)$(ENABLE_LPSOLVE),scc) \
sd \
sdberr \
$(call gb_Helper_optional,DBCONNECTIVITY,sdbt) \
sfx \
sm \
$(if $(ENABLE_COINMP)$(ENABLE_LPSOLVE),solver) \
svl \
svt \
svx \
sw \
t602filter \
upd \
uui \
vcl \
writerperfect \
$(if $(ENABLE_NSS),xmlsec) \
xsltdlg \
wiz \
wpt \
$(if $(ENABLE_NSS),xsc) \
))
# UI configuration
......
......@@ -3778,7 +3778,6 @@ endef
# FIXME: the library target should be for build too
define gb_Executable__register_gengal
$(call gb_Executable_add_runtime_dependencies,gengal,\
$(call gb_AllLangResTarget_get_target,ofa) \
$(call gb_Library_get_target,$(gb_CPPU_ENV)_uno) \
$(call gb_Package_get_target_for_build,postprocess_images) \
$(call gb_Package_get_target_for_build,postprocess_registry) \
......@@ -3811,7 +3810,7 @@ endef
define gb_Executable__register_localize
$(call gb_Executable_add_runtime_dependencies,localize,\
$(foreach exec,cfgex helpex propex transex3 treex uiex ulfex xrmex,\
$(foreach exec,cfgex helpex propex treex ulfex xrmex,\
$(call gb_Executable_get_runtime_dependencies,$(exec)) \
) \
)
......
......@@ -37,7 +37,6 @@ $(eval $(call gb_Module_add_moduledirs,cross_toolset,\
registry \
remotebridges \
ridljar \
rsc \
sal \
salhelper \
sax \
......
......@@ -101,7 +101,6 @@ $(eval $(call gb_Module_add_moduledirs,libreoffice,\
reportbuilder \
$(call gb_Helper_optional,DBCONNECTIVITY,reportdesign) \
ridljar \
rsc \
sal \
salhelper \
sax \
......
# -*- 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_AllLangMoTarget_AllLangMoTarget,acc))
$(eval $(call gb_AllLangMoTarget_set_polocation,acc,accessibility))
# vim: set noet sw=4 ts=4:
# -*- 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_AllLangResTarget_AllLangResTarget,acc))
$(eval $(call gb_AllLangResTarget_set_reslocation,acc,accessibility))
$(eval $(call gb_AllLangResTarget_add_srs,acc,\
acc/res \
))
$(eval $(call gb_SrsTarget_SrsTarget,acc/res))
$(eval $(call gb_SrsTarget_set_include,acc/res,\
$$(INCLUDE) \
-I$(SRCDIR)/accessibility/inc \
))
$(eval $(call gb_SrsTarget_add_files,acc/res,\
accessibility/source/helper/accessiblestrings.src \
))
# vim:set noet sw=4 ts=4:
......@@ -14,7 +14,7 @@ $(eval $(call gb_Module_add_targets,accessibility,\
))
$(eval $(call gb_Module_add_l10n_targets,accessibility,\
AllLangResTarget_acc \
AllLangMoTarget_acc \
))
# vim:set noet sw=4 ts=4:
......@@ -49,7 +49,7 @@
#include <comphelper/accessibletexthelper.hxx>
#include <rtl/ref.hxx>
#include <svtools/svtools.hrc>
#include <svtools/strings.hrc>
#include <vcl/svapp.hxx>
#include <unotools/accessiblerelationsethelper.hxx>
#include <queue>
......
......@@ -22,11 +22,8 @@
#include <rtl/ustring.hxx>
class SimpleResMgr;
#define TK_RES_STRING(id) ::accessibility::TkResMgr::loadString(id)
// TkResMgr
namespace accessibility
......@@ -34,7 +31,7 @@ namespace accessibility
class TkResMgr
{
static SimpleResMgr* m_pImpl;
static std::locale* m_pImpl;
private:
// no instantiation allowed
......@@ -56,7 +53,7 @@ protected:
public:
// loads the string with the specified resource id
static OUString loadString( sal_uInt16 nResId );
static OUString loadString(const char *pResId);
};
}
......
......@@ -283,7 +283,6 @@
#include <i18nlangtag/languagetag.hxx>
#include <o3tl/cow_wrapper.hxx>
#include <o3tl/typed_flags_set.hxx>
#include <rsc/rsc-vcl-shared-types.hxx>
#include <sot/formats.hxx>
#include <svl/hint.hxx>
#include <svl/svldllapi.h>
......@@ -317,7 +316,6 @@
#include <tools/mapunit.hxx>
#include <tools/poly.hxx>
#include <tools/ref.hxx>
#include <tools/resid.hxx>
#include <tools/resmgr.hxx>
#include <tools/solar.h>
#include <tools/stream.hxx>
......
......@@ -20,22 +20,19 @@
#ifndef ACCESSIBILITY_HELPER_ACCESSIBLESTRINGS_HRC_
#define ACCESSIBILITY_HELPER_ACCESSIBLESTRINGS_HRC_
#define RID_TK_ACC_START 1000