Commit 690924bf authored by Mikhail Tergoev's avatar Mikhail Tergoev

Merge branch 'update-gettext' of github.com:Htylol/PortWINE into Htylol-update-gettext

parents f0379dfd 8679600e
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -99,11 +99,14 @@ generate_pot () { ...@@ -99,11 +99,14 @@ generate_pot () {
LANG_PO="${PORT_WINE_PATH}/data/locales/${lang}/LC_MESSAGES/PortProton.po" LANG_PO="${PORT_WINE_PATH}/data/locales/${lang}/LC_MESSAGES/PortProton.po"
LANG_MO="${PORT_WINE_PATH}/data/locales/${lang}/LC_MESSAGES/PortProton.mo" LANG_MO="${PORT_WINE_PATH}/data/locales/${lang}/LC_MESSAGES/PortProton.mo"
TEMPLATE_POT="${PORT_WINE_PATH}/data/locales/PortProton.pot" TEMPLATE_POT="${PORT_WINE_PATH}/data/locales/PortProton.pot"
pushd "${PORT_WINE_PATH}" 1>/dev/null || fatal
xgettext --from-code=UTF-8 --language Shell -i \ xgettext --from-code=UTF-8 --language Shell -i \
"${PORT_WINE_PATH}/data/scripts/start.sh" \ "data/scripts/start.sh" \
"${PORT_WINE_PATH}/data/scripts/setup.sh" \ "data/scripts/setup.sh" \
"${PORT_WINE_PATH}/data/scripts/functions_helper" \ "data/scripts/functions_helper" \
"data/scripts/credits" \
-o "$TEMPLATE_POT" -o "$TEMPLATE_POT"
popd 1>/dev/null || fatal
if [[ -f "$LANG_PO" ]] ; then if [[ -f "$LANG_PO" ]] ; then
echo "update $LANG_PO file" echo "update $LANG_PO file"
msgmerge --update "$LANG_PO" "$TEMPLATE_POT" msgmerge --update "$LANG_PO" "$TEMPLATE_POT"
...@@ -116,6 +119,10 @@ generate_pot () { ...@@ -116,6 +119,10 @@ generate_pot () {
} }
export -f generate_pot export -f generate_pot
eval_gettext () {
gettext "$1" | (export PATH `envsubst --variables "$1"`; envsubst "$1")
}
try_copy_file () { try_copy_file () {
if [[ ! -f "$1" ]] ; then print_info "file $1 not found for copy" && return 1 if [[ ! -f "$1" ]] ; then print_info "file $1 not found for copy" && return 1
elif [[ -z "$2" ]] ; then print_error "no way to copy file $1" && return 1 elif [[ -z "$2" ]] ; then print_error "no way to copy file $1" && return 1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment