You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
latte-dock/po/update-metadata.sh

38 lines
1.3 KiB
Bash

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#!/bin/sh
cd "$(dirname $0)" # root of translatable sources
BASEDIR="$(pwd)"
cd "$BASEDIR/.."
PROJECTCONTAINMENT="$(pwd)/containment/metadata.desktop.cmake" # containment path
PROJECTPLASMOID="$(pwd)/plasmoid/metadata.desktop.cmake" # plasmoid path
PROJECTSHELL="$(pwd)/shell/metadata.desktop.cmake" # shell path
PROJECTAPP="$(pwd)/app/latte-dock.desktop.cmake" # app path
NOTIFYRC="$(pwd)/app/lattedock.notifyrc" # global notify config
function generate_desktop_file
{
cd "$BASEDIR/$1"
LINGUAS=$(ls | grep ".*.po$" | xargs --no-run-if-empty --max-args=1 basename -s .po)
echo $LINGUAS > LINGUAS
# msgfmt first reads the LINGUAS file under directory,
# and then processes all .po files listed there
msgfmt --desktop --template="../desktop-templates/$2" -d . -o "$3"
rm "LINGUAS"
echo -e "$(basename $2 .template) file for \e[0;32m$1\e[0m was updated..."
}
generate_desktop_file containment containment.metadata.desktop.template "$PROJECTCONTAINMENT"
generate_desktop_file plasmoid plasmoid.metadata.desktop.template "$PROJECTPLASMOID"
generate_desktop_file shell shell.metadata.desktop.template "$PROJECTSHELL"
generate_desktop_file app latte-dock.desktop.template "$PROJECTAPP"
generate_desktop_file app lattedock.notifyrc.template "$NOTIFYRC"