make copying translation optional

This commit is contained in:
zenobit 2023-03-30 01:16:56 +02:00
parent 94f6908076
commit 76f3e44cc4
1 changed files with 7 additions and 2 deletions

9
dh
View File

@ -427,9 +427,14 @@ function translate() {
meld "$DH_CONFIG_DIR"/locale/dh-source.pot "$DH_CONFIG_DIR"/locale/distrohopper-"$lang".pot
echo $"Generating .mo file..."
msgfmt -o "$DH_CONFIG_DIR"/locale/distrohopper-"$lang".mo "$DH_CONFIG_DIR"/locale/distrohopper-"$lang".pot
echo $"Copying translation to '/usr/share/local'..."
sudo cp "$DH_CONFIG_DIR"/locale/distrohopper-"$lang".mo /usr/share/locale/"$lang"/LC_MESSAGES/distrohopper.mo
echo $"Do you want copy $lang translation to '/usr/share/local' as ROOT? (y/n)"
read response
if [[ "$response" =~ ^[Yy]$ ]]; then
echo $"Copying translation to '/usr/share/local'..."
sudo cp "$DH_CONFIG_DIR"/locale/distrohopper-"$lang".mo /usr/share/locale/"$lang"/LC_MESSAGES/distrohopper.mo
fi
}
# run --------------------------------------
set_variables