Re: iso-codes's change cause a countrychooser error
Quoting Carlos Z.F. Liu (carlos_liu@yahoo.com):
> Hello,
>
> Since iso-codes changed "Taiwan" to "Taiwan, Province of China", the
> whole pharse are showed as two seperated choices.
> Please look at the screenshot:
> http://linuxfire.dhis.org/~carlos/screenshots/countrychooser_err.png
Hmmm. I took care of this in the full list build by replacing ", " by
" - ". However, this was forgotten in postinst where the short list is
built dynamically.
The attached patch should solve this (untested).
--- postinst.old 2004-03-23 19:26:38.000000000 +0100
+++ postinst 2004-03-29 13:25:40.000000000 +0200
@@ -49,7 +49,7 @@
}
country2code() {
- COUNTRYNAME=$(echo "$1" | sed "s/^$INDENT//")
+ COUNTRYNAME=$(echo "$1" | sed "s/^$INDENT//" | sed "s/ - /, /g")
line=`grep "$COUNTRYNAME$" $countries`
if [ -n "$line" ]; then
@@ -123,7 +123,7 @@
set $line
IFS="$OLD_IFS"
if [ "$2" ]; then
- countryname="${INDENT}$2";
+ countryname=$(echo "${INDENT}$2" | sed "s/, / - /g")
fi
if [ ! -z "${SHORTLIST}" ]; then
SHORTLIST="${SHORTLIST}, "
Reply to: