From 7a5785e5e3a3f722a6a26f1c857bee0dd8c38e62 Mon Sep 17 00:00:00 2001 From: CodeShakingSheep <19874562+CodeShakingSheep@users.noreply.github.com> Date: Fri, 9 Feb 2024 13:35:56 +0100 Subject: [PATCH 01/10] Update manifest.toml Add language select --- manifest.toml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/manifest.toml b/manifest.toml index 1ba8ce6..ccafb8e 100644 --- a/manifest.toml +++ b/manifest.toml @@ -48,6 +48,13 @@ ram.runtime = "512M" type = "group" default = "visitors" + [install.language] + ask.en = "Choose the application language" + ask.fr = "Choisissez la langue de l'application" + type = "select" + choices = ["en-US", "es-ES", "it-IT", "fr-FR"] + default = "en-US" + [install.user_home] ask.en = "Access the users home folder from Nextcloud?" ask.fr = "Accéder au dossier personnel des utilisateurs depuis Nextcloud ?" From 80207df04498699e3ff5282126424206194e7b8b Mon Sep 17 00:00:00 2001 From: CodeShakingSheep <19874562+CodeShakingSheep@users.noreply.github.com> Date: Fri, 9 Feb 2024 13:51:16 +0100 Subject: [PATCH 02/10] Update install Configure language settings via occ --- scripts/install | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/install b/scripts/install index 1aaf177..50c1fcc 100755 --- a/scripts/install +++ b/scripts/install @@ -87,6 +87,12 @@ ynh_script_progression --message="Configuring $app..." --weight=8 # Set the mysql.utf8mb4 config to true in config.php exec_occ config:system:set mysql.utf8mb4 --type boolean --value="true" +# Set default language in config.php +exec_occ config:system:set default_language --value="$language" + +# Set default phone region in config.php +exec_occ config:system:set default_phone_region --value="$language" + # Ensure that UpdateNotification app is disabled exec_occ app:disable updatenotification From 29d2aafa4e1feb5ac87c7b81e322420fb20b04f5 Mon Sep 17 00:00:00 2001 From: CodeShakingSheep <19874562+CodeShakingSheep@users.noreply.github.com> Date: Fri, 9 Feb 2024 14:13:54 +0100 Subject: [PATCH 03/10] Update upgrade Fix no default phone region --- scripts/upgrade | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/upgrade b/scripts/upgrade index 7bce6fe..a5c250a 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -140,6 +140,12 @@ then exec_occ maintenance:repair fi + # Fix warning "Your installation has no default phone region set" + if [ "$(exec_occ config:system:get default_phone_region)" == "" ]; then + config_locale=$(exec_occ config:system:get default_locale) + exec_occ config:system:set default_phone_region --value="$config_locale" + fi + # Upgrade may fail if this app is enabled # Take all apps enabled, and check if mail is one of them # Then temporary disable the mail app From ca5453e633ba16568ce9a38b2a4f7845002cd401 Mon Sep 17 00:00:00 2001 From: CodeShakingSheep <19874562+CodeShakingSheep@users.noreply.github.com> Date: Fri, 9 Feb 2024 14:23:13 +0100 Subject: [PATCH 04/10] Update install Fix language values for config.php --- scripts/install | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 50c1fcc..d3063da 100755 --- a/scripts/install +++ b/scripts/install @@ -88,10 +88,15 @@ ynh_script_progression --message="Configuring $app..." --weight=8 exec_occ config:system:set mysql.utf8mb4 --type boolean --value="true" # Set default language in config.php -exec_occ config:system:set default_language --value="$language" +raw_language=$(echo "$language" | awk -F'_' '{print $1}') +exec_occ config:system:set default_language --value="$raw_language" + +# Set default locale in config.php +exec_occ config:system:set default_locale --value="$language" # Set default phone region in config.php -exec_occ config:system:set default_phone_region --value="$language" +country=$(echo "$language" | awk -F'_' '{print $2}') +exec_occ config:system:set default_phone_region --value="$country" # Ensure that UpdateNotification app is disabled exec_occ app:disable updatenotification From a193e33055040a4ca944f3ad4ae07ffbb6f19b65 Mon Sep 17 00:00:00 2001 From: CodeShakingSheep <19874562+CodeShakingSheep@users.noreply.github.com> Date: Fri, 9 Feb 2024 14:25:09 +0100 Subject: [PATCH 05/10] Update manifest.toml Fix language code format, add German --- manifest.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifest.toml b/manifest.toml index ccafb8e..6be1dc1 100644 --- a/manifest.toml +++ b/manifest.toml @@ -52,8 +52,8 @@ ram.runtime = "512M" ask.en = "Choose the application language" ask.fr = "Choisissez la langue de l'application" type = "select" - choices = ["en-US", "es-ES", "it-IT", "fr-FR"] - default = "en-US" + choices = ["en_US", "es_ES", "it_IT", "fr_FR", "de_DE"] + default = "en_US" [install.user_home] ask.en = "Access the users home folder from Nextcloud?" From 800fe77b64b224ee32b33685b1a7f82c0bf8246a Mon Sep 17 00:00:00 2001 From: CodeShakingSheep <19874562+CodeShakingSheep@users.noreply.github.com> Date: Fri, 9 Feb 2024 14:35:46 +0100 Subject: [PATCH 06/10] Update upgrade Fix setting default phone region --- scripts/upgrade | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index a5c250a..c90efd9 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -143,7 +143,8 @@ then # Fix warning "Your installation has no default phone region set" if [ "$(exec_occ config:system:get default_phone_region)" == "" ]; then config_locale=$(exec_occ config:system:get default_locale) - exec_occ config:system:set default_phone_region --value="$config_locale" + country=$(echo "$config_locale" | awk -F'_' '{print $2}') + exec_occ config:system:set default_phone_region --value="$country" fi # Upgrade may fail if this app is enabled From c1aaaf398ded665c37e48c136e5193ffa0ee0163 Mon Sep 17 00:00:00 2001 From: CodeShakingSheep <19874562+CodeShakingSheep@users.noreply.github.com> Date: Tue, 13 Feb 2024 12:12:26 +0100 Subject: [PATCH 07/10] Update upgrade Fix upgrading with from installation with no default locale --- scripts/upgrade | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/upgrade b/scripts/upgrade index c90efd9..02c24ba 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -143,6 +143,10 @@ then # Fix warning "Your installation has no default phone region set" if [ "$(exec_occ config:system:get default_phone_region)" == "" ]; then config_locale=$(exec_occ config:system:get default_locale) + if [ "$config_locale" == "" ]; then + # If it's not set in config use "US" as default + config_locale="US" + fi country=$(echo "$config_locale" | awk -F'_' '{print $2}') exec_occ config:system:set default_phone_region --value="$country" fi From da635164f72ae4bfc6d1dca4e58fbeaeb6359d41 Mon Sep 17 00:00:00 2001 From: CodeShakingSheep <19874562+CodeShakingSheep@users.noreply.github.com> Date: Tue, 13 Feb 2024 12:16:39 +0100 Subject: [PATCH 08/10] Update upgrade Fix upgrading from installation with no default locale --- scripts/upgrade | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 02c24ba..e6441fe 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -145,9 +145,10 @@ then config_locale=$(exec_occ config:system:get default_locale) if [ "$config_locale" == "" ]; then # If it's not set in config use "US" as default - config_locale="US" + country="US" + else + country=$(echo "$config_locale" | awk -F'_' '{print $2}') fi - country=$(echo "$config_locale" | awk -F'_' '{print $2}') exec_occ config:system:set default_phone_region --value="$country" fi From 131e1e3772c404f2a7145074aaa75f1a5ed56ba9 Mon Sep 17 00:00:00 2001 From: CodeShakingSheep <19874562+CodeShakingSheep@users.noreply.github.com> Date: Mon, 19 Feb 2024 12:10:39 +0100 Subject: [PATCH 09/10] Update upgrade Fix for checking if config_locale is set --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index e6441fe..59e530d 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -143,7 +143,7 @@ then # Fix warning "Your installation has no default phone region set" if [ "$(exec_occ config:system:get default_phone_region)" == "" ]; then config_locale=$(exec_occ config:system:get default_locale) - if [ "$config_locale" == "" ]; then + if [ -z "$config_locale" ]; then # If it's not set in config use "US" as default country="US" else From f72c772d633ae7059d05f2920346129e0506866f Mon Sep 17 00:00:00 2001 From: CodeShakingSheep <19874562+CodeShakingSheep@users.noreply.github.com> Date: Wed, 21 Feb 2024 12:37:39 +0100 Subject: [PATCH 10/10] Update upgrade Remove fix for "no default phone region" (to be handled via config panel) --- scripts/upgrade | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 59e530d..7bce6fe 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -140,18 +140,6 @@ then exec_occ maintenance:repair fi - # Fix warning "Your installation has no default phone region set" - if [ "$(exec_occ config:system:get default_phone_region)" == "" ]; then - config_locale=$(exec_occ config:system:get default_locale) - if [ -z "$config_locale" ]; then - # If it's not set in config use "US" as default - country="US" - else - country=$(echo "$config_locale" | awk -F'_' '{print $2}') - fi - exec_occ config:system:set default_phone_region --value="$country" - fi - # Upgrade may fail if this app is enabled # Take all apps enabled, and check if mail is one of them # Then temporary disable the mail app