diff --git a/StaticMessages.sh b/StaticMessages.sh new file mode 100755 index 000000000..7e6e34050 --- /dev/null +++ b/StaticMessages.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash + +FILENAME="krita-docs" + +function export_pot_file # First parameter will be the path of the directory with the pot files, includes $FILENAME +{ + echo "Creating POT files" + potfile=$1 + make gettext + # Remove the pages that should not be translated. + echo "Removing untranslatable pages." + rm -rf _build/gettext/contributors_manual/untranslatable_pages + echo "Moving the pot files to $potfile" + mv _build/gettext $potfile + echo "Removing gettext folder." + rm -rf _build/gettext +} + +function import_po_files # First parameter will be a path that will be a directory to the +{ + podir=$1 + mkdir locale + # These are the language codes that sphinx supports. + for lang in bn ca cs da de es et eu fa fi fr he hr hu id it ja ko lt lv mk nb_NO ne nl pl pt_BR pt_PT ru si sk sv tr uk_UA vi zh_CN zh_TW + do + echo "Checking for $podir/$lang." + if [ -d "$podir/$lang" ]; then + mkdir locale/$lang/LC_MESSAGES + mv $podir/$lang locale/$lang/LC_MESSAGES + echo "Copied contents to to locale/$lang/LC_MESSAGES." + fi + done +}