Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@ ram.runtime = "512M"
type = "group"
default = "visitors"

[install.language]
ask.en = "Choose the application language"
ask.fr = "Choisissez la langue de l'application"
type = "select"
choices = ["en_US", "es_ES", "it_IT", "fr_FR", "de_DE"]
default = "en_US"

[install.user_home]
ask.en = "Access the users home folder from Nextcloud?"
ask.fr = "Accéder au dossier personnel des utilisateurs depuis Nextcloud ?"
Expand Down
13 changes: 12 additions & 1 deletion scripts/install
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,18 @@ ynh_script_progression --message="Configuring $app..." --weight=8
# Set the mysql.utf8mb4 config to true in config.php
exec_occ config:system:set mysql.utf8mb4 --type boolean --value="true"

# move the logs from the data_dir to the standard /var/log
# Set default language in config.php
raw_language=$(echo "$language" | awk -F'_' '{print $1}')
exec_occ config:system:set default_language --value="$raw_language"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't it be just $language here ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, Nextcloud's default_language uses ISO_639-1 language codes such as en for English, see https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/config_sample_php_parameters.html#default-language

That's why we need to cut the first part from $language, e.g. take en from en_US.


# Set default locale in config.php
exec_occ config:system:set default_locale --value="$language"

# Set default phone region in config.php
country=$(echo "$language" | awk -F'_' '{print $2}')
exec_occ config:system:set default_phone_region --value="$country"

# Move the logs from the data_dir to the standard /var/log
exec_occ config:system:set logfile --value="/var/log/$app/nextcloud.log"

# Ensure that UpdateNotification app is disabled
Expand Down