summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authoradjam <adjam@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-05-03 23:51:22 +0000
committeradjam <adjam@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-05-03 23:51:22 +0000
commitc0190e41f7f2e5fe30fa8556fa35f43950afbfdb (patch)
tree086794c886f413b3e4dbcfad9d3697a55f8dd64b /scripts
parentInitial rekcommit.. (diff)
downloadrekonq-c0190e41f7f2e5fe30fa8556fa35f43950afbfdb.tar.xz
Importing recode (rekonq code).
I'm sorry I coudn't perform this with gitsvn or tailor.. but I cannot lose all the evening just for this. And I need to sleep now.. git-svn-id: svn+ssh://svn.kde.org/home/kde/trunk/playground/network/rekonq@963146 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/codingstyle.sh48
-rwxr-xr-xscripts/i18n.sh41
2 files changed, 89 insertions, 0 deletions
diff --git a/scripts/codingstyle.sh b/scripts/codingstyle.sh
new file mode 100755
index 00000000..bb3add49
--- /dev/null
+++ b/scripts/codingstyle.sh
@@ -0,0 +1,48 @@
+#!/bin/sh
+#
+# apply rekonq coding style to all cpp and header files in src directory
+#
+# requirements: installed astyle
+#
+# rekonq use kdelibs coding style, except for brackets, so while kdelibs coding style
+# is
+#
+# void foo() {
+# ...
+# }
+#
+# rekonq uses
+#
+# void foo()
+# {
+# ...
+# }
+#
+# I like this way, for me more readable.
+#
+# Kdelibs coding style is defined in http://techbase.kde.org/Policies/Kdelibs_Coding_Style
+
+
+PWD=$(pwd)
+
+cd $PWD
+cd ..
+cd src
+
+echo "Applying astyle rules..."
+astyle \
+--indent=spaces=4 \
+--brackets=break \
+--indent-labels \
+--pad=oper \
+--unpad=paren \
+--one-line=keep-statements \
+--convert-tabs \
+--indent-preprocessor \
+`find -type f -name '*.cpp'` `find -type f -name '*.h'`
+
+echo "Removing .orig files..."
+rm *.orig
+
+echo "Done!"
+
diff --git a/scripts/i18n.sh b/scripts/i18n.sh
new file mode 100755
index 00000000..e9b5444d
--- /dev/null
+++ b/scripts/i18n.sh
@@ -0,0 +1,41 @@
+#! /usr/bin/env bash
+
+BASEDIR="../src/"
+PROJECT="rekonq"
+BUGADDR="http://sourceforge.net/tracker/?group_id=252277&atid=1126949"
+WDIR="../po/"
+
+cd ${BASEDIR}
+echo "Preparing rc files"
+find . -name '*.rc' -o -name '*.ui' -o -name '*.kcfg' | sort > ${WDIR}/rcfiles.list
+xargs --arg-file=${WDIR}/rcfiles.list extractrc > ${WDIR}/rc.cpp
+cd ${WDIR}
+echo "Done preparing rc files"
+
+echo "Extracting messages"
+cd ${BASEDIR}
+find . -name '*.cpp' -o -name '*.h' -o -name '*.c' | sort > ${WDIR}/infiles.list
+echo "rc.cpp" >> ${WDIR}/infiles.list
+cd ${WDIR}
+xgettext --from-code=UTF-8 -C -kde -ci18n -ki18n:1 -ki18nc:1c,2 -ki18np:1,2 -ki18ncp:1c,2,3 -ktr2i18n:1 \
+ -kI18N_NOOP:1 -kI18N_NOOP2:1c,2 -kaliasLocale -kki18n:1 -kki18nc:1c,2 -kki18np:1,2 -kki18ncp:1c,2,3 \
+ --msgid-bugs-address="${BUGADDR}" \
+ --files-from=infiles.list -D ${BASEDIR} -D ${WDIR} -o ${PROJECT}.pot || { echo "error while calling xgettext. aborting."; exit 1; }
+echo "Done extracting messages"
+
+echo "Merging translations"
+catalogs=`find . -name '*.po'`
+for cat in $catalogs; do
+ echo $cat
+ msgmerge -o $cat.new $cat ${PROJECT}.pot
+ mv $cat.new $cat
+done
+echo "Done merging translations"
+
+echo "Cleaning up"
+cd ${WDIR}
+rm rcfiles.list
+rm infiles.list
+rm rc.cpp
+echo "Done"
+