| #!/bin/bash |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| function locale_editMessages { |
| |
| |
| |
| |
| if [[ ${CLI_LANG_LC} =~ '^en' ]];then |
| cli_printMessage "`gettext "The English language cannot be localized to itself."`" --as-error-line |
| fi |
| |
| |
| |
| locale_isLocalizable "${ACTIONVAL}" |
| if [[ $? -ne 0 ]];then |
| cli_printMessage "`gettext "The path provided does not support localization."`" --as-error-line |
| fi |
| |
| local PO_FILE='' |
| local PO_FILES='' |
| |
| |
| locale_prepareWorkingDirectory ${L10N_WORKDIR} |
| |
| |
| |
| |
| cli_synchronizeRepoChanges "${L10N_WORKDIR}" |
| |
| |
| |
| if [[ $ACTIONVAL =~ "^${TCAR_WORKDIR}/trunk/(Documentation/Models/Docbook|Identity/Models)/.*$" ]];then |
| |
| |
| PO_FILES=$(cli_getFilesList ${L10N_WORKDIR} --type="f" --pattern="messages\.po$") |
| |
| |
| FLAG_DONT_CREATE_MO='true' |
| |
| elif [[ $ACTIONVAL =~ "^${TCAR_WORKDIR}/trunk/Scripts/Bash$" ]];then |
| |
| |
| PO_FILES=$(cli_getFilesList ${L10N_WORKDIR} --pattern="${FLAG_FILTER}/messages\.po$") |
| |
| else |
| cli_printMessage "`gettext "The path provided does not support localization."`" --as-error-line |
| fi |
| |
| |
| if [[ $PO_FILES = "" ]];then |
| cli_printMessage "`gettext "The path provided hasn't translations yet."`" --as-error-line |
| else |
| cli_printMessage '-' --as-separator-line |
| fi |
| |
| # Loop through list of PO files to process in order to edit them |
| # one by one using user's default text editor. |
| for PO_FILE in ${PO_FILES};do |
| |
| |
| cli_printMessage "${PO_FILE}" --as-updating-line |
| |
| |
| eval ${EDITOR} ${PO_FILE} |
| |
| done |
| |
| |
| |
| |
| |
| |
| |
| locale_updateMessageBinary |
| |
| |
| |
| |
| cli_synchronizeRepoChanges "${L10N_WORKDIR}" |
| |
| } |