Skip to content
Snippets Groups Projects
Commit 878d46be authored by Bob Mottram's avatar Bob Mottram
Browse files

Get the language subdirectory for web admin

parent e5521d6f
No related branches found
No related tags found
No related merge requests found
...@@ -415,11 +415,25 @@ function web_admin_create_installed_apps { ...@@ -415,11 +415,25 @@ function web_admin_create_installed_apps {
chown -R www-data:www-data "/var/www/${local_hostname}/htdocs/admin" chown -R www-data:www-data "/var/www/${local_hostname}/htdocs/admin"
} }
function web_admin_get_language_subdir {
# Gets the subdirectory for the current language
# This is an upper case version of the first two characters of
# the config variable DEFAULT_LANGUAGE
read_config_param DEFAULT_LANGUAGE
if [ ! "$DEFAULT_LANGUAGE" ]; then
echo 'EN'
return
fi
lang_lower="${DEFAULT_LANGUAGE:0:2}"
echo "$lang_lower" | awk '{print toupper($0)}'
}
function install_web_admin { function install_web_admin {
# This is intended as an admin web user interface # This is intended as an admin web user interface
# similar to Plinth or the yunohost # similar to Plinth or the yunohost
language_subdir='EN' language_subdir=$(web_admin_get_language_subdir)
local_hostname=$(grep 'host-name' /etc/avahi/avahi-daemon.conf | awk -F '=' '{print $2}').local local_hostname=$(grep 'host-name' /etc/avahi/avahi-daemon.conf | awk -F '=' '{print $2}').local
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment