]> TLD Linux GIT Repositories - packages/rpm-tld-macros.git/blobdiff - find-lang.sh
- merged 2.030 from PLD, re-enabled PHP dependency generators
[packages/rpm-tld-macros.git] / find-lang.sh
index 3e13e14f0d1b69bef89cbe81c90c3ed56c7eb3b3..5339946b68b7e9bd4cf21ccbae1d6df5a447880b 100755 (executable)
@@ -36,7 +36,7 @@
 #   * start support for KDE help files
 
 PROG=${0##*/}
-VERSION=1.40
+VERSION=1.42
 
 usage () {
 cat <<EOF
@@ -56,6 +56,7 @@ Additional options:
   --with-omf           find OMF files
   --with-qm                    find QT .qm files
   --with-django                find translations in Django project
+  --with-dokuwiki      find translations in dokuwiki plugins/templates
   --all-name           match all package/domain names
   --without-mo         skip *.mo locale files
   -o NAME                      output will be saved to NAME
@@ -90,6 +91,7 @@ KDE='#'
 OMF='#'
 QM='#'
 DJANGO='#'
+DOKUWIKI=false
 MO=''
 OUTPUT=$NAME.lang
 ALL_NAME='#'
@@ -97,6 +99,11 @@ NO_ALL_NAME=''
 APPEND=''
 while test $# -gt 0; do
     case "$1" in
+       --with-dokuwiki)
+               DOKUWIKI=true
+               echo >&2 "$PROG: Enabling with Dokuwiki"
+               shift
+               ;;
        --with-gnome)
                GNOME=''
                echo >&2 "$PROG: Enabling with GNOME"
@@ -156,6 +163,12 @@ while test $# -gt 0; do
     esac
 done
 
+if $DOKUWIKI; then
+       exec /usr/lib/rpm/dokuwiki-find-lang.sh "$TOP_DIR" "$NAME"
+       echo >&2 "$PROG: ERROR: Unable to execute dokuwiki-find-lang"
+       exit 2
+fi
+
 echo >&2 "$PROG/$VERSION: find-lang '$NAME' $APPEND> $OUTPUT"
 
 MO_NAME=.$OUTPUT.tmp~
@@ -224,12 +237,12 @@ s:%lang(C) ::' >> $MO_NAME
                cat __qm.files
        fi
 ) | sed '
-'"$NO_ALL_NAME$QM"'s:\(.*/'"$NAME"'_\([a-zA-Z]\{2\}\([_@].*\)\?\)\.qm$\):%lang(\2) \1:
+'"$NO_ALL_NAME$QM"'s:\(.*/'"$NAME"'_\([a-zA-Z]\{2,3\}\([_@].*\)\?\)\.qm$\):%lang(\2) \1:
 '"$NO_ALL_NAME$QM"'s:\(.*/share/locale/\)\([^/@]\+\)\(@quot\|@boldquot\)\?\(@[^/]*\)\?\(/.*/'"$NAME"'\.qm$\):%lang(\2\4) \1\2\3\4\5:
-'"$ALL_NAME$QM"'s:\(.*/[^/_]\+_\([a-zA-Z]\{2\}[_@].*\)\.qm$\):%lang(\2) \1:
-'"$ALL_NAME$QM"'s:\(.*/[^/_]\+_\([a-zA-Z]\{2\}\)\.qm$\):%lang(\2) \1:
-'"$ALL_NAME$QM"'s:^\([^%].*/[^/]\+_\([a-zA-Z]\{2\}[_@].*\)\.qm$\):%lang(\2) \1:
-'"$ALL_NAME$QM"'s:^\([^%].*/[^/]\+_\([a-zA-Z]\{2\}\)\.qm$\):%lang(\2) \1:
+'"$ALL_NAME$QM"'s:\(.*/[^/_]\+_\([a-zA-Z]\{2,3\}[_@].*\)\.qm$\):%lang(\2) \1:
+'"$ALL_NAME$QM"'s:\(.*/[^/_]\+_\([a-zA-Z]\{2,3\}\)\.qm$\):%lang(\2) \1:
+'"$ALL_NAME$QM"'s:^\([^%].*/[^/]\+_\([a-zA-Z]\{2,3\}[_@].*\)\.qm$\):%lang(\2) \1:
+'"$ALL_NAME$QM"'s:^\([^%].*/[^/]\+_\([a-zA-Z]\{2,3\}\)\.qm$\):%lang(\2) \1:
 s:^[^%].*::
 /^[^%]/d
 s:%lang(C) ::' >> $MO_NAME