| #!/bin/bash |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| function locale_doMessages { |
| |
| |
| local POT_FILE=$TEXTDOMAINDIR/$TEXTDOMAIN.pot |
| local PO_FILE=$TEXTDOMAINDIR/$(cli_getCurrentLocale)/$TEXTDOMAIN.po |
| local MO_FILE=$TEXTDOMAINDIR/$(cli_getCurrentLocale)/LC_MESSAGES/$TEXTDOMAIN.mo |
| local LANGNAME=$(cli_getLangName $(cli_getCurrentLocale)) |
| local PO_HEAD_DATE='' |
| local PO_HEAD_BUGS='' |
| |
| |
| cli_printMessage "`gettext "The following translation files will be updated:"`" |
| cli_printMessage "$POT_FILE" "AsResponseLine" |
| cli_printMessage "$PO_FILE" "AsResponseLine" |
| cli_printMessage "$MO_FILE" "AsResponseLine" |
| cli_printMessage "`gettext "Do you want to continue?"`" "AsYesOrNoRequestLine" |
| |
| |
| |
| if [[ ! -d $(dirname $MO_FILE) ]];then |
| mkdir -p $(dirname $MO_FILE) |
| fi |
| |
| |
| find /home/centos/artwork/trunk/Scripts/Bash -name '*.sh' \ |
| | xargs xgettext --language=Shell --output=$POT_FILE - |
| |
| |
| if [[ ! -f $PO_FILE ]];then |
| msginit --input=$POT_FILE --output=$PO_FILE |
| else |
| msgmerge --update $PO_FILE $POT_FILE |
| fi |
| |
| |
| |
| |
| |
| PO_HEAD_BUGS="\"Report-Msgid-Bugs-To: CentOS Documentation SIG <centos-docs@centos.org>\\\n\"" |
| sed -i -r "/^\"Report-Msgid-Bugs-To:/c$PO_HEAD_BUGS" $PO_FILE |
| |
| |
| |
| eval $EDITOR $PO_FILE |
| |
| |
| PO_HEAD_DATE="\"PO-Revision-Date: $(date "+%Y-%m-%d %H:%M%z")\\\n\"" |
| sed -i -r "/^\"PO-Revision-Date:/c$PO_HEAD_DATE" $PO_FILE |
| |
| |
| msgfmt $PO_FILE --output=$MO_FILE |
| |
| |
| |
| cli_commitRepoChanges "$TEXTDOMAINDIR" |
| |
| } |