|
|
4c79b5 |
#!/bin/bash
|
|
|
4c79b5 |
#
|
|
|
4c79b5 |
# help_createLanguageLayout.sh -- This function creates texinfo's main
|
|
|
4c79b5 |
# documentation structure for an specific language.
|
|
|
4c79b5 |
#
|
|
|
4c79b5 |
# Copyright (C) 2009-2010 Alain Reguera Delgado
|
|
|
4c79b5 |
#
|
|
|
4c79b5 |
# This program is free software; you can redistribute it and/or modify
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
#
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
# General Public License for more details.
|
|
|
4c79b5 |
#
|
|
|
4c79b5 |
|
|
|
4c79b5 |
# along with this program; if not, write to the Free Software
|
|
|
4c79b5 |
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
|
|
4c79b5 |
# USA.
|
|
|
4c79b5 |
#
|
|
|
4c79b5 |
# ------------------------------------------------------------
|
|
|
4c79b5 |
# $Id: help_createLanguageLayout.sh 98 2010-09-19 16:01:53Z al $
|
|
|
4c79b5 |
# ----------------------------------------------------------------------
|
|
|
4c79b5 |
|
|
|
4c79b5 |
function help_createLanguageLayout {
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
local COUNTER=0
|
|
|
4c79b5 |
local MESSAGE=''
|
|
|
4c79b5 |
|
|
|
4c79b5 |
# Initialize translation markers for texinfo manual template.
|
|
|
4c79b5 |
local DOCTPL[0]="`gettext "Set the document's title"`"
|
|
|
4c79b5 |
local DOCTPL[1]="`gettext "Set the document's subtitle"`"
|
|
|
4c79b5 |
local DOCTPL[2]="`gettext "Set the document's description"`"
|
|
|
4c79b5 |
local DOCTPL[3]="`gettext "Set the document's author"`"
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
for MESSAGE in "${DOCTPL[@]}";do
|
|
|
4c79b5 |
cli_printMessage "`gettext "Step"` ${COUNTER}: $MESSAGE:" "AsRequestLine"
|
|
|
4c79b5 |
read DOCTPL[${COUNTER}]
|
|
|
4c79b5 |
if [[ ! $DOCTPL[${COUNTER}] =~ '[[:print:]]+' ]];then
|
|
|
4c79b5 |
cli_printMessage "`gettext "The string entered isn't valid."`"
|
|
|
1f1b3c |
cli_printMessage "$(caller)" "AsToKnowMoreLine"
|
|
|
4c79b5 |
fi
|
|
|
4c79b5 |
COUNTER=$(($COUNTER + 1))
|
|
|
4c79b5 |
done
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
local LANGNAME=$(cli_getLangName $(cli_getCurrentLocale))
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
if [[ ! -d ${MANUALS_DIR[2]} ]];then
|
|
|
4c79b5 |
mkdir -p ${MANUALS_DIR[2]}
|
|
|
4c79b5 |
fi
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
cat ${MANUALS_DIR[6]}/repository.texi \
|
|
|
4c79b5 |
| sed -r "s!=TITLE=!${DOCTPL[0]}!g" \
|
|
|
4c79b5 |
| sed -r "s!=SUBTITLE=!${DOCTPL[1]}!g" \
|
|
|
4c79b5 |
| sed -r "s!=DESCRIPTION=!${DOCTPL[2]}!g" \
|
|
|
4c79b5 |
| sed -r "s!=AUTHOR=!${DOCTPL[3]}!g" \
|
|
|
4c79b5 |
| sed -r "s!=LANGUAGE=!$(cli_getLangCodes $(cli_getCurrentLocale))!g" \
|
|
|
4c79b5 |
> ${MANUALS_DIR[2]}/repository.texi
|
|
|
4c79b5 |
|
|
|
4c79b5 |
# Copy menu and nodes from template to texinfo document structure.
|
|
|
4c79b5 |
cp ${MANUALS_DIR[6]}/$(basename ${MANUALS_FILE[2]}) ${MANUALS_DIR[2]}/
|
|
|
4c79b5 |
cp ${MANUALS_DIR[6]}/$(basename ${MANUALS_FILE[3]}) ${MANUALS_DIR[2]}/
|
|
|
4c79b5 |
cp ${MANUALS_DIR[6]}/$(basename ${MANUALS_FILE[11]}) ${MANUALS_DIR[2]}/
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
sed -r -i "s!Index!`gettext "Index"`!" ${MANUALS_FILE[11]} ${MANUALS_FILE[2]}
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
cli_printMessage "`eval_gettext "The \\\"\\\$LANGNAME\\\" documentation structure has been created."`"
|
|
|
4c79b5 |
|
|
|
4c79b5 |
}
|