From cdc6f8e6c0574e7f9cc03602be8367f6ea47d9ef Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Sat, 6 Jan 2024 19:17:03 +0100 Subject: [PATCH] The manifest asks for the app language to be used with like 5 or 6 options, then proceed to savagely replace anything that is not fr or en with en... --- manifest.toml | 4 ++-- scripts/install | 13 ++----------- scripts/upgrade | 25 +++++++++---------------- 3 files changed, 13 insertions(+), 29 deletions(-) diff --git a/manifest.toml b/manifest.toml index 782ae02..c17eb2a 100644 --- a/manifest.toml +++ b/manifest.toml @@ -45,8 +45,8 @@ ram.runtime = "50M" ask.en = "Choose the application language" ask.fr = "Choisissez la langue de l'application" type = "select" - choices = ["de", "en", "es", "fr", "it", "pt"] - default = "en" + choices = ["fr_FR", "en_UK"] + default = "en_UK" [install.admin] type = "user" diff --git a/scripts/install b/scripts/install index 06bc042..6393436 100644 --- a/scripts/install +++ b/scripts/install @@ -68,18 +68,9 @@ chown -R $app:www-data "$data_dir" #================================================= ynh_script_progression --message="Setuping application with CURL..." --weight=5 -# Generate random password for admin -if [ "$language" = "fr" ]; then - applanguage="fr_FR" -else - applanguage="en_UK" -fi - -# Configure Piwigo via cURL -mail="$(ynh_user_get_info --username=$admin --key=mail)" - # Installation with cURL -ynh_local_curl "/install.php?language=$applanguage" "install=true" "dbhost=127.0.0.1" "dbuser=$db_user" "dbpasswd=$db_pwd" "dbname=$db_name" "prefix=" "admin_name=$admin" "admin_pass1=$password" "admin_pass2=$password" "admin_mail=$mail" +mail="$(ynh_user_get_info --username=$admin --key=mail)" +ynh_local_curl "/install.php?language=$language" "install=true" "dbhost=127.0.0.1" "dbuser=$db_user" "dbpasswd=$db_pwd" "dbname=$db_name" "prefix=" "admin_name=$admin" "admin_pass1=$password" "admin_pass2=$password" "admin_mail=$mail" #================================================= # CONFIGURE PIWIGO diff --git a/scripts/upgrade b/scripts/upgrade index 5c235a2..6387fcd 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -1,14 +1,16 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - source _common.sh source /usr/share/yunohost/helpers +# Boring backward compatibility +if [ "${language:-}" == "fr" ] ; then + language="fr_FR" +else + language="en_UK" +fi + + #================================================= # CHECK VERSION #================================================= @@ -81,18 +83,9 @@ ynh_add_nginx_config #================================================= ynh_script_progression --message="Upgrading Piwigo with cURL..." --weight=6 -# Reload NGINX -ynh_systemd_action --service_name=nginx --action=reload - -if [ "$language" = "fr" ] ; then - applanguage="fr_FR" -else - applanguage="en_UK" -fi - # Upgrade Piwigo via cURL # FIXME : Why Curl ... Why can't we trigger the migration from the command line somehow ... -#ynh_local_curl "/upgrade.php?language=$applanguage&now=true" "language=$applanguage" "username=$admin" "password=$admin_pwd" +#ynh_local_curl "/upgrade.php?language=$language&now=true" "language=$language" "username=$admin" "password=$admin_pwd" #================================================= # CONFIGURE PIWIGO