diff --git a/check_process b/check_process index bb5cd2d..12eb76e 100644 --- a/check_process +++ b/check_process @@ -6,7 +6,7 @@ is_public=1 (PUBLIC|public=1|private=0) password="password" ldap=1 - lang="English" + language="fr" ; Checks pkg_linter=1 setup_sub_dir=1 diff --git a/manifest.json b/manifest.json index 8db2e0a..095d86a 100644 --- a/manifest.json +++ b/manifest.json @@ -52,14 +52,14 @@ "default": false }, { - "name": "lang", + "name": "language", "type": "string", "ask": { "en": "Choose the application language", "fr": "Choisissez la langue de l'application" }, - "choices": ["English", "Francais"], - "default": "English" + "choices": ["fr", "en"], + "default": "fr" }, { "name": "password", diff --git a/scripts/install b/scripts/install index a641701..9e8a51f 100644 --- a/scripts/install +++ b/scripts/install @@ -25,7 +25,7 @@ path_url=$YNH_APP_ARG_PATH is_public=$YNH_APP_ARG_IS_PUBLIC password=$YNH_APP_ARG_PASSWORD ldap=$YNH_APP_ARG_LDAP -lang=$YNH_APP_ARG_LANG +language=$YNH_APP_ARG_LANGUAGE app=$YNH_APP_INSTANCE_NAME @@ -100,18 +100,7 @@ ynh_add_fpm_config # AUTOCONFIG #================================================= -# Set lang => define from install manifest -case "$lang" in - Francais) - lang="fr" - ;; - English) - lang="en" - ;; - *) - lang="en" -esac -ynh_app_setting_set "$app" lang "$lang" +ynh_app_setting_set "$app" language "$language" # Set plugins plugins="ynh-login-mapping,auto-domain-grab" # This plugin is trying to automatically grab unknown domains if users want to add external email accounts @@ -129,7 +118,7 @@ sudo cp ../conf/data/configs/application.ini "$application_file" ynh_replace_string "domain.tld" "$domain" "$application_file" ynh_replace_string "MYSQLUSER" "$db_name" "$application_file" ynh_replace_string "MYSQLPASSWORD" "$db_pwd" "$application_file" -ynh_replace_string "LANGTOCHANGE" "$lang" "$application_file" +ynh_replace_string "LANGTOCHANGE" "$language" "$application_file" ynh_replace_string "PLUGINSTOENABLE" "$plugins" "$application_file" diff --git a/scripts/upgrade b/scripts/upgrade index f698571..80fdbe2 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -21,6 +21,15 @@ is_public=$(ynh_app_setting_get $app is_public) final_path=$(ynh_app_setting_get $app final_path) db_name=$(ynh_app_setting_get $app db_name) +lang=$(ynh_app_setting_get $app lang) + +if [ -n "$lang" ] +then + language="$lang" + ynh_app_setting_set "$app" language "$language" + ynh_app_setting_delete "$app" lang +fi + #================================================= # ENSURE DOWNWARD COMPATIBILITY #=================================================