1
0
mirror of https://github.com/KDE/latte-dock.git synced 2025-02-06 09:57:43 +03:00
latte-dock/po/update-metadata.sh
2017-02-18 21:04:12 +02:00

35 lines
1.1 KiB
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/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
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 "metadata.desktop 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"