diff --git a/check_process b/check_process index 71fbf26..7f2551c 100644 --- a/check_process +++ b/check_process @@ -2,6 +2,7 @@ ; Manifest domain="domain.tld" admin="john" + language="en" ; Checks pkg_linter=1 setup_sub_dir=0 diff --git a/conf/local-sample.config.php b/conf/local-sample.config.php index ad05da0..882204e 100644 --- a/conf/local-sample.config.php +++ b/conf/local-sample.config.php @@ -39,6 +39,6 @@ return [ ], 'system' => [ 'default_timezone' => 'UTC', - 'language' => 'en', + 'language' => '__LANGUAGE__', ], ]; diff --git a/manifest.json b/manifest.json index dd57e28..d402f65 100644 --- a/manifest.json +++ b/manifest.json @@ -45,6 +45,16 @@ "name": "admin", "type": "user", "example": "johndoe" + }, + { + "name": "language", + "type": "string", + "ask": { + "en": "Choose the application language", + "fr": "Choisissez la langue de l'application" + }, + "choices": ["de", "en", "es", "fr", "it", "pt"], + "default": "en" } ] } diff --git a/scripts/install b/scripts/install index c87aff1..9c3c9db 100644 --- a/scripts/install +++ b/scripts/install @@ -28,6 +28,7 @@ domain=$YNH_APP_ARG_DOMAIN path_url='/' admin=$YNH_APP_ARG_ADMIN email=$(ynh_user_get_info --username=$admin --key=mail) +language=$YNH_APP_ARG_LANGUAGE app=$YNH_APP_INSTANCE_NAME @@ -51,6 +52,7 @@ ynh_app_setting_set --app=$app --key=domain --value=$domain ynh_app_setting_set --app=$app --key=path --value=$path_url ynh_app_setting_set --app=$app --key=admin --value=$admin ynh_app_setting_set --app=$app --key=email --value=$email +ynh_app_setting_set --app=$app --key=language --value=$language #================================================= # CREATE DEDICATED USER @@ -91,7 +93,7 @@ cp -f "$final_path/.htaccess-dist" "$final_path/.htaccess" git clone --quiet https://github.com/friendica/friendica-addons.git -b stable "$final_path/addon" # Reset addons branch to the level of update we needed pushd "$final_path/addon" - git reset --hard $addons_version_commit + git reset --hard --quiet $addons_version_commit popd chmod 750 "$final_path" diff --git a/scripts/upgrade b/scripts/upgrade index 668a7c8..0e3113d 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -25,6 +25,7 @@ db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) email=$(ynh_app_setting_get --app=$app --key=email) admin=$(ynh_app_setting_get --app=$app --key=admin) phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) +language=$(ynh_app_setting_get --app=$app --key=language) #================================================= # CHECK VERSION @@ -82,6 +83,12 @@ if [ -z $email ]; then ynh_app_setting_set --app=$app --key=email --value=$email fi +# If language setting doesn't exist, create it +if [ -z $language ]; then + language=en + ynh_app_setting_set --app=$app --key=language --value=$language +fi + # Cleaning legacy permissions if ynh_legacy_permissions_exists; then ynh_legacy_permissions_delete_all @@ -128,25 +135,25 @@ else cp -a "$final_path/view/smarty3" "$tmpdir/smarty3" # Remove the app directory securely - ynh_secure_remove "$final_path" + ynh_secure_remove --file="$final_path" # 1 - Clone stable repo git clone --quiet https://github.com/friendica/friendica.git -b stable "$final_path" # Reset branch to the level of update we needed pushd "$final_path" - git reset --hard $version_commit + git reset --hard --quiet $version_commit popd # 2 - Clone addons repo git clone --quiet https://github.com/friendica/friendica-addons.git -b stable "$final_path/addon" # Reset addons branch to the level of update we needed pushd "$final_path/addon" - git reset --hard $addons_version_commit + git reset --hard --quiet $addons_version_commit popd # Restore the smarty3 folder cp -a "$tmpdir/smarty3" "$final_path/view/smarty3" - ynh_secure_remove "$tmpdir" + ynh_secure_remove --file="$tmpdir" fi fi