diff --git a/Automation/Modules/Locale/Modules/Update/Modules/Asciidoc/asciidoc.sh b/Automation/Modules/Locale/Modules/Update/Modules/Asciidoc/asciidoc.sh index 5b4a1d3..439d1a6 100755 --- a/Automation/Modules/Locale/Modules/Update/Modules/Asciidoc/asciidoc.sh +++ b/Automation/Modules/Locale/Modules/Update/Modules/Asciidoc/asciidoc.sh @@ -1,15 +1,21 @@ #!/bin/bash +###################################################################### # -# locale_updateMessageXmlDocbook.sh -- This function retrieves -# translation messages from Docbook files and creates related portable -# object template for them. +# Modules/Locale/Modules/Update/Modules/Asciidoc/asciidoc.sh -- This +# module takes one or more asciidoc files as source and produces +# docbook temporal files for one of them. The docbook temporal files +# are used to create portable objects to different locale +# information. +# +# Written by: +# * Alain Reguera Delgado , 2013 # # Copyright (C) 2009-2013 The CentOS Project # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or (at -# your option) any later version. +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of @@ -20,36 +26,32 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- +###################################################################### function asciidoc { - # Define location where translation files will be stored in. - local L10N_WORKDIR=$(cli_getLocalizationDir ${ACTIONVAL}) - - # Define regular expression to match extensions of shell scripts - # we use inside the repository. - local EXTENSION='docbook' - - # Define absolute paths to Docbook main file. - local TEMPLATE=$(cli_getFilesList ${ACTIONVAL} \ - --maxdepth=1 --mindepth=1 --type='f' \ - --pattern=".+/$(cli_getRepoName ${ACTIONVAL} -f)\.${EXTENSION}$") - - # Process Docbook template files based on whether it is empty or - # not. When it is empty, it is because there is not a Docbook main - # file in the location provided to centos-art.sh script - # command-line. In this case, we try to create one POT file to all - # docbook files inside the location provided but without expanding - # entities. When Docbook template file is not empty, expand - # entities and create the POT file from a Docbook main file - # instance, with all entities expanded. - if [[ -z ${TEMPLATE} ]];then - locale_updateMessageXmlDocbookNoEntities - else - locale_updateMessageXmlDocbookWithEntities - fi + local ASCIIDOC_FILE='' + + for ASCIIDOC_FILE in ${SOURCES[*]};do + + # Define POT's default location using the source file as + # reference. The portable object template is + # locale-independent so it must be out of locale-specific + # directories. + local POT_FILE=$(basename ${ASCIIDOC_FILE}).pot + + tcar_printMessage "${POT_FILE}" --as-creating-line + + local DOCBOOK_FILE=$(tcar_getTemporalFile $(basename ${ASCIIDOC_FILE})).docbook + + asciidoc_convertAsciidocToDocbook + + locale_convertXmlToPot "${DOCBOOK_FILE}" "${POT_FILE}" + + # Verify, initialize or merge portable objects from portable + # object templates. + locale_updateMessagePObjects "${POT_FILE}" + done + } diff --git a/Automation/Modules/Locale/Modules/Update/Modules/Asciidoc/asciidoc_convertAsciidocToDocbook.sh b/Automation/Modules/Locale/Modules/Update/Modules/Asciidoc/asciidoc_convertAsciidocToDocbook.sh new file mode 100755 index 0000000..cf6c1e3 --- /dev/null +++ b/Automation/Modules/Locale/Modules/Update/Modules/Asciidoc/asciidoc_convertAsciidocToDocbook.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +function asciidoc_convertAsciidocToDocbook { + + /usr/bin/asciidoc --backend="docbook" --doctype="${RENDER_FLOW}" \ + --out-file=${DOCBOOK_FILE} ${ASCIIDOC_FILE} + +} diff --git a/Automation/Modules/Locale/Modules/Update/Modules/Asciidoc/asciidoc_updateMessageXmlDocbookNoEntities.sh b/Automation/Modules/Locale/Modules/Update/Modules/Asciidoc/asciidoc_updateMessageXmlDocbookNoEntities.sh deleted file mode 100755 index 67d6f75..0000000 --- a/Automation/Modules/Locale/Modules/Update/Modules/Asciidoc/asciidoc_updateMessageXmlDocbookNoEntities.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/bash -# -# locale_updateMessageXmlDocbookNoEntities.sh -- This function creates -# an instance of one or more Docbook files without expanding entities -# inside it, retrieves all translatable strings from main file -# instance, and creates the related portable object template POT for -# them. This is useful to localize Docbook files that aren't direct -# part of a documentation manual but included at rendition time (e.g., -# Docbook files holding license information). -# -# Copyright (C) 2009-2013 The CentOS Project -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or (at -# your option) any later version. -# -# 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 -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function locale_updateMessageXmlDocbookNoEntities { - - # In case no path to Docbook main file is not found, go deeper - # into the documentation models directory structure looking for - # files that do match the name of the directory who hold it, and - # use that file as template to initiate localization process. The - # way to reach these files have to be through --filter options - # because we want to respect the restrictions imposed by - # locale_isLocalizable function inside the repository. - # CAUTION: entity expansion the files found this way will be # ignored. - local TEMPLATES=$(cli_getFilesList ${ACTIONVAL} --type='f' \ - --pattern=".+/${FLAG_FILTER}.+\.${EXTENSION}$") - - # Verify number of template files found and define what kind of - # processing they are going to have. In case more than one - # template file be found and because entity expansion will be - # ignored in such case, the whole process of creating the PO file - # for all these templates is also different (simpler) from that we - # use with entity expansion. - - for TEMPLATE in ${TEMPLATES};do - - # Redefine path related to localization work directory. - local L10N_WORKDIR=$(cli_getLocalizationDir "$TEMPLATE") - - # Define location of the file used to create both portable - # object templates (.pot) and portable objects (.po) files. - local MESSAGES="${L10N_WORKDIR}/messages" - - # Print action message. - cli_printMessage "${MESSAGES}.pot" --as-updating-line - - # Extract translatable strings from docbook files and merge - # them down into related messages file. - xml2po -a -l ${CLI_LANG_LL} -o ${MESSAGES}.pot ${TEMPLATE} - - # Verify, initialize or merge portable objects from portable - # object templates. - locale_updateMessagePObjects "${MESSAGES}" - - done - -} diff --git a/Automation/Modules/Locale/Modules/Update/Modules/Asciidoc/asciidoc_updateMessageXmlDocbookWithEntities.sh b/Automation/Modules/Locale/Modules/Update/Modules/Asciidoc/asciidoc_updateMessageXmlDocbookWithEntities.sh deleted file mode 100755 index 352e5b9..0000000 --- a/Automation/Modules/Locale/Modules/Update/Modules/Asciidoc/asciidoc_updateMessageXmlDocbookWithEntities.sh +++ /dev/null @@ -1,74 +0,0 @@ -#!/bin/bash -# -# locale_updateMessageXmlDocbookWithEntities.sh -- This function -# creates an instance of Docbook main file, expands entities inside -# it, retrieves all translatable strings from main file instance, and -# creates the related portable object template POT for them. -# -# Copyright (C) 2009-2013 The CentOS Project -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or (at -# your option) any later version. -# -# 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 -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function locale_updateMessageXmlDocbookWithEntities { - - # Define location of the file used to create both portable object - # templates (.pot) and portable objects (.po) files. - local MESSAGES="${L10N_WORKDIR}/messages" - - # Print action message. - cli_printMessage "${MESSAGES}.pot" --as-updating-line - - # Define file name used as template instance. Here is where we - # expand translation markers and entities before retrieving - # translation messages. - local INSTANCE=$(cli_getTemporalFile "$(basename ${TEMPLATE})") - - # Create the non-translated instance of design model. - cp ${TEMPLATE} ${INSTANCE} - - # Expand common contents inside instance. - cli_exportFunctions "Render/Docbook/docbook_setExpansionLicenses" - docbook_setExpansionLicenses ${INSTANCE} - - # When translated instances are rendered, system entities (e.g., - # `%entity-name;') don't appear in the translated instance (it - # seems that xml2po removes them) and this provokes DocBook - # validation to fail. So in order to pass the validation - # successfully and automate the whole creation of system entities, - # don't let this duty ion users'. Instead, make centos-art.sh - # script responsible of it. - cli_exportFunctions "Render/Docbook/docbook_setExpansionSystemEntities" - docbook_setExpansionSystemEntities ${INSTANCE} - - # Create portable object template from instance. Validate - # translated instance before processing it. This step is very - # important in order to detect document's malformations and warn - # you about it, so you can correct them. - xmllint --valid --noent ${INSTANCE} | xml2po -a -l ${CLI_LANG_LC} - \ - | msgcat --output=${MESSAGES}.pot \ - --width=70 --no-location - - - # Expand translation markers inside file. - cli_expandTMarkers ${INSTANCE} - - # Verify, initialize or merge portable objects from portable - # object templates. - locale_updateMessagePObjects "${MESSAGES}" - -} diff --git a/Automation/Modules/Locale/Modules/Update/Modules/Svg/Modules/Update/update.sh b/Automation/Modules/Locale/Modules/Update/Modules/Svg/Modules/Update/update.sh deleted file mode 100755 index a0abe94..0000000 --- a/Automation/Modules/Locale/Modules/Update/Modules/Svg/Modules/Update/update.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash - -function update { - - local FILE='' - local POT=$(dirname ${CONFIGURATION})/messages.pot - local TEMPFILES='' - - # Define regular expression to match extensions of shell scripts - # we use inside the repository. - local EXTENSION='(svgz|svg)' - - # Process list of directories, one by one. - for FILE in ${SOURCES[*]};do - - local TEMPFILE=$(tcar_getTemporalFile $(basename ${FILE})) - - if [[ $(file -b -i ${FILE}) =~ '^application/x-gzip$' ]];then - /bin/zcat ${FILE} > ${TEMPFILE} - else - /bin/cat ${FILE} > ${TEMPFILE} - fi - - TEMPFILES="${TEMPFILE} ${TEMPFILES}" - - done - - # - if [[ ! -d $(dirname ${TRANSLATIONS[0]}) ]];then - mkdir -p $(dirname ${TRANSLATIONS[0]}) - fi - - # Print action message. - tcar_printMessage "${POT}" --as-creating-line - - # Create the portable object template. - cat ${TEMPFILES} | xml2po -a -l ${TCAR_SCRIPT_LANG_LC} - \ - | msgcat --output=${POT} --width=70 --no-location - - - # Verify, initialize or merge portable objects from portable - # object templates. - locale_updateMessagePObjects "${POT}" - -} diff --git a/Automation/Modules/Locale/Modules/Update/Modules/Svg/svg.conf.sh b/Automation/Modules/Locale/Modules/Update/Modules/Svg/svg.conf.sh deleted file mode 100755 index bd6d681..0000000 --- a/Automation/Modules/Locale/Modules/Update/Modules/Svg/svg.conf.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -declare -x TCAR_SCRIPT_MODULES_BASEDIR=${MODULE_DIR_MODULES} diff --git a/Automation/Modules/Locale/Modules/Update/Modules/Svg/svg.sh b/Automation/Modules/Locale/Modules/Update/Modules/Svg/svg.sh index 494d3da..58fced2 100755 --- a/Automation/Modules/Locale/Modules/Update/Modules/Svg/svg.sh +++ b/Automation/Modules/Locale/Modules/Update/Modules/Svg/svg.sh @@ -28,43 +28,30 @@ function svg { - local FILE='' - local POT=$(dirname ${CONFIGURATION})/messages.pot - local TEMPFILES='' + local SVG_FILE='' - # Define regular expression to match extensions of shell scripts - # we use inside the repository. - local EXTENSION='(svgz|svg)' + for SVG_FILE in ${SOURCES[*]};do - # Process list of directories, one by one. - for FILE in ${SOURCES[*]};do + # Define POT's default location using the source file as + # reference. The portable object template is + # locale-independent so it must be out of locale-specific + # directories. + local POT_FILE=$(basename ${SVG_FILE}).pot - local TEMPFILE=$(tcar_getTemporalFile $(basename ${FILE})) + tcar_printMessage "${POT_FILE}" --as-creating-line - if [[ $(file -b -i ${FILE}) =~ '^application/x-gzip$' ]];then - /bin/zcat ${FILE} > ${TEMPFILE} - else - /bin/cat ${FILE} > ${TEMPFILE} - fi + local SVG_INSTANCE=$(tcar_getTemporalFile $(basename ${SVG_FILE})) - TEMPFILES="${TEMPFILE} ${TEMPFILES}" + svg_createSvgInstance - done + locale_convertXmlToPot "${SVG_INSTANCE}" "${POT_FILE}" - # - if [[ ! -d $(dirname ${TRANSLATIONS[0]}) ]];then - mkdir -p $(dirname ${TRANSLATIONS[0]}) - fi + # Verify, initialize or merge portable objects from portable + # object templates. + locale_updateMessagePObjects "${POT_FILE}" - # Print action message. - tcar_printMessage "${POT}" --as-creating-line + done - # Create the portable object template. - cat ${TEMPFILES} | xml2po -a -l ${TCAR_SCRIPT_LANG_LC} - \ - | msgcat --output=${POT} --width=70 --no-location - - # Verify, initialize or merge portable objects from portable - # object templates. - locale_updateMessagePObjects "${POT}" } diff --git a/Automation/Modules/Locale/Modules/Update/Modules/Svg/svg_createSvgInstance.sh b/Automation/Modules/Locale/Modules/Update/Modules/Svg/svg_createSvgInstance.sh new file mode 100755 index 0000000..e8b4089 --- /dev/null +++ b/Automation/Modules/Locale/Modules/Update/Modules/Svg/svg_createSvgInstance.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +function svg_createSvgInstance { + + if [[ $(file -b -i ${SVG_FILE}) =~ '^application/x-gzip$' ]];then + /bin/zcat ${SVG_FILE} > ${SVG_INSTANCE} + else + /bin/cat ${SVG_FILE} > ${SVG_INSTANCE} + fi + +} diff --git a/Automation/Modules/Locale/Modules/Update/update.conf.sh b/Automation/Modules/Locale/Modules/Update/update.conf.sh new file mode 100755 index 0000000..bd6d681 --- /dev/null +++ b/Automation/Modules/Locale/Modules/Update/update.conf.sh @@ -0,0 +1,2 @@ +#!/bin/bash +declare -x TCAR_SCRIPT_MODULES_BASEDIR=${MODULE_DIR_MODULES} diff --git a/Automation/Modules/Locale/Modules/Update/update.sh b/Automation/Modules/Locale/Modules/Update/update.sh new file mode 100755 index 0000000..a611c4e --- /dev/null +++ b/Automation/Modules/Locale/Modules/Update/update.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +function update { + + tcar_setModuleEnvironment "${RENDER_TYPE}" "${@}" + +} diff --git a/Automation/Modules/Locale/locale_convertXmlToPot.sh b/Automation/Modules/Locale/locale_convertXmlToPot.sh new file mode 100755 index 0000000..34c7d72 --- /dev/null +++ b/Automation/Modules/Locale/locale_convertXmlToPot.sh @@ -0,0 +1,10 @@ +#!/bin/bash +function locale_convertXmlToPot { + + local XML_FILE=${1} + local POT_FILE=${2} + + cat ${XML_FILE} | xml2po -a -l ${TCAR_SCRIPT_LANG_LC} - \ + | msgcat --output-file=${POT_FILE} --width=70 --no-location - + +} diff --git a/Automation/Modules/Locale/locale_setLocaleType.sh b/Automation/Modules/Locale/locale_setLocaleType.sh index 08049cb..62f0b40 100755 --- a/Automation/Modules/Locale/locale_setLocaleType.sh +++ b/Automation/Modules/Locale/locale_setLocaleType.sh @@ -34,10 +34,7 @@ function locale_setLocaleType { local SECTION=${SECTIONS[${COUNTER}]} - local RENDER_TYPE=$(tcar_getConfigValue "${CONFIGURATION}" "${SECTION}" "render-type") - local RENDER_FROM=$(tcar_getConfigValue "${CONFIGURATION}" "${SECTION}" "render-from") - for SOURCE in ${RENDER_FROM};do if [[ ${SOURCE} =~ "^/" ]];then SOURCES[((++${#SOURCES[*]}))]=${SOURCE} @@ -46,12 +43,12 @@ function locale_setLocaleType { fi done + local RENDER_TYPE=$(tcar_getConfigValue "${CONFIGURATION}" "${SECTION}" "render-type") if [[ -z ${RENDER_TYPE} ]];then RENDER_TYPE=$(echo ${SOURCES[0]} | sed -r 's/.+\.([[:alpha:]]+)$/\1/') fi local LOCALE_FROM=$(tcar_getConfigValue "${CONFIGURATION}" "${SECTION}" "locale-from") - for TRANSLATION in ${LOCALE_FROM};do if [[ ${TRANSLATION} =~ "^/" ]];then TRANSLATIONS[((++${#TRANSLATIONS[*]}))]=${TRANSLATION} @@ -60,8 +57,15 @@ function locale_setLocaleType { fi done + RENDER_FLOW=$(tcar_getConfigValue "${CONFIGURATION}" "${SECTION}" "render-flow") + if [[ -z ${RENDER_FLOW} ]];then + RENDER_FLOW='article' + fi + # Initialize locale's modules. - tcar_setModuleEnvironment "${RENDER_TYPE}" "${@}" + for LOCALE_ACTION in ${LOCALE_ACTIONS};do + tcar_setModuleEnvironment "${LOCALE_ACTION}" "${@}" + done # Increment section's counter. COUNTER=$(( ${COUNTER} + 1 )) diff --git a/Automation/Modules/Locale/locale_updateMessageMetadata.sh b/Automation/Modules/Locale/locale_updateMessageMetadata.sh index 72f539e..be07ab6 100755 --- a/Automation/Modules/Locale/locale_updateMessageMetadata.sh +++ b/Automation/Modules/Locale/locale_updateMessageMetadata.sh @@ -18,7 +18,7 @@ # # 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 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPO_FILESE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License @@ -34,10 +34,10 @@ function locale_updateMessageMetadata { local -a DST # Retrieve absolute path of portable object we'll work with. - local PO="${1}" + local PO_FILE="${1}" # Check existence of file before work with it. - tcar_checkFiles "${PO}" -f + tcar_checkFiles "${PO_FILE}" -f # Define pattern lines. The pattern lines are put inside portable # objects through xgettext and xml2po commands. In the case of @@ -49,18 +49,18 @@ function locale_updateMessageMetadata { SRC[1]="\"Report-Msgid-Bugs-To:" SRC[2]="\"Last-Translator: (.+)?" SRC[3]="\"Language-Team:" - SRC[4]="\"PO-Revision-Date:" + SRC[4]="\"PO_FILE-Revision-Date:" # Define replacement lines for pattern line. DST[0]="\"Project-Id-Version: ${TCAR_SCRIPT_NAME} ${TCAR_SCRIPT_VERSION}\\\n\"" DST[1]="\"Report-Msgid-Bugs-To: Documentation SIG \\\n\"" DST[2]="\"Last-Translator: Documentation SIG \\\n\"" DST[3]="\"Language-Team: $(locale_getLanguageName)\\\n\"" - DST[4]="\"PO-Revision-Date: $(date "+%F %H:%M%z")\\\n\"" + DST[4]="\"PO_FILE-Revision-Date: $(date "+%F %H:%M%z")\\\n\"" # Change pattern lines with their replacement lines. while [[ $COUNT -lt ${#SRC[*]} ]];do - sed -i -r "/${SRC[$COUNT]}/c${DST[$COUNT]}" ${PO} + sed -i -r "/${SRC[$COUNT]}/c${DST[$COUNT]}" ${PO_FILE} COUNT=$(($COUNT + 1)) done @@ -69,13 +69,13 @@ function locale_updateMessageMetadata { # does when xgettext is used. So, in order to have such metadata # field in all .pot files, verify its existence and add it if it # doesn't exist. - egrep "^\"${SRC[1]}" ${PO} > /dev/null + egrep "^\"${SRC[1]}" ${PO_FILE} > /dev/null if [[ $? -ne 0 ]];then - sed -i -r "/^\"${SRC[0]}/a${DST[1]}" ${PO} + sed -i -r "/^\"${SRC[0]}/a${DST[1]}" ${PO_FILE} fi # Replace package information using gettext domain information. - sed -i -r "s/PACKAGE/${TCAR_SCRIPT_NAME} ${TCAR_SCRIPT_VERSION}/g" ${PO} + sed -i -r "s/PACKAGE/${TCAR_SCRIPT_NAME} ${TCAR_SCRIPT_VERSION}/g" ${PO_FILE} # Remove absolute path to the working copy so it doesn't appear on # comments related to locations. Remember that people can download @@ -83,7 +83,7 @@ function locale_updateMessageMetadata { # version those changes each time a translation message be # updated. To be consistent about this, show path information from # first level on. Don't show the variable part of the path. - sed -i -r "s,${TCAR_BASEDIR}/,,g" ${PO} + sed -i -r "s,${TCAR_BASEDIR}/,,g" ${PO_FILE} # Unset array variables to avoid undesired concatenations. unset SRC diff --git a/Automation/Modules/Locale/locale_updateMessagePObjects.sh b/Automation/Modules/Locale/locale_updateMessagePObjects.sh index b93f51c..0261b9f 100755 --- a/Automation/Modules/Locale/locale_updateMessagePObjects.sh +++ b/Automation/Modules/Locale/locale_updateMessagePObjects.sh @@ -30,37 +30,43 @@ function locale_updateMessagePObjects { - local POT="$1" + local POT_FILE="${1}" # Verify the portable object template. The portable object # template is used to create the portable object. We cannot # continue without it. - tcar_checkFiles "${POT}" -f + tcar_checkFiles ${POT_FILE} -f - PO=$(dirname ${TRANSLATIONS[0]})/messages.po + # Define PO's location using first translation file as reference. + local PO_FILE=${TRANSLATIONS[0]} + + # Create the PO's parent directory if it doesn't exist. + if [[ ! -d $(dirname ${PO_FILE}) ]];then + mkdir -p $(dirname ${PO_FILE}) + fi # Print action message. - tcar_printMessage "${PO}" --as-creating-line + tcar_printMessage "${PO_FILE}" --as-creating-line # Verify existence of portable object. The portable object is the # file translators edit in order to make translation works. - if [[ -f ${PO} ]];then + if [[ -f ${PO_FILE} ]];then # Update portable object merging both portable object and # portable object template. - msgmerge --output="${PO}" "${PO}" "${POT}" --quiet + msgmerge --output-file="${PO_FILE}" "${PO_FILE}" "${POT_FILE}" --quiet else # Initiate portable object using portable object template. # Do not print msginit sterr output, use centos-art action # message instead. - msginit -i ${POT} -o ${PO} --width=70 \ + msginit -i ${POT_FILE} -o ${PO_FILE} --width=70 \ --no-translator > /dev/null 2>&1 fi # Sanitate metadata inside the PO file. - locale_updateMessageMetadata "${PO}" + locale_updateMessageMetadata "${PO_FILE}" }