1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/invidious_ynh.git synced 2024-09-03 19:15:55 +02:00

Add language

This commit is contained in:
ericgaspar 2020-11-10 11:53:07 +01:00
parent e4aba36c60
commit 6aa08961e4
No known key found for this signature in database
GPG key ID: 574F281483054D44
4 changed files with 26 additions and 2 deletions

View file

@ -1,14 +1,23 @@
channel_threads: 1
feed_threads: 1
db:
user: __DB_NAME__
password: __DB_PASS__
host: localhost
port: 5432
dbname: __DB_NAME__
full_refresh: false
https_only: false
https_only: true
domain: http://__DOMAIN__
port: __PORT__
host_binding: 127.0.0.1
#https://github.com/iv-org/invidious/blob/5c6911065845d2724c7826f3d663a6ee6c7d4774/src/invidious/helpers/helpers.cr#L129
default_user_preferences:
dark_mode: true
local: true
locale: "__LANGUAGE__"
comments: ["youtube",""]

View file

@ -52,7 +52,17 @@
"fr": "Vous devez activer site public si vous souhaitez connecter un lecteur client à Navidrome. Vous pourrez changer ceci plus tard via la webadmin."
},
"default": true
}
},
{
"name": "language",
"type": "string",
"ask": {
"en": "Choose the application language",
"fr": "Choisissez la langue de l'application"
},
"choices": ["fr_FR", "en_GB", "de_DE"],
"default": "en_GB"
},
]
}
}

View file

@ -26,6 +26,7 @@ ynh_abort_if_errors
domain=$YNH_APP_ARG_DOMAIN
path_url="/"
is_public=$YNH_APP_ARG_IS_PUBLIC
language=$YNH_APP_ARG_LANGUAGE
app=$YNH_APP_INSTANCE_NAME
@ -48,6 +49,7 @@ ynh_script_progression --message="Storing installation settings..." --weight=2
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=is_public --value=$is_public
ynh_app_setting_set --app=$app --key=language --value=$language
#=================================================
# STANDARD MODIFICATIONS
@ -140,6 +142,7 @@ ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --ta
ynh_replace_string --match_string="__DB_PASS__" --replace_string="$db_pwd" --target_file="$final_path/config/config.yml"
ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$final_path/config/config.yml"
ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$final_path/config/config.yml"
ynh_replace_string --match_string="__LANGUAGE__" --replace_string="$language" --target_file="$final_path/config/config.yml"
ynh_store_file_checksum --file="$final_path/config/config.yml"

View file

@ -21,6 +21,7 @@ path_url=$(ynh_app_setting_get --app=$app --key=path)
is_public=$(ynh_app_setting_get --app=$app --key=is_public)
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
port=$(ynh_app_setting_get --app=$app --key=port)
language=$(ynh_app_setting_get --app=$app --key=language)
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
db_user=$db_name
db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd)
@ -113,6 +114,7 @@ ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --ta
ynh_replace_string --match_string="__DB_PASS__" --replace_string="$db_pwd" --target_file="$final_path/config/config.yml"
ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$final_path/config/config.yml"
ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$final_path/config/config.yml"
ynh_replace_string --match_string="__LANGUAGE__" --replace_string="$language" --target_file="$final_path/config/config.yml"
ynh_store_file_checksum --file="$final_path/config/config.yml"