SOURCES: ZendFramework-find-lang.sh (NEW) - find locale files from ZendFram...

glen glen at pld-linux.org
Wed Oct 22 01:07:09 CEST 2008


Author: glen                         Date: Tue Oct 21 23:07:09 2008 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- find locale files from ZendFramework

---- Files affected:
SOURCES:
   ZendFramework-find-lang.sh (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: SOURCES/ZendFramework-find-lang.sh
diff -u /dev/null SOURCES/ZendFramework-find-lang.sh:1.1
--- /dev/null	Wed Oct 22 01:07:10 2008
+++ SOURCES/ZendFramework-find-lang.sh	Wed Oct 22 01:07:04 2008
@@ -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 at Latn
+
+	# TODO: <variant type="SAAHO"/>
+
+	lang=$language${territory:+_$territory}${script:+@$script}
+	echo "%lang($lang) ${file#$RPM_BUILD_ROOT} # $o" >> $langfile
+done
================================================================


More information about the pld-cvs-commit mailing list