From 5807cf1dcd5b5157b28fa2e4359abebb2e4037d1 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 19 Jul 2021 09:57:05 +0200 Subject: [PATCH 1/5] Add language --- conf/local-sample.config.php | 2 +- manifest.json | 10 ++++++++++ scripts/install | 2 ++ scripts/upgrade | 1 + 4 files changed, 14 insertions(+), 1 deletion(-) 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 759e8c4..94805b2 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 diff --git a/scripts/upgrade b/scripts/upgrade index 857fe66..5de0c3c 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -24,6 +24,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 From 52424cd9bb3c19fba49b8ac8420198e5e6c1874d Mon Sep 17 00:00:00 2001 From: Yunohost-Bot <> Date: Mon, 19 Jul 2021 07:57:13 +0000 Subject: [PATCH 2/5] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 626cc62..f32d6f5 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ Social Communication Server **Shipped version:** 2021.07~ynh1 -**Demo:** https://demo.example.com +**Demo:** https://dir.friendica.social/servers ## Screenshots diff --git a/README_fr.md b/README_fr.md index 2c92c94..648ac1a 100644 --- a/README_fr.md +++ b/README_fr.md @@ -15,7 +15,7 @@ Serveur de Communication Social **Version incluse :** 2021.07~ynh1 -**Démo :** https://demo.example.com +**Démo :** https://dir.friendica.social/servers ## Captures d'écran From 6116dd46d8b85cac8cfcdb5a753c48725eb51fed Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 19 Jul 2021 10:13:44 +0200 Subject: [PATCH 3/5] --quiet --- scripts/install | 6 +++--- scripts/upgrade | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/scripts/install b/scripts/install index 94805b2..9679f1b 100644 --- a/scripts/install +++ b/scripts/install @@ -80,7 +80,7 @@ ynh_script_progression --message="Setting up source files..." --weight=5 ynh_app_setting_set --app=$app --key=final_path --value=$final_path # 1 - Clone stable repo -git clone https://github.com/friendica/friendica.git -b stable "$final_path" +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 @@ -90,10 +90,10 @@ popd cp -f "$final_path/.htaccess-dist" "$final_path/.htaccess" # 2 - Clone addons repo -git clone https://github.com/friendica/friendica-addons.git -b stable "$final_path/addon" +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 5de0c3c..695c94d 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -129,25 +129,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 https://github.com/friendica/friendica.git -b stable "$final_path" + 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 https://github.com/friendica/friendica-addons.git -b stable "$final_path/addon" + 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 From 2bb78445f3d76728f73a1fb9b8796940cdea6ccb Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 19 Jul 2021 10:28:51 +0200 Subject: [PATCH 4/5] Update upgrade --- scripts/upgrade | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/upgrade b/scripts/upgrade index 695c94d..815d769 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -82,6 +82,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 From 34537f3bed1f6f57afba10f245eaeb50dfb28819 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 19 Jul 2021 10:38:14 +0200 Subject: [PATCH 5/5] Update check_process --- check_process | 1 + 1 file changed, 1 insertion(+) 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