Now able to generate the .po file as well if necessary
This commit is contained in:
parent
14bb5fd150
commit
8c04f35298
|
@ -63,13 +63,23 @@ _gettext_mo()
|
||||||
package="$1"
|
package="$1"
|
||||||
lang="$2"
|
lang="$2"
|
||||||
|
|
||||||
|
_gettext_po "$package" "$lang" || return 1
|
||||||
|
$DEBUG $MSGFMT -c -v -o "$lang.mo" "$lang.po" || return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#gettext_po
|
||||||
|
_gettext_po()
|
||||||
|
{
|
||||||
|
package="$1"
|
||||||
|
lang="$2"
|
||||||
|
|
||||||
if [ -f "$lang.po" ]; then
|
if [ -f "$lang.po" ]; then
|
||||||
$DEBUG $MSGMERGE -U "$lang.po" "$package.pot" || return 1
|
$DEBUG $MSGMERGE -U "$lang.po" "$package.pot" || return 1
|
||||||
else
|
else
|
||||||
$DEBUG $MSGINIT -l "$lang" -o "$lang.po" -i "$package.pot" \
|
$DEBUG $MSGINIT -l "$lang" -o "$lang.po" -i "$package.pot" \
|
||||||
|| return 1
|
|| return 1
|
||||||
fi
|
fi
|
||||||
$DEBUG $MSGFMT -c -v -o "$lang.mo" "$lang.po" || return 1
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -115,6 +125,7 @@ LOCALEDIR="$PREFIX/share/locale"
|
||||||
while [ $# -gt 0 ]; do
|
while [ $# -gt 0 ]; do
|
||||||
target="$1"
|
target="$1"
|
||||||
lang="${target%%.mo}"
|
lang="${target%%.mo}"
|
||||||
|
lang="${lang%%.po}"
|
||||||
shift
|
shift
|
||||||
|
|
||||||
#uninstall
|
#uninstall
|
||||||
|
@ -129,6 +140,9 @@ while [ $# -gt 0 ]; do
|
||||||
*.mo)
|
*.mo)
|
||||||
_gettext_mo "$PACKAGE" "$lang" || exit 2
|
_gettext_mo "$PACKAGE" "$lang" || exit 2
|
||||||
;;
|
;;
|
||||||
|
*.po)
|
||||||
|
_gettext_po "$PACKAGE" "$lang" || exit 2
|
||||||
|
;;
|
||||||
*.pot)
|
*.pot)
|
||||||
_gettext_pot "${target%%.pot}" || exit 2
|
_gettext_pot "${target%%.pot}" || exit 2
|
||||||
;;
|
;;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user