From 9bddc797b46855a64e0a4e943dd3480f84b8b5a4 Mon Sep 17 00:00:00 2001 From: magikcypress Date: Sat, 15 Apr 2017 04:20:28 +0200 Subject: [PATCH] [add] language --- manifest.json | 17 +++++++++++++---- scripts/install | 5 +++++ 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/manifest.json b/manifest.json index 9409e47..84bb6fd 100644 --- a/manifest.json +++ b/manifest.json @@ -9,12 +9,12 @@ "en": "Mastodon is a free, open-source social network.", "fr": "Mastodon est un réseau social gratuit et open source." }, - "version": "0.6 dev", + "version": "1.1.1", "url": "https://github.com/tootsuite/mastodon", - "license": "AGPL", + "license": "AGPL v3.0", "maintainer": { - "name": "cyp", - "email": "cyp@rouquin.me" + "name": "cyp, nemsia", + "email": "cyp@rouquin.me, nemsia@nemsia.org" }, "multi_instance": false, "services": [ @@ -59,6 +59,15 @@ }, "example": "adminpassword" }, + { + "name": "language", + "ask": { + "en": "Choose the application language", + "fr": "Choisissez la langue de l'application" + }, + "choices": ["en_EN", "fr_FR"], + "default": "fr_FR" + }, { "name": "is_public", "ask": { diff --git a/scripts/install b/scripts/install index 75c2cfd..2e68844 100644 --- a/scripts/install +++ b/scripts/install @@ -17,6 +17,7 @@ domain=$YNH_APP_ARG_DOMAIN path=$YNH_APP_ARG_PATH admin_mastodon=$YNH_APP_ARG_ADMIN admin_pass=$YNH_APP_ARG_PASSWD +language=$YNH_APP_ARG_LANGUAGE is_public=$YNH_APP_ARG_IS_PUBLIC app=$YNH_APP_INSTANCE_NAME @@ -35,6 +36,7 @@ ynh_app_setting_set $app domain $domain ynh_app_setting_set $app path $path ynh_app_setting_set $app admin $admin_mastodon ynh_app_setting_set $app pass $admin_pass +ynh_app_setting_set $app language $language ynh_app_setting_set $app is_public $is_public # Create user unix @@ -136,6 +138,9 @@ sudo sed -i "s@DB_USER=postgres@DB_USER=${app}@g" "${final_path}/live/.env.produ sudo sed -i "s@DB_NAME=postgres@DB_NAME=${app}_production@g" "${final_path}/live/.env.production" sudo sed -i "s@LOCAL_DOMAIN=example.com@LOCAL_DOMAIN=${domain}@g" "${final_path}/live/.env.production" +language="$(echo $language | head -c 2)" +sudo sed -i "s@# DEFAULT_LOCALE=de@DEFAULT_LOCALE=${language}@g" "${final_path}/live/.env.production" + sudo sed -i "s@PAPERCLIP_SECRET=@PAPERCLIP_SECRET=$(head -n128 /dev/urandom | tr -dc -d 'a-z0-9' | head -c128)@g" "${final_path}/live/.env.production" sudo sed -i "s@SECRET_KEY_BASE=@SECRET_KEY_BASE=$(head -n128 /dev/urandom | tr -dc -d 'a-z0-9' | head -c128)@g" "${final_path}/live/.env.production" sudo sed -i "s@OTP_SECRET=@OTP_SECRET=$(head -n128 /dev/urandom | tr -dc -d 'a-z0-9' | head -c128)@g" "${final_path}/live/.env.production"