From 4452e746977b49946a91621a731ec5bd69ab7428 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 18 Mar 2022 09:37:18 +0100 Subject: [PATCH 1/2] add language --- conf/.env | 2 +- manifest.json | 10 ++++++++++ scripts/install | 2 ++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/conf/.env b/conf/.env index 96261964..4a6a7635 100644 --- a/conf/.env +++ b/conf/.env @@ -16,7 +16,7 @@ PF_MAX_USERS=1000 OAUTH_ENABLED=true APP_TIMEZONE=UTC -APP_LOCALE=en +APP_LOCALE=__LANGUAGE__ ## Pixelfed Tweaks LIMIT_ACCOUNT_SIZE=true diff --git a/manifest.json b/manifest.json index c81ffa95..6430041a 100644 --- a/manifest.json +++ b/manifest.json @@ -46,6 +46,16 @@ "name": "is_public", "type": "boolean", "default": true + }, + { + "name": "language", + "type": "string", + "ask": { + "en": "Choose the application language", + "fr": "Choisissez la langue de l'application" + }, + "choices": ["fr", "en"], + "default": "fr" } ] } diff --git a/scripts/install b/scripts/install index 68e7eb48..4854b8be 100644 --- a/scripts/install +++ b/scripts/install @@ -29,6 +29,7 @@ domain=$YNH_APP_ARG_DOMAIN path_url="/" is_public=$YNH_APP_ARG_IS_PUBLIC app_key="base64:$(ynh_string_random --length=32 | base64)" +language=$YNH_APP_ARG_LANGUAGE app=$YNH_APP_INSTANCE_NAME @@ -51,6 +52,7 @@ ynh_script_progression --message="Storing installation settings..." 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=app_key --value=$app_key +ynh_app_setting_set --app=$app --key=language --value=$language #================================================= # STANDARD MODIFICATIONS From d40911d28d6137e7c643308077d9ec6b11169feb Mon Sep 17 00:00:00 2001 From: lapineige Date: Fri, 18 Mar 2022 10:22:16 +0100 Subject: [PATCH 2/2] Add more languages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added Deutsch, Italian, Arabic, Russian, Portuguese, Chinese (Continental + Taiwan) (I tried 20 of them, here is the list of the ones working on my instance… I don't know why it fails for the other) --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 6430041a..d73214aa 100644 --- a/manifest.json +++ b/manifest.json @@ -54,7 +54,7 @@ "en": "Choose the application language", "fr": "Choisissez la langue de l'application" }, - "choices": ["fr", "en"], + "choices": ["fr","en","de","it","ar","ru","pt","zh-cn","zh-tw"], "default": "fr" } ]