1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/simplytranslate_ynh.git synced 2024-09-03 20:16:26 +02:00

bilah konfigurasi

This commit is contained in:
Neko Nekowazarashi 2023-06-04 14:44:00 +07:00
parent 9df1697dea
commit c9f1cc43a7
2 changed files with 89 additions and 0 deletions

57
config_panel.toml Normal file
View file

@ -0,0 +1,57 @@
version="1.0"
[main]
name.en = "Configuration for $app"
name.id = "Konfigurasi untuk $app"
services = ["__APP__"]
[main.engine]
name.en = "Translation Engine"
name.id = "Mesin Penerjemahan"
[main.engine.google_enable]
ask.en = "Enable Google Translate?"
ask.id = "Aktifkan Google Translate?"
type = "boolean"
yes = true
no = false
[main.engine.reverso_enable]
ask.en = "Enable Reverso?"
ask.id = "Aktifkan Reverso?"
type = "boolean"
yes = true
no = false
[main.engine.iciba_enable]
ask.en = "Enable ICIBA?"
ask.id = "Aktifkan ICIBA?"
type = "boolean"
yes = true
no = false
[main.engine.deepl_enable]
ask.en = "Enable DeepL?"
ask.id = "Aktifkan DeepL?"
type = "boolean"
yes = true
no = false
help.en = "Deepl Translate does not support async as of right now, it will block all other requests while it's processing a Deepl Requests, please enable this with caution!"
[main.engine.libretranslate_enable]
ask.en = "Enable LibreTranslate?"
ask.id = "Aktifkan LibreTranslate?"
type = "boolean"
yes = true
no = false
[main.engine.libretranslate_instance]
ask.en = "From which LibreTranslate instance?"
ask.id = "Dari LibreTranslate mana?"
type = "string"
help.en = "If you disable LibreTranslate, just leave this blank. Required if you enable LibreTranslate."
help.id = "Jika LibreTranslate tidak dipilih, biarkan ini kosong. Dibutuhkan jika LibreTranslate diaktifkan."
[main.engine.libretranslate_api]
ask.en = "API key for LibreTranslate:"
ask.id = "Kunci API untuk LibreTranslate:"
type = "string"
help.en = "If you disable LibreTranslate or your instance didn't need API key, just leave this blank."
help.id = "Jika LibreTranslate tidak dipilih atau LibreTranslate pilihanmu tidak memerlukan ini, biarkan ini kosong."

32
scripts/config Normal file
View file

@ -0,0 +1,32 @@
#!/bin/bash
source /usr/share/yunohost/helpers
ynh_abort_if_errors
#=================================================
# RETRIEVE ARGUMENTS
#=================================================
install_dir=$(ynh_app_setting_get --app=$app --key=install_dir)
port=$(ynh_app_setting_get -a $app -k port)
#=================================================
# APPLYING CONFIG
#=================================================
ynh_app_config_apply() {
_ynh_app_config_apply
ynh_add_config --template="config.conf.template" --destination="$install_dir/simplytranslate/config.conf"
chmod 400 "$install_dir/simplytranslate/config.conf"
chown $app:$app "$install_dir/simplytranslate/config.conf"
}
#=================================================
# GENERIC FINALIZATION
#=================================================
ynh_app_config_run $1