Skip to content

Commit 00657ae

Browse files
author
Caolán McNamara
committed
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
1 parent fa987cb commit 00657ae

File tree

3,781 files changed

+42966
-112054
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,781 files changed

+42966
-112054
lines changed

Makefile.in

+1-2
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ $(eval $(call gb_Top_GbuildModulesRules,$(gbuild_modules)))
116116

117117
gbuild_TARGETS := AllLangHelp \
118118
AllLangPackage \
119-
AllLangResTarget \
120119
AutoInstall \
121120
CliLibrary \
122121
CliNativeLibrary \
@@ -470,7 +469,7 @@ $(foreach ide,\
470469
eclipsecdt,\
471470
$(eval $(call gb_Top_GbuildToIdeIntegrationNS,$(ide))))
472471

473-
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
472+
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
474473

475474
endif # MAKE_RESTARTS
476475

Repository.mk

+13-37
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ $(eval $(call gb_Helper_register_executables,NONE, \
4242
libtest \
4343
lngconvex \
4444
localize \
45+
localestr \
4546
makedepend \
4647
mbsdiff \
4748
mork_helper \
@@ -52,14 +53,11 @@ $(eval $(call gb_Helper_register_executables,NONE, \
5253
pocheck \
5354
propex \
5455
regsvrex \
55-
rsc \
5656
saxparser \
5757
sp2bv \
5858
svg2odf \
5959
svidl \
60-
transex3 \
6160
treex \
62-
uiex \
6361
ulfex \
6462
unoidl-read \
6563
unoidl-write \
@@ -388,7 +386,6 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,ooo, \
388386
pcr \
389387
pdffilter \
390388
$(call gb_Helper_optional,SCRIPTING,protocolhandler) \
391-
res \
392389
sax \
393390
sb \
394391
$(call gb_Helper_optional,DBCONNECTIVITY,sdbt) \
@@ -1057,60 +1054,39 @@ $(eval $(call gb_ExternalExecutable_register_executables,\
10571054
))
10581055

10591056
# Resources
1060-
$(eval $(call gb_Helper_register_resources,\
1061-
abp \
1057+
$(eval $(call gb_Helper_register_mos,\
10621058
acc \
1063-
analysis \
10641059
avmedia \
10651060
$(call gb_Helper_optional,SCRIPTING,basctl) \
1066-
$(call gb_Helper_optional,DBCONNECTIVITY,bib) \
1067-
chartcontroller \
1061+
chart \
10681062
cnr \
10691063
cui \
1070-
date \
1071-
$(call gb_Helper_optional,DBCONNECTIVITY,\
1072-
dba \
1073-
dbmm \
1074-
dbp \
1075-
dbu \
1076-
) \
1077-
dbw \
1078-
deployment \
1079-
deploymentgui \
1064+
$(call gb_Helper_optional,DBCONNECTIVITY,dba) \
10801065
dkt \
10811066
editeng \
1082-
eps \
1067+
flt \
10831068
for \
1084-
forui \
1085-
$(call gb_Helper_optional,DESKTOP,fps_office) \
1069+
$(call gb_Helper_optional,DESKTOP,fps) \
10861070
frm \
1087-
fwe \
1088-
gal \
1089-
$(call gb_Helper_optional,DBCONNECTIVITY,pcr) \
1090-
pdffilter \
1091-
pricing \
1071+
fwk \
1072+
pcr \
10921073
rpt \
1093-
rptui \
10941074
$(call gb_Helper_optional,SCRIPTING,sb) \
10951075
sc \
1096-
scn \
1076+
sca \
1077+
$(if $(ENABLE_COINMP)$(ENABLE_LPSOLVE),scc) \
10971078
sd \
1098-
sdberr \
1099-
$(call gb_Helper_optional,DBCONNECTIVITY,sdbt) \
11001079
sfx \
11011080
sm \
1102-
$(if $(ENABLE_COINMP)$(ENABLE_LPSOLVE),solver) \
11031081
svl \
11041082
svt \
11051083
svx \
11061084
sw \
1107-
t602filter \
1108-
upd \
11091085
uui \
11101086
vcl \
1111-
writerperfect \
1112-
$(if $(ENABLE_NSS),xmlsec) \
1113-
xsltdlg \
1087+
wiz \
1088+
wpt \
1089+
$(if $(ENABLE_NSS),xsc) \
11141090
))
11151091

11161092
# UI configuration

RepositoryExternal.mk

+1-2
Original file line numberDiff line numberDiff line change
@@ -3778,7 +3778,6 @@ endef
37783778
# FIXME: the library target should be for build too
37793779
define gb_Executable__register_gengal
37803780
$(call gb_Executable_add_runtime_dependencies,gengal,\
3781-
$(call gb_AllLangResTarget_get_target,ofa) \
37823781
$(call gb_Library_get_target,$(gb_CPPU_ENV)_uno) \
37833782
$(call gb_Package_get_target_for_build,postprocess_images) \
37843783
$(call gb_Package_get_target_for_build,postprocess_registry) \
@@ -3811,7 +3810,7 @@ endef
38113810

38123811
define gb_Executable__register_localize
38133812
$(call gb_Executable_add_runtime_dependencies,localize,\
3814-
$(foreach exec,cfgex helpex propex transex3 treex uiex ulfex xrmex,\
3813+
$(foreach exec,cfgex helpex propex treex ulfex xrmex,\
38153814
$(call gb_Executable_get_runtime_dependencies,$(exec)) \
38163815
) \
38173816
)

RepositoryModule_build.mk

-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ $(eval $(call gb_Module_add_moduledirs,cross_toolset,\
3737
registry \
3838
remotebridges \
3939
ridljar \
40-
rsc \
4140
sal \
4241
salhelper \
4342
sax \

RepositoryModule_host.mk

-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ $(eval $(call gb_Module_add_moduledirs,libreoffice,\
101101
reportbuilder \
102102
$(call gb_Helper_optional,DBCONNECTIVITY,reportdesign) \
103103
ridljar \
104-
rsc \
105104
sal \
106105
salhelper \
107106
sax \

accessibility/AllLangMoTarget_acc.mk

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
2+
#
3+
# This file is part of the LibreOffice project.
4+
#
5+
# This Source Code Form is subject to the terms of the Mozilla Public
6+
# License, v. 2.0. If a copy of the MPL was not distributed with this
7+
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
8+
9+
$(eval $(call gb_AllLangMoTarget_AllLangMoTarget,acc))
10+
11+
$(eval $(call gb_AllLangMoTarget_set_polocation,acc,accessibility))
12+
13+
# vim: set noet sw=4 ts=4:

accessibility/AllLangResTarget_acc.mk

-29
This file was deleted.

accessibility/Module_accessibility.mk

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ $(eval $(call gb_Module_add_targets,accessibility,\
1414
))
1515

1616
$(eval $(call gb_Module_add_l10n_targets,accessibility,\
17-
AllLangResTarget_acc \
17+
AllLangMoTarget_acc \
1818
))
1919

2020
# vim:set noet sw=4 ts=4:

accessibility/inc/extended/textwindowaccessibility.hxx

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
#include <comphelper/accessibletexthelper.hxx>
5050
#include <rtl/ref.hxx>
5151

52-
#include <svtools/svtools.hrc>
52+
#include <svtools/strings.hrc>
5353
#include <vcl/svapp.hxx>
5454
#include <unotools/accessiblerelationsethelper.hxx>
5555
#include <queue>

accessibility/inc/helper/accessiblestrings.hrc

-42
This file was deleted.

accessibility/inc/helper/accresmgr.hxx

+2-5
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,16 @@
2222

2323
#include <rtl/ustring.hxx>
2424

25-
class SimpleResMgr;
26-
2725
#define TK_RES_STRING(id) ::accessibility::TkResMgr::loadString(id)
2826

29-
3027
// TkResMgr
3128

3229
namespace accessibility
3330
{
3431

3532
class TkResMgr
3633
{
37-
static SimpleResMgr* m_pImpl;
34+
static std::locale* m_pImpl;
3835

3936
private:
4037
// no instantiation allowed
@@ -56,7 +53,7 @@ protected:
5653

5754
public:
5855
// loads the string with the specified resource id
59-
static OUString loadString( sal_uInt16 nResId );
56+
static OUString loadString(const char *pResId);
6057
};
6158

6259
}

accessibility/inc/pch/precompiled_acc.hxx

-2
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,6 @@
283283
#include <i18nlangtag/languagetag.hxx>
284284
#include <o3tl/cow_wrapper.hxx>
285285
#include <o3tl/typed_flags_set.hxx>
286-
#include <rsc/rsc-vcl-shared-types.hxx>
287286
#include <sot/formats.hxx>
288287
#include <svl/hint.hxx>
289288
#include <svl/svldllapi.h>
@@ -317,7 +316,6 @@
317316
#include <tools/mapunit.hxx>
318317
#include <tools/poly.hxx>
319318
#include <tools/ref.hxx>
320-
#include <tools/resid.hxx>
321319
#include <tools/resmgr.hxx>
322320
#include <tools/solar.h>
323321
#include <tools/stream.hxx>

accessibility/inc/strings.hrc

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2+
/*
3+
* This file is part of the LibreOffice project.
4+
*
5+
* This Source Code Form is subject to the terms of the Mozilla Public
6+
* License, v. 2.0. If a copy of the MPL was not distributed with this
7+
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
8+
*
9+
* This file incorporates work covered by the following license notice:
10+
*
11+
* Licensed to the Apache Software Foundation (ASF) under one or more
12+
* contributor license agreements. See the NOTICE file distributed
13+
* with this work for additional information regarding copyright
14+
* ownership. The ASF licenses this file to you under the Apache
15+
* License, Version 2.0 (the "License"); you may not use this file
16+
* except in compliance with the License. You may obtain a copy of
17+
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
18+
*/
19+
20+
#ifndef ACCESSIBILITY_HELPER_ACCESSIBLESTRINGS_HRC_
21+
#define ACCESSIBILITY_HELPER_ACCESSIBLESTRINGS_HRC_
22+
23+
#define NC_(Context, String) (Context "\004" u8##String)
24+
25+
#define RID_STR_ACC_NAME_BROWSEBUTTON NC_("RID_STR_ACC_NAME_BROWSEBUTTON", "Browse")
26+
#define STR_SVT_ACC_ACTION_EXPAND NC_("STR_SVT_ACC_ACTION_EXPAND", "Expand" )
27+
#define STR_SVT_ACC_ACTION_COLLAPSE NC_("STR_SVT_ACC_ACTION_COLLAPSE", "Collapse")
28+
#define STR_SVT_ACC_LISTENTRY_SELCTED_STATE NC_("STR_SVT_ACC_LISTENTRY_SELCTED_STATE", "(Selected)")
29+
#define RID_STR_ACC_ACTION_CHECK NC_("RID_STR_ACC_ACTION_CHECK", "Check")
30+
#define RID_STR_ACC_ACTION_UNCHECK NC_("RID_STR_ACC_ACTION_UNCHECK", "Uncheck")
31+
#define RID_STR_ACC_SCROLLBAR_NAME_VERTICAL NC_("RID_STR_ACC_SCROLLBAR_NAME_VERTICAL", "Vertical scroll bar")
32+
#define RID_STR_ACC_SCROLLBAR_NAME_HORIZONTAL NC_("RID_STR_ACC_SCROLLBAR_NAME_HORIZONTAL", "Horizontal scroll bar")
33+
#define RID_STR_ACC_PANEL_DESCRIPTION NC_("RID_STR_ACC_PANEL_DESCRIPTION", "Please press enter to go into child control for more operations")
34+
#define RID_STR_ACC_COLUMN_NUM NC_("RID_STR_ACC_COLUMN_NUM", "Column %COLUMNNUMBER")
35+
#define RID_STR_ACC_ROW_NUM NC_("RID_STR_ACC_ROW_NUM", "Row %ROWNUMBER")
36+
37+
#endif // ACCESSIBILITY_HELPER_ACCESSIBLESTRINGS_HRC_
38+
39+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

accessibility/source/extended/accessibleeditbrowseboxcell.cxx

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*/
1919

2020
#include <helper/accresmgr.hxx>
21-
#include <helper/accessiblestrings.hrc>
21+
#include <strings.hrc>
2222

2323
#include <extended/accessibleeditbrowseboxcell.hxx>
2424
#include <svtools/editbrowsebox.hxx>

accessibility/source/extended/accessiblelistboxentry.cxx

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
#include <comphelper/accessibleeventnotifier.hxx>
4343
#include <toolkit/helper/vclunohelper.hxx>
4444
#include <helper/accresmgr.hxx>
45-
#include <helper/accessiblestrings.hrc>
45+
#include <strings.hrc>
4646
#include <com/sun/star/accessibility/XAccessibleValue.hpp>
4747
#define ACCESSIBLE_ACTION_COUNT 1
4848

0 commit comments

Comments
 (0)