diff --git a/conf/config.inc.php b/conf/config.inc.php index ce67075..4e016d3 100644 --- a/conf/config.inc.php +++ b/conf/config.inc.php @@ -99,6 +99,18 @@ $config['des_key'] = '__DESKEY__'; // skin name: folder from skins/ $config['skin'] = 'elastic'; +// ---------------------------------- +// USER INTERFACE +// ---------------------------------- + +// the default locale setting (leave empty for auto-detection) +// RFC1766 formatted language name like en_US, de_DE, de_CH, fr_FR, pt_BR +$config['language'] = __LANGUAGE__; + +// use this format for date display (date or strftime format) +$config['date_format'] = 'd-m-Y'; + + // Enable YunoHost users search in the address book. $config['ldap_public']['yunohost'] = array( 'name' => 'YunoHost Users', diff --git a/manifest.json b/manifest.json index 5e2bbf3..8f9df9f 100644 --- a/manifest.json +++ b/manifest.json @@ -43,6 +43,16 @@ "example": "/webmail", "default": "/webmail" }, + { + "name": "language", + "type": "string", + "ask": { + "en": "Choose the application language", + "fr": "Choisissez la langue de l'application" + }, + "choices": ["fr_FR", "en-GB"], + "default": "fr_FR" + }, { "name": "with_carddav", "type": "boolean", diff --git a/scripts/_common.sh b/scripts/_common.sh index d78a2c0..93a1c93 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -7,7 +7,7 @@ YNH_PHP_VERSION="7.3" # Package dependencies -extra_php_dependencies="php${YNH_PHP_VERSION}-cli php${YNH_PHP_VERSION}-intl php${YNH_PHP_VERSION}-json php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-dom php${YNH_PHP_VERSION}-curl" +extra_php_dependencies="php-pear php${YNH_PHP_VERSION}-ldap php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-cli php${YNH_PHP_VERSION}-intl php${YNH_PHP_VERSION}-json php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-dom php${YNH_PHP_VERSION}-curl" # Plugins version contextmenu_version=2.3 diff --git a/scripts/install b/scripts/install index b4b376e..c96f525 100644 --- a/scripts/install +++ b/scripts/install @@ -24,6 +24,7 @@ domain=$YNH_APP_ARG_DOMAIN path_url=$YNH_APP_ARG_PATH with_carddav=$YNH_APP_ARG_WITH_CARDDAV with_enigma=$YNH_APP_ARG_WITH_ENIGMA +language=$YNH_APP_ARG_LANGUAGE app=$YNH_APP_INSTANCE_NAME @@ -47,6 +48,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=with_carddav --value=$with_carddav ynh_app_setting_set --app=$app --key=with_enigma --value=$with_enigma +ynh_app_setting_set --app=$app --key=language --value=$language #================================================= # STANDARD MODIFICATIONS @@ -127,6 +129,7 @@ ynh_replace_string --match_string="__DESKEY__" --replace_string="$(ynh_string_ra ynh_replace_string --match_string="__DBUSER__" --replace_string="$db_name" --target_file="$rc_conf" ynh_replace_string --match_string="__DBPASS__" --replace_string="$db_pwd" --target_file="$rc_conf" ynh_replace_string --match_string="__DBNAME__" --replace_string="$db_name" --target_file="$rc_conf" +ynh_replace_string --match_string="__LANGUAGE__" --replace_string="$language" --target_file="$rc_conf" #================================================= # INSTALL ADDITIONAL PLUGINS diff --git a/scripts/restore b/scripts/restore index c9d43eb..a7cd2b5 100644 --- a/scripts/restore +++ b/scripts/restore @@ -77,7 +77,7 @@ chown -R $app: "$final_path/"{temp,logs,plugins/enigma/home} ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" -ynh_add_fpm_config --phpversion=$YNH_PHP_VERSION --package="$extra_php_dependencies" +ynh_add_fpm_config --package="$extra_php_dependencies" #================================================= # SPECIFIC RESTORATION diff --git a/scripts/upgrade b/scripts/upgrade index 0e49d0a..3a6f394 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -23,6 +23,7 @@ db_name=$(ynh_app_setting_get --app=$app --key=db_name) with_carddav=$(ynh_app_setting_get --app=$app --key=with_carddav) with_enigma=$(ynh_app_setting_get --app=$app --key=with_enigma) phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) +language=$(ynh_app_setting_get --app=$app --key=language) #================================================= # CHECK VERSION @@ -129,7 +130,7 @@ ynh_system_user_create --username=$app ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=5 # Create a dedicated PHP-FPM config -ynh_add_fpm_config --phpversion=$YNH_PHP_VERSION --package="$extra_php_dependencies" +ynh_add_fpm_config --package="$extra_php_dependencies" #================================================= # SPECIFIC UPGRADE @@ -153,6 +154,7 @@ then db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) ynh_replace_string --match_string="__DBPASS__" --replace_string="$db_pwd" --target_file="$rc_conf" ynh_replace_string --match_string="__DBNAME__" --replace_string="$db_name" --target_file="$rc_conf" + ynh_replace_string --match_string="__LANGUAGE__" --replace_string="$language" --target_file="$rc_conf" #================================================= # UPDATE DEPENDENCIES WITH COMPOSER