| #!/bin/bash |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| function locale_updateMessageMetadata { |
| |
| local COUNT=0 |
| local -a SRC |
| local -a DST |
| |
| |
| local FILE="$1" |
| |
| |
| local CURRENTLOCALE=$(cli_getCurrentLocale) |
| |
| |
| local LANGNAME=$(cli_getLangName ${CURRENTLOCALE}) |
| |
| |
| cli_checkFiles "${FILE}" |
| |
| |
| |
| SRC[0]='Project-Id-Version:' |
| SRC[1]='Report-Msgid-Bugs-To:' |
| SRC[2]='Last-Translator:' |
| SRC[3]='Language-Team:' |
| |
| |
| DST[0]="\"Project-Id-Version: ${CLI_PROGRAM} (${CURRENTLOCALE})\\\n\"" |
| DST[1]="\"Report-Msgid-Bugs-To: CentOS Documentation SIG <=MAIL_DOCS=>\\\n\"" |
| DST[2]="\"Last-Translator: CentOS Documentation SIG <=MAIL_DOCS=>\\\n\"" |
| DST[3]="\"Language-Team: ${LANGNAME}\\\n\"" |
| |
| |
| while [[ $COUNT -lt ${#SRC[*]} ]];do |
| sed -i -r "/${SRC[$COUNT]}/c${DST[$COUNT]}" ${FILE} |
| COUNT=$(($COUNT + 1)) |
| done |
| |
| |
| |
| |
| |
| |
| egrep "^\"${SRC[1]}" $FILE > /dev/null |
| if [[ $? -ne 0 ]];then |
| sed -i -r "/^\"${SRC[0]}/a${DST[1]}" $FILE |
| fi |
| |
| |
| sed -i -r "s/PACKAGE/${TEXTDOMAIN}/g" ${FILE} |
| |
| |
| cli_replaceTMarkers ${FILE} |
| |
| |
| unset SRC |
| unset DST |
| |
| } |