# Sorry, I have to put it like this...
cat > /dev/null << EOF
=========================
          NOTES
=========================

Creating/updating the POT file
------------------------------

Since the GRUB menu uses a special wrapper to get the localized string, the
following command can be used to update the PO template file:

xgettext -o po/memtest-grub.pot \
	--keyword="gettext_printf" \
	--language=Shell \
	--copyright-holder="AOSC OS Maintainers <maintainers@aosc.io>" \
	--package-name="memtest-grub" \
	--package-version="0.1.0" \
	overrides/etc/grub.d/26_memtest86plus

Updating translation files according to the new PO Template
-----------------------------------------------------------

Once you updated the PO Template, run the following command to update the
translations:

msgmerge -U po/$LOCALE.po po/memtest-grub.pot

Please check if there's any fuzzy translations.

Initializing a new translation
------------------------------

To initialize a PO file for a new language, run:

msginit -i po/memtest-grub.pot -l $LANG -o po/$LANG.po

While you should know that, don't put encoding part into the file name.
And then edit it using your favorite editor. Don't forget to git add and
commit your translation file!
EOF

TEXTDOMAIN=memtest-grub

abinfo "Building translations ..."

files=("$SRCDIR"/autobuild/po/*.po)
if [ "${#files[@]}" -lt 1 ] ; then
	abdie "Translation files not found in autobuild/po."
fi
for po in "${files[@]}" ; do
	locale="$(basename $po)"
	locale="${locale%%.po}"
	install -dv "$PKGDIR"/usr/share/locale/"$locale"/LC_MESSAGES
	echo -n "$locale: "
	msgfmt -v -o "$PKGDIR"/usr/share/locale/"$locale"/LC_MESSAGES/"$TEXTDOMAIN".mo "$po"
done
