mirror of
https://github.com/YunoHost-Apps/rainloop_ynh.git
synced 2024-09-03 20:16:18 +02:00
switch from lang to language variable
This commit is contained in:
parent
1df3c31491
commit
92e63af009
4 changed files with 16 additions and 18 deletions
|
@ -6,7 +6,7 @@
|
||||||
is_public=1 (PUBLIC|public=1|private=0)
|
is_public=1 (PUBLIC|public=1|private=0)
|
||||||
password="password"
|
password="password"
|
||||||
ldap=1
|
ldap=1
|
||||||
lang="English"
|
language="fr"
|
||||||
; Checks
|
; Checks
|
||||||
pkg_linter=1
|
pkg_linter=1
|
||||||
setup_sub_dir=1
|
setup_sub_dir=1
|
||||||
|
|
|
@ -52,14 +52,14 @@
|
||||||
"default": false
|
"default": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "lang",
|
"name": "language",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"ask": {
|
"ask": {
|
||||||
"en": "Choose the application language",
|
"en": "Choose the application language",
|
||||||
"fr": "Choisissez la langue de l'application"
|
"fr": "Choisissez la langue de l'application"
|
||||||
},
|
},
|
||||||
"choices": ["English", "Francais"],
|
"choices": ["fr", "en"],
|
||||||
"default": "English"
|
"default": "fr"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "password",
|
"name": "password",
|
||||||
|
|
|
@ -25,7 +25,7 @@ path_url=$YNH_APP_ARG_PATH
|
||||||
is_public=$YNH_APP_ARG_IS_PUBLIC
|
is_public=$YNH_APP_ARG_IS_PUBLIC
|
||||||
password=$YNH_APP_ARG_PASSWORD
|
password=$YNH_APP_ARG_PASSWORD
|
||||||
ldap=$YNH_APP_ARG_LDAP
|
ldap=$YNH_APP_ARG_LDAP
|
||||||
lang=$YNH_APP_ARG_LANG
|
language=$YNH_APP_ARG_LANGUAGE
|
||||||
|
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
app=$YNH_APP_INSTANCE_NAME
|
||||||
|
|
||||||
|
@ -100,18 +100,7 @@ ynh_add_fpm_config
|
||||||
# AUTOCONFIG
|
# AUTOCONFIG
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
# Set lang => define from install manifest
|
ynh_app_setting_set "$app" language "$language"
|
||||||
case "$lang" in
|
|
||||||
Francais)
|
|
||||||
lang="fr"
|
|
||||||
;;
|
|
||||||
English)
|
|
||||||
lang="en"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
lang="en"
|
|
||||||
esac
|
|
||||||
ynh_app_setting_set "$app" lang "$lang"
|
|
||||||
|
|
||||||
# Set plugins
|
# Set plugins
|
||||||
plugins="ynh-login-mapping,auto-domain-grab" # This plugin is trying to automatically grab unknown domains if users want to add external email accounts
|
plugins="ynh-login-mapping,auto-domain-grab" # This plugin is trying to automatically grab unknown domains if users want to add external email accounts
|
||||||
|
@ -129,7 +118,7 @@ sudo cp ../conf/data/configs/application.ini "$application_file"
|
||||||
ynh_replace_string "domain.tld" "$domain" "$application_file"
|
ynh_replace_string "domain.tld" "$domain" "$application_file"
|
||||||
ynh_replace_string "MYSQLUSER" "$db_name" "$application_file"
|
ynh_replace_string "MYSQLUSER" "$db_name" "$application_file"
|
||||||
ynh_replace_string "MYSQLPASSWORD" "$db_pwd" "$application_file"
|
ynh_replace_string "MYSQLPASSWORD" "$db_pwd" "$application_file"
|
||||||
ynh_replace_string "LANGTOCHANGE" "$lang" "$application_file"
|
ynh_replace_string "LANGTOCHANGE" "$language" "$application_file"
|
||||||
ynh_replace_string "PLUGINSTOENABLE" "$plugins" "$application_file"
|
ynh_replace_string "PLUGINSTOENABLE" "$plugins" "$application_file"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,15 @@ is_public=$(ynh_app_setting_get $app is_public)
|
||||||
final_path=$(ynh_app_setting_get $app final_path)
|
final_path=$(ynh_app_setting_get $app final_path)
|
||||||
db_name=$(ynh_app_setting_get $app db_name)
|
db_name=$(ynh_app_setting_get $app db_name)
|
||||||
|
|
||||||
|
lang=$(ynh_app_setting_get $app lang)
|
||||||
|
|
||||||
|
if [ -n "$lang" ]
|
||||||
|
then
|
||||||
|
language="$lang"
|
||||||
|
ynh_app_setting_set "$app" language "$language"
|
||||||
|
ynh_app_setting_delete "$app" lang
|
||||||
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# ENSURE DOWNWARD COMPATIBILITY
|
# ENSURE DOWNWARD COMPATIBILITY
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
Loading…
Reference in a new issue