]> git.pld-linux.org Git - packages/ZendFramework.git/commitdiff
- find locale files from ZendFramework
authorElan Ruusamäe <glen@pld-linux.org>
Tue, 21 Oct 2008 23:07:04 +0000 (23:07 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    ZendFramework-find-lang.sh -> 1.1

ZendFramework-find-lang.sh [new file with mode: 0644]

diff --git a/ZendFramework-find-lang.sh b/ZendFramework-find-lang.sh
new file mode 100644 (file)
index 0000000..5a7778f
--- /dev/null
@@ -0,0 +1,29 @@
+#!/bin/sh
+dir=$RPM_BUILD_ROOT/usr/share/pear/Zend/Locale/Data
+langfile=${1:-ZendFramework.lang}
+
+> $langfile
+find $dir -type f -name '*.xml' | while read file; do
+       file=${file#$RPM_BUILD_ROOT}
+
+       case "${file##*/}" in
+       supplementalData.xml)
+               # skip - no lang tag for this one
+               continue
+               ;;
+       esac
+
+       language=$(sed -ne 's/<language type="\(.*\)"\/>/\1/p' $file | xargs)
+       script=$(sed -ne 's/<script type="\(.*\)"\/>/\1/p' $file | xargs)
+       territory=$(sed -ne 's/<territory type="\(.*\)"\/>/\1/p' $file | xargs)
+
+       #<language type="sr"/>
+       #<script type="Latn"/>
+       #<territory type="BA"/>
+       # sr_Latn_BA.xml -> sr_BA@Latn
+
+       # TODO: <variant type="SAAHO"/>
+
+       lang=$language${territory:+_$territory}${script:+@$script}
+       echo "%lang($lang) ${file#$RPM_BUILD_ROOT} # $o" >> $langfile
+done
This page took 0.068473 seconds and 4 git commands to generate.