From 4fc5b0edd24b2e5b670d211f3e819451418332d3 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 27 Feb 2022 11:14:34 +0100 Subject: [PATCH] Fix --- conf/config-sample.php | 2 +- conf/fr.src | 5 +++++ manifest.json | 13 +++++++++---- scripts/change_url | 1 + scripts/install | 5 +++++ 5 files changed, 21 insertions(+), 5 deletions(-) create mode 100644 conf/fr.src diff --git a/conf/config-sample.php b/conf/config-sample.php index f11c9ea..d3e7dc8 100644 --- a/conf/config-sample.php +++ b/conf/config-sample.php @@ -43,7 +43,7 @@ define( 'YOURLS_SITE', 'http://__DOMAIN____PATH__' ); ** Change this setting to use a translation file for your language, instead of the default English. ** That translation file (a .mo file) must be installed in the user/language directory. ** See http://yourls.org/translations for more information */ -define( 'YOURLS_LANG', '' ); +define( 'YOURLS_LANG', '__LANGUAGE__' ); /** Allow multiple short URLs for a same long URL ** Set to true to have only one pair of shortURL/longURL (default YOURLS behavior) diff --git a/conf/fr.src b/conf/fr.src new file mode 100644 index 0000000..58eb1b6 --- /dev/null +++ b/conf/fr.src @@ -0,0 +1,5 @@ +SOURCE_URL=https://github.com/ozh/YOURLS-fr_FR/archive/refs/tags/1.8.zip +SOURCE_SUM=ef9c0e71d4559994b9df0cd0a558f6faf11eba185c4793ba0e30f3500dab1b04 +SOURCE_SUM_PRG=sha256sum +SOURCE_FORMAT=zip +SOURCE_IN_SUBDIR=true diff --git a/manifest.json b/manifest.json index d459ef5..fc398ff 100644 --- a/manifest.json +++ b/manifest.json @@ -55,10 +55,15 @@ "type": "password" }, { - "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_FR", "en_EN"], + "default": "fr_FR" + }, ] } } diff --git a/scripts/change_url b/scripts/change_url index 283ffda..cf889dd 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -34,6 +34,7 @@ db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) admin=$(ynh_app_setting_get --app=$app --key=admin) random=$(ynh_app_setting_get --app=$app --key=random) password=$(ynh_app_setting_get --app=$app --key=password) +language=$(ynh_app_setting_get --app=$app --key=language) #================================================= # BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP diff --git a/scripts/install b/scripts/install index d779000..88d24ef 100644 --- a/scripts/install +++ b/scripts/install @@ -29,6 +29,7 @@ admin=$YNH_APP_ARG_ADMIN is_public=$YNH_APP_ARG_IS_PUBLIC password="$YNH_APP_ARG_PASSWORD" random=$(ynh_string_random --length=24) +language=$YNH_APP_ARG_LANGUAGE app=$YNH_APP_INSTANCE_NAME @@ -53,6 +54,8 @@ 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=random --value=$random ynh_app_setting_set --app=$app --key=password --value="$password" +ynh_app_setting_set --app=$app --key=language --value=$language + #================================================= # INSTALL DEPENDENCIES #================================================= @@ -87,6 +90,8 @@ ynh_app_setting_set --app=$app --key=final_path --value=$final_path # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$final_path" +ynh_setup_source --dest_dir="$final_path/user/languages" --source_id="fr" + # copy index file cp ../conf/index.php $final_path/