Add language choice for installation#664
Add language choice for installation#664CodeShakingSheep wants to merge 11 commits intoYunoHost-Apps:testingfrom
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 |
| 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.
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.
We are talking about a default value set if there was no previous value set.
There was a problem hiding this comment.
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.
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? |
|
|
||
| # 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.
shouldn't it be just $language here ?
There was a problem hiding this comment.
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_languagedefault_localedefault_phone_regionInupgradeI setdefault_phone_regionif it's not set according todefault_locale(which always has a value as it has a default value).Edit: Setting
default_phone_regionfor 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)