summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-06-11 20:56:30 +0100
committerCaolán McNamara <caolanm@redhat.com>2017-07-21 08:20:50 +0100
commit00657aef09d854c74fb426a935a3e8b1fc390bb0 (patch)
treefd1a9bb264fe15dcc129498e62060ecd256b1ee7 /bin
parentfa987cbb813cfd729fe490f2f1258b7c8d7fb174 (diff)
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
Diffstat (limited to 'bin')
-rwxr-xr-xbin/count-src-resources11
-rwxr-xr-xbin/find-unused-defines-in-hrc-files.py19
-rwxr-xr-xbin/lint-ui.py2
-rwxr-xr-xbin/run18
4 files changed, 11 insertions, 39 deletions
diff --git a/bin/count-src-resources b/bin/count-src-resources
deleted file mode 100755
index 01fbdfc7e440..000000000000
--- a/bin/count-src-resources
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/sh
-#
-# 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/.
-#
-# Run this from the source root dir to count the number of remaining .src resources
-
-git ls-files *.src | xargs grep -ohE '^[a-zA-Z]+[ ]+[a-zA-Z_0-9]+' | cut -f 1 -d ' ' | sort | uniq -c | sort -n
diff --git a/bin/find-unused-defines-in-hrc-files.py b/bin/find-unused-defines-in-hrc-files.py
index a7adbf29fa20..c28fe545578a 100755
--- a/bin/find-unused-defines-in-hrc-files.py
+++ b/bin/find-unused-defines-in-hrc-files.py
@@ -14,23 +14,6 @@ exclusionSet = set([
# List of RID constants where we compute a value using a base before calling one of the RESSTR methods
# Found with: git grep -P 'RID_\w+\s*\+' -- :/ ':!*.hrc' ':!*.src' ':!*.java' ':!*.py' ':!*.xba'
"RID_SVXSTR_KEY_",
- "RID_SVXITEMS_SHADOW_",
- "RID_SVXITEMS_BREAK_",
- "RID_SVXITEMS_FRMDIR_",
- "RID_SVXITEMS_COLOR",
- "RID_SVXITEMS_HORJUST_",
- "RID_SVXITEMS_VERJUST_",
- "RID_SVXITEMS_JUSTMETHOD_",
- "RID_SVXITEMS_ADJUST_",
- "RID_SVXITEMS_WEIGHT_",
- "RID_SVXITEMS_UL_",
- "RID_SVXITEMS_OL_",
- "RID_SVXITEMS_STRIKEOUT_",
- "RID_SVXITEMS_CASEMAP_",
- "RID_SVXITEMS_ESCAPEMENT_",
- "RID_SVXITEMS_EMPHASIS_",
- "RID_SVXITEMS_RELIEF_",
- "RID_SVXITEMS_FRMDIR_",
"RID_UPDATE_BUBBLE_TEXT_",
"RID_UPDATE_BUBBLE_T_TEXT_",
"RID_SVXSTR_TBLAFMT_",
@@ -42,8 +25,6 @@ exclusionSet = set([
"RID_SVXSTR_OUTLINENUM_DESCRIPTION",
"RID_SVXSTR_RULER_",
"RID_GALLERYSTR_THEME_",
- "RID_SVXITEMS_ORI_",
- "RID_SVXITEMS_PAGE_NUM_",
"RID_SVXSTR_BULLET_DESCRIPTION",
"RID_SVXSTR_SINGLENUM_DESCRIPTION",
"RID_SVXSTR_OUTLINENUM_DESCRIPTION",
diff --git a/bin/lint-ui.py b/bin/lint-ui.py
index 2ed80c2523fb..88fb2cc460a1 100755
--- a/bin/lint-ui.py
+++ b/bin/lint-ui.py
@@ -98,6 +98,8 @@ def main():
tree = ET.parse(sys.argv[1])
root = tree.getroot()
+ lint_assert('domain' in root.attrib, "interface needs to specific translation domain")
+
top_level_widgets = [element for element in root.findall('object') if element.attrib['class'] not in IGNORED_TOP_LEVEL_WIDGETS]
assert len(top_level_widgets) == 1
diff --git a/bin/run b/bin/run
index 7823861d4a3b..7055ffe177b3 100755
--- a/bin/run
+++ b/bin/run
@@ -25,9 +25,9 @@ if uname | grep -i CYGWIN >/dev/null; then
export URE_BOOTSTRAP=file:///$(cygpath -m "${dir}")/instdir/program/fundamental.ini
export PATH=${PATH:+$PATH:}"${dir}"/instdir/program
- echo "setting URE_BOOTSTRAP to: ${URE_BOOTSTRAP}"
- echo "setting search path to: ${PATH}"
- echo "execing: ${exedir}/$1"
+# echo "setting URE_BOOTSTRAP to: ${URE_BOOTSTRAP}"
+# echo "setting search path to: ${PATH}"
+# echo "execing: ${exedir}/$1"
exec ${LO_TRACE} "${exedir}/$@"
@@ -47,9 +47,9 @@ elif [ $(uname) = Darwin ]; then
export URE_BOOTSTRAP=file://"${dir}"/instdir/$PRODUCTNAME.app/Contents/Resources/fundamentalrc
export DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH:+$DYLD_LIBRARY_PATH:}"${dir}"/instdir/$PRODUCTNAME.app/Contents/Frameworks
- echo "setting URE_BOOTSTRAP to: ${URE_BOOTSTRAP}"
- echo "setting search path to: ${DYLD_LIBRARY_PATH}"
- echo "execing: ${exedir}/$1"
+# echo "setting URE_BOOTSTRAP to: ${URE_BOOTSTRAP}"
+# echo "setting search path to: ${DYLD_LIBRARY_PATH}"
+# echo "execing: ${exedir}/$1"
exec ${LO_TRACE} "${exedir}/$@"
@@ -69,9 +69,9 @@ else
export URE_BOOTSTRAP=file://"${dir}"/instdir/program/fundamentalrc
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}"${dir}"/instdir/program
- echo "setting URE_BOOTSTRAP to: ${URE_BOOTSTRAP}"
- echo "setting search path to: ${LD_LIBRARY_PATH}"
- echo "execing: ${exedir}/$1"
+# echo "setting URE_BOOTSTRAP to: ${URE_BOOTSTRAP}"
+# echo "setting search path to: ${LD_LIBRARY_PATH}"
+# echo "execing: ${exedir}/$1"
exec ${LO_TRACE} "${exedir}/$@"