Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/vm.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Hansson <github@hanssonit.se>2020-08-10 18:57:42 +0300
committerGitHub <noreply@github.com>2020-08-10 18:57:42 +0300
commit34f58238c565b9b5d3a8c0b257cd328ae263ff03 (patch)
tree91376c701b9f8100f0703354fa912221a3de43b9 /addons/locales.sh
parent456efb8e0b23f7bab71bdc5efd71f4302febc5be (diff)
Make Webmin optional and move some scripts (#1349)
Signed-off-by: enoch85 <github@hanssonit.se>
Diffstat (limited to 'addons/locales.sh')
-rw-r--r--addons/locales.sh35
1 files changed, 35 insertions, 0 deletions
diff --git a/addons/locales.sh b/addons/locales.sh
new file mode 100644
index 00000000..17f0fb10
--- /dev/null
+++ b/addons/locales.sh
@@ -0,0 +1,35 @@
+#!/bin/bash
+
+# T&M Hansson IT AB © - 2020, https://www.hanssonit.se/
+
+# shellcheck disable=2034,2059
+true
+# shellcheck source=lib.sh
+. <(curl -sL https://raw.githubusercontent.com/nextcloud/vm/master/lib.sh)
+
+# Must be root
+root_check
+
+# Set locales
+print_text_in_color "$ICyan" "Setting locales..."
+if [ "$KEYBOARD_LAYOUT" = "us" ]
+then
+ print_text_in_color "$ICyan" "US locales are already set."
+elif [ "$KEYBOARD_LAYOUT" = "se" ]
+then
+ sudo locale-gen "sv_SE.UTF-8" && sudo dpkg-reconfigure --frontend=noninteractive locales
+elif [ "$KEYBOARD_LAYOUT" = "de" ]
+then
+ sudo locale-gen "de_DE.UTF-8" && sudo dpkg-reconfigure --frontend=noninteractive locales
+elif [ "$KEYBOARD_LAYOUT" = "us" ]
+then
+ sudo locale-gen "en_US.UTF-8" && sudo dpkg-reconfigure --frontend=noninteractive locales
+elif [ "$KEYBOARD_LAYOUT" = "fr" ]
+then
+ sudo locale-gen "fr_FR.UTF-8" && sudo dpkg-reconfigure --frontend=noninteractive locales
+elif [ "$KEYBOARD_LAYOUT" = "ch" ]
+then
+ sudo locale-gen "de_CH.UTF-8" && sudo dpkg-reconfigure --frontend=noninteractive locales
+fi
+
+# TODO: "localectl list-x11-keymap-layouts" and pair with "cat /etc/locale.gen | grep UTF-8"