-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add language choice for installation #664
base: testing
Are you sure you want to change the base?
Add language choice for installation #664
Conversation
Add language select
Configure language settings via occ
Fix no default phone region
Fix language values for config.php
Fix language code format, add German
Fix setting default phone region
!testme |
Fix upgrading with from installation with no default locale
!testme |
Fix upgrading from installation with no default locale
!testme |
scripts/upgrade
Outdated
@@ -143,6 +143,10 @@ then | |||
# Fix warning "Your installation has no default phone region set" | |||
if [ "$(exec_occ config:system:get default_phone_region)" == "" ]; then | |||
config_locale=$(exec_occ config:system:get default_locale) | |||
if [ "$config_locale" == "" ]; then | |||
# If it's not set in config use "US" as default | |||
config_locale="US" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not FR by default?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not any other code. It would be more logical that the user chooses from a drop down list at the installation or change it in the app panel
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are talking about a default value set if there was no previous value set.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @ericgaspar,
I set "US" because in manifest.toml
I used "en_US" as default install language and so I wanted to use the default country here as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's then change the default language to fr
(because it is by far the most used...)
Fix for checking if config_locale is set
!testme |
What is going on on the test machine? There is this error which is completely unrelated to this package. Can someone look into that?
|
@@ -87,6 +87,17 @@ 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" | |||
|
|||
# Set default language in config.php | |||
raw_language=$(echo "$language" | awk -F'_' '{print $1}') | |||
exec_occ config:system:set default_language --value="$raw_language" |
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
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
.
is this language choice not best handled with config panels? cf. #638 |
I restarted the lastest CI job https://ci-apps-dev.yunohost.org/ci/job/13727 |
Remove fix for "no default phone region" (to be handled via config panel)
Thanks for the hint. I hadn't checked out that PR. Indeed it seems to be the cleaner solution to set a value in config panel rather than to use a fixed default value during upgrade. So, I removed the fix in |
!testme |
Problem
Nextcloud shows the following warning:
Your installation has no default phone region set. This is required to validate phone numbers in the profile settings without a country code. To allow numbers without a country code, please add "default_phone_region" with the respective ISO 3166-1 code of the region to your config file. For more details see the documentation ↗.
Solution
Added question for language in
manifest.toml
. Set 3 language variables (see here: https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/config_sample_php_parameters.html#default-language ) ininstall
:default_language
default_locale
default_phone_region
Inupgrade
I setdefault_phone_region
if it's not set according todefault_locale
(which always has a value as it has a default value).Edit: Setting
default_phone_region
for existing installations should be handled in config panel, cf. #638.PR Status
Automatic tests
Automatic tests can be triggered on https://ci-apps-dev.yunohost.org/ after creating the PR, by commenting "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!". (N.B. : for this to work you need to be a member of the Yunohost-Apps organization)