Skip to content

Commit a772e00

Browse files
author
Andreas Poulsen
committed
Merge branch 'feature/56040_language_variability_in_adjust_settings_access' into 'master'
Language variability in adjust_settings_access See merge request os2borgerpc/os2borgerpc-scripts!218
2 parents 7a5bda5 + b6df8b6 commit a772e00

File tree

3 files changed

+28
-10
lines changed

3 files changed

+28
-10
lines changed

os2borgerpc/sikkerhed/adjust_settings_access.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,17 @@ else # Remove access to settings
4141
4242
USER=\$(id -un)
4343
44+
# Set the info text based on the chosen language
45+
if echo \$LANG | grep sv; then
46+
INFO="Systeminställningarna är inte tillgängliga för allmänheten.\n\nKontakta personalen om det uppstår problem."
47+
elif echo \$LANG | grep en; then
48+
INFO="The settings are not accessible to the public.\n\nContact the staff if there are issues."
49+
else
50+
INFO="Systemindstillingerne er ikke tilgængelige for publikum.\n\nKontakt personalet, hvis der er problemer."
51+
fi
52+
4453
if [ \$USER == "user" ]; then
45-
zenity --info --text="Systemindstillingerne er ikke tilgængelige for publikum.\n\n Kontakt personalet, hvis der er problemer."
54+
zenity --info --text="\$INFO"
4655
else
4756
/usr/bin/gnome-control-center.real
4857
fi

os2borgerpc/sikkerhed/desktop_toggle_writable.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ if [ "$ACTIVATE" = 'True' ]; then
5353
# Prepend temporarily setting DESKTOP mutable before copying new files in, as otherwise that will fail
5454
# We first determine the name of the user desktop directory as before
5555
sed -i "/USERNAME=\"$USERNAME\"/a \
56-
export \$(grep LANG= \/etc\/default\/locale)\n\
56+
export \$(grep LANG= \/etc\/default\/locale | tr -d \'\"\')\n\
5757
runuser -u $USERNAME xdg-user-dirs-update\n\
5858
DESKTOP=\$(runuser -u $USERNAME xdg-user-dir DESKTOP)\n\
5959
chattr -i \$DESKTOP" $USER_CLEANUP

os2borgerpc/sikkerhed/protect_terminal.sh

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,25 @@ else # Deny access
3939
fi
4040

4141
cat <<- EOF > "$PROGRAM_OLD_PATH"
42-
#!/bin/bash
42+
#!/bin/bash
4343
44-
USER=\$(id -un)
44+
USER=\$(id -un)
4545
46-
if [ \$USER == "user" ]; then
47-
zenity --info --text="Terminalen er ikke tilgængelig for publikum."
48-
else
49-
"$PROGRAM_NEW_PATH"
50-
fi
51-
EOF
46+
# Set the info text based on the chosen language
47+
if echo \$LANG | grep sv; then
48+
INFO="Terminalen är inte tillgänglig för allmänheten."
49+
elif echo \$LANG | grep en; then
50+
INFO="The terminal is not accessible to the public."
51+
else
52+
INFO="Terminalen er ikke tilgængelig for publikum."
53+
fi
54+
55+
if [ \$USER == "user" ]; then
56+
zenity --info --text="\$INFO"
57+
else
58+
"$PROGRAM_NEW_PATH"
59+
fi
60+
EOF
5261

5362
chmod +x "$PROGRAM_OLD_PATH"
5463

0 commit comments

Comments
 (0)