remove mo files from all other languages except en_US

This commit is contained in:
soochoi
2006-05-25 16:34:26 +00:00
parent f6913624b2
commit d94014d505
2 changed files with 191 additions and 105 deletions

View File

@@ -936,7 +936,7 @@ rpmBuild ()
# create the *.mo files
createMOFiles
cleanPOFile
# create the log directory
createLogDirectory
@@ -960,13 +960,13 @@ rpmBuild ()
createPOFile
# delete the yast2-CASA directory in the SOURCES directory
deleteSourcesDirectoryContents
# deleteSourcesDirectoryContents
# delete the spec file in the SPECS directory
deleteSpecsDirectoryContents
# deleteSpecsDirectoryContents
# delete the rpm in the RPMS directory
deleteRpmsDirectoryContents
# deleteRpmsDirectoryContents
# change to the package directory
echo ""
@@ -1208,52 +1208,86 @@ createPOFile ()
createMOFiles ()
{
# use the CASA.pofiles files from localization to create the CASA.mo files
cd $START_DIR
PO_DIRS="$START_DIR/pofiles/cs
$START_DIR/pofiles/de
$START_DIR/pofiles/en_US
$START_DIR/pofiles/es
$START_DIR/pofiles/fr
$START_DIR/pofiles/hu
$START_DIR/pofiles/it
$START_DIR/pofiles/ja
$START_DIR/pofiles/pl
$START_DIR/pofiles/pt_BR
$START_DIR/pofiles/ru
$START_DIR/pofiles/sk
$START_DIR/pofiles/sv
$START_DIR/pofiles/zh_CN
$START_DIR/pofiles/zh_TW"
echo ""
echo "************************************************************"
echo "[$SCRIPT_NAME] running createMOFiles()"
# use the CASA.pofiles files from localization to create the CASA.mo files
cd $START_DIR
PO_DIRS="$START_DIR/pofiles/en_US"
for PO_DIR in $PO_DIRS
do
echo "[$SCRIPT_NAME] $PO_DIR"
if [ ! -e $PO_DIR/$PO_FILE ]
then
echo ""
echo "[$SCRIPT_NAME] ERROR: $PO_DIR/$PO_FILE is missing."
echo ""
exit
else
msgfmt $PO_DIR/$PO_FILE --output-file=$PO_DIR/$MO_FILE
if [ $? -ne 0 ]; then
echo ""
echo "[$SCRIPT_NAME] ERROR: Failed to create $PO_DIR/$MO_FILE"
echo ""
exit
else
echo "[$SCRIPT_NAME] $PO_DIR/$MO_FILE created successfully"
fi
fi
done
echo ""
echo "************************************************************"
echo "[$SCRIPT_NAME] running createMOFiles()"
for PO_DIR in $PO_DIRS
do
echo "[$SCRIPT_NAME] $PO_DIR"
if [ ! -e $PO_DIR/$PO_FILE ]
then
echo ""
echo "[$SCRIPT_NAME] ERROR: $PO_DIR/$PO_FILE is missing."
echo ""
exit
else
msgfmt $PO_DIR/$PO_FILE --output-file=$PO_DIR/$MO_FILE
if [ $? -ne 0 ]; then
echo ""
echo "[$SCRIPT_NAME] ERROR: Failed to create $PO_DIR/$MO_FILE"
echo ""
exit
else
echo "[$SCRIPT_NAME] $PO_DIR/$MO_FILE created successfully"
fi
fi
done
}
#createMOFiles ()
#{
# # use the CASA.pofiles files from localization to create the CASA.mo files
# cd $START_DIR
# PO_DIRS="$START_DIR/pofiles/cs
# $START_DIR/pofiles/de
# $START_DIR/pofiles/en_US
# $START_DIR/pofiles/es
# $START_DIR/pofiles/fr
# $START_DIR/pofiles/hu
# $START_DIR/pofiles/it
# $START_DIR/pofiles/ja
# $START_DIR/pofiles/pl
# $START_DIR/pofiles/pt_BR
# $START_DIR/pofiles/ru
# $START_DIR/pofiles/sk
# $START_DIR/pofiles/sv
# $START_DIR/pofiles/zh_CN
# $START_DIR/pofiles/zh_TW"
#
# echo ""
# echo "************************************************************"
# echo "[$SCRIPT_NAME] running createMOFiles()"
#
# for PO_DIR in $PO_DIRS
# do
# echo "[$SCRIPT_NAME] $PO_DIR"
#
# if [ ! -e $PO_DIR/$PO_FILE ]
# then
# echo ""
# echo "[$SCRIPT_NAME] ERROR: $PO_DIR/$PO_FILE is missing."
# echo ""
# exit
# else
# msgfmt $PO_DIR/$PO_FILE --output-file=$PO_DIR/$MO_FILE
# if [ $? -ne 0 ]; then
# echo ""
# echo "[$SCRIPT_NAME] ERROR: Failed to create $PO_DIR/$MO_FILE"
# echo ""
# exit
# else
# echo "[$SCRIPT_NAME] $PO_DIR/$MO_FILE created successfully"
# fi
# fi
# done
#}
clean ()
{
cd $START_DIR
@@ -1314,20 +1348,56 @@ clean ()
cd $START_DIR
}
#cleanPOFile ()
#{
# # delete the CASA.po file
# cd $START_DIR
#
# if [ -e $START_DIR/$PO_FILE ]
# then
# echo ""
# echo "************************************************************"
# echo "[$SCRIPT_NAME] deleting $PO_FILE"
# rm $START_DIR/$PO_FILE
# fi
#
# cd $START_DIR
#}
cleanPOFile ()
{
# delete the CASA.po file
cd $START_DIR
if [ -e $START_DIR/$PO_FILE ]
then
echo ""
echo "************************************************************"
echo "[$SCRIPT_NAME] deleting $PO_FILE"
rm $START_DIR/$PO_FILE
fi
cd $START_DIR
# delete the CASA.po file
cd $START_DIR
echo ""
echo "************************************************************"
echo "[$SCRIPT_NAME] deleting the *.po files"
PO_FILE=CASA.po
PO_FILES="$START_DIR/pofiles/cs/$PO_FILE
$START_DIR/pofiles/de/$PO_FILE
$START_DIR/pofiles/es/$PO_FILE
$START_DIR/pofiles/fr/$PO_FILE
$START_DIR/pofiles/hu/$PO_FILE
$START_DIR/pofiles/it/$PO_FILE
$START_DIR/pofiles/ja/$PO_FILE
$START_DIR/pofiles/pl/$PO_FILE
$START_DIR/pofiles/pt_BR/$PO_FILE
$START_DIR/pofiles/ru/$PO_FILE
$START_DIR/pofiles/sk/$PO_FILE
$START_DIR/pofiles/sv/$PO_FILE
$START_DIR/pofiles/zh_CN/$PO_FILE
$START_DIR/pofiles/zh_TW/$PO_FILE"
for PO_PATH_AND_FILE in $PO_FILES
do
if [ -e $PO_PATH_AND_FILE ]
then
echo "[$SCRIPT_NAME] deleting $PO_PATH_AND_FILE"
rm $PO_PATH_AND_FILE
fi
done
cd $START_DIR
}
cleanPOTFile ()
@@ -1357,7 +1427,6 @@ cleanMOFiles ()
MO_FILES="$START_DIR/pofiles/cs/$MO_FILE
$START_DIR/pofiles/de/$MO_FILE
$START_DIR/pofiles/en_US/$MO_FILE
$START_DIR/pofiles/es/$MO_FILE
$START_DIR/pofiles/fr/$MO_FILE
$START_DIR/pofiles/hu/$MO_FILE