l10n-configure.sh revision 13776
537857b204a4425e0ea257b0413a02c5c7c5e266Robert Wapshott# This script modifies configure.in, .po files, po/Makefile.in.in and so on
537857b204a4425e0ea257b0413a02c5c7c5e266Robert Wapshott# to configure l10n for Sun platforms. '--help' option shows the usage.
537857b204a4425e0ea257b0413a02c5c7c5e266Robert Wapshott# CDDL HEADER START
537857b204a4425e0ea257b0413a02c5c7c5e266Robert Wapshott# The contents of this file are subject to the terms of the
537857b204a4425e0ea257b0413a02c5c7c5e266Robert Wapshott# Common Development and Distribution License, Version 1.0 only
537857b204a4425e0ea257b0413a02c5c7c5e266Robert Wapshott# (the "License"). You may not use this file except in compliance
537857b204a4425e0ea257b0413a02c5c7c5e266Robert Wapshott# with the License.
537857b204a4425e0ea257b0413a02c5c7c5e266Robert Wapshott# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
537857b204a4425e0ea257b0413a02c5c7c5e266Robert Wapshott# or http://www.opensolaris.org/os/licensing.
537857b204a4425e0ea257b0413a02c5c7c5e266Robert Wapshott# See the License for the specific language governing permissions
537857b204a4425e0ea257b0413a02c5c7c5e266Robert Wapshott# and limitations under the License.
537857b204a4425e0ea257b0413a02c5c7c5e266Robert Wapshott# When distributing Covered Code, include this CDDL HEADER in each
537857b204a4425e0ea257b0413a02c5c7c5e266Robert Wapshott# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
537857b204a4425e0ea257b0413a02c5c7c5e266Robert Wapshott# If applicable, add the following below this CDDL HEADER, with the
537857b204a4425e0ea257b0413a02c5c7c5e266Robert Wapshott# fields enclosed by brackets "[]" replaced with your own identifying
537857b204a4425e0ea257b0413a02c5c7c5e266Robert Wapshott# information: Portions Copyright [yyyy] [name of copyright owner]
537857b204a4425e0ea257b0413a02c5c7c5e266Robert Wapshott# CDDL HEADER END
537857b204a4425e0ea257b0413a02c5c7c5e266Robert Wapshott# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
537857b204a4425e0ea257b0413a02c5c7c5e266Robert Wapshott# Use is subject to license terms.
537857b204a4425e0ea257b0413a02c5c7c5e266Robert WapshottSUN_ALL_LINGUAS="cs de es fr hu it ja ko pl pt_BR ru sv zh_CN zh_HK zh_TW"
537857b204a4425e0ea257b0413a02c5c7c5e266Robert Wapshott printf "This script modify ALL_LINGUAS parameter in configure.in file. \n"
537857b204a4425e0ea257b0413a02c5c7c5e266Robert Wapshott printf "usage: $PROGNAME Version $PROG_VERSION [OPTION...] \n"
537857b204a4425e0ea257b0413a02c5c7c5e266Robert Wapshott printf " -c, --enable-copyright Modify po/Makefile.in.in and gnome-doc-utils.make\n"
537857b204a4425e0ea257b0413a02c5c7c5e266Robert Wapshott printf " so that the copyright information is installed\n"
537857b204a4425e0ea257b0413a02c5c7c5e266Robert Wapshott printf " gnome-doc-prepare need to be run before\n"
537857b204a4425e0ea257b0413a02c5c7c5e266Robert Wapshott printf " this script is run if you run them.\n"
537857b204a4425e0ea257b0413a02c5c7c5e266Robert Wapshott printf " -l, --enable-sun-linguas Modify ALL_LINGUAS for Sun translations.\n"
537857b204a4425e0ea257b0413a02c5c7c5e266Robert Wapshott printf " -p, --enable-pot Generate .pot file for internal. \n"
537857b204a4425e0ea257b0413a02c5c7c5e266Robert Wapshott printf " -x, --disable-gnu-extensions Remove GNU extensions in po/*.po files. \n"
537857b204a4425e0ea257b0413a02c5c7c5e266Robert Wapshott while [ $# -gt 0 ]
-V|--version)
echo $PROG_VERSION;
-x|--disable-gnu-extensions)
if [ -f configure.in ] ; then
elif [ -f configure.ac ] ; then
if [ ! -d po ] ; then
if [ -f po/Makefile.in.in ] ; then
dir=$DL(DESTDIR)$DL(itlocaledir)/$DL${DL}lang/LC_MESSAGES; $BS
echo ${DQ}Copyright for $DL(GETTEXT_PACKAGE).mo$DQ >> $DL${DL}dir/$DL(GETTEXT_PACKAGE).ui.copyright; $BS
cat $DL${DL}lang.po | while read line; $BS
break; $BS
fi; $BS
echo $DQ$DL${DL}line$DQ | sed -e ${DQ}s/^#$BS(.*$BS)/ ${BS}1/$DQ >> $DL${DL}dir/$DL(GETTEXT_PACKAGE).ui.copyright; $BS
done; $BS
mv po/Makefile.in.in.$$ po/Makefile.in.in
if [ -f gnome-doc-utils.make ] ; then
echo ${DQ}Copyright for $DL(DOC_MODULE)$DQ >> $DL(DESTDIR)/$DL(HELP_DIR)/$DL(DOC_MODULE)/$DL${DL}lc/$DL(DOC_MODULE).help.copyright; ${BS}
do ${BS}
break; ${BS}
fi; ${BS}
echo $DQ$DL${DL}line$DQ | sed -e ${DQ}s/^#$BS(.*$BS)/ ${BS}1/$DQ >> $DL(DESTDIR)/$DL(HELP_DIR)/$DL(DOC_MODULE)/$DL${DL}lc/$DL(DOC_MODULE).help.copyright; ${BS}
done; ${BS}
echo $DQ$DQ >> $DL(DESTDIR)/$DL(HELP_DIR)/$DL(DOC_MODULE)/$DL${DL}lc/$DL(DOC_MODULE).help.copyright; ${BS}
echo ${DQ}installing $DL(DOC_MODULE).help.copyright in $DL(DESTDIR)/$DL(HELP_DIR)/$DL(DOC_MODULE)/$DL${DL}lc$DQ; ${BS}
fi; ${BS}
*.po`
| uniq \
| sort \
| uniq \
PO_DIRS=po*/POTFILES.in
cat missing >> POTFILES.in
mv ${POT}.$$ $POT
init $@
if [ $DISABLE_GNU_EXTENSIONS -eq 1 ] ; then
if [ $ENABLE_SUN_ALL_LINGUAS -eq 1 ] ; then
if [ $ENABLE_COPYRIGHT -eq 1 ] ; then
main $@