#!/bin/bash # mkLangFile.sh # # Run this script with `sh mkLangFile.sh' to extract the language # settings from Qdig and save them to a file. # country_code=XX qdig_file=index.php if [[ -e lang-$country_code.php ]] ; then echo "$0: lang-$country_code.php file already exists." >/dev/stderr exit fi if ! grep qdig_version $qdig_file>/dev/null ; then echo "$0: $qdig_file appears not to be the Qdig script." >/dev/stderr exit fi if echo "lang-$country_code.php ; then echo "Starting script." else echo "$0: Error" >/dev/stderr exit fi echo -n "/* +----------------------------------------------------------------------+ | Qdig - A Quick Digital Image Gallery | | This is a Qdig Language Settings file. The settings in this file | will override the ones in the script. To use this file, include | it with an | | @include_once('./lang-xx.php'); | | statement at the end of the settings portion of the Qdig script. | +----------------------------------------------------------------------+ | Translation Notes: | +----------------------------------------------------------------------+ " >> lang-$country_code.php # echo -n "| Copyright 2002, 2003, 2004, 2005, 2005 Hagan Fox | This program is distributed under the terms of the | GNU General Public License, Version 2 | | This program is free software; you can redistribute it and/or modify | it under the terms of the GNU General Public License, Version 2 as | published by the Free Software Foundation. | | This program is distributed in the hope that it will be useful, | but WITHOUT ANY WARRANTY; without even the implied warranty of | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | GNU General Public License for more details. | | You should have received a copy of the GNU General Public License, | Version 2 along with this program; if not, visit GNU's Home Page | http://www.gnu.org/ +----------------------------------------------------------------------+ " >> /dev/null #lang-$country_code.php # echo "*/" >> lang-$country_code.php if grep "#$" index.php\ |sed "s/#$//"\ |sed "s/CVS: \$Id: index.php,v/Extracted from CVS version/"\ |sed "s/haganfox Exp \$\$//"\ |sed "s/ (lang)//"\ >> lang-$country_code.php ; then echo " Extracting Qdig language settings to \"lang-$country_code.php\"." fi echo "Done." # vim:set tabstop=4 shiftwidth=4 :