Which chart:
bitnami/moodle:7.2.13 : https://github.com/bitnami/charts/tree/master/bitnami/moodle
docker image: https://github.com/bitnami/bitnami-docker-moodle
Is your feature request related to a problem? Please describe.
As a teacher / manager of a school,
I want several languages to be supported,
In order for the app to be usable by teachers and student who speak different languages.
Describe the solution you'd like
Given a working moodle installation,
When I try to add moodle language packs,
Then I should not be warned with this message:
Your server does not seem to fully support the following languages:
- Deutsch - Schweiz (de_ch)
- Deutsch (de)
- English (en)
- Français (fr)
- Italiano (it)
- 日本語 (ja)
Executing a shell in the moodle container and running dpkg-reconfigure locales, adding all locales, running locale-gen and setting a sensible default locale (probably en_US.UTF-8 should be good for general purpose, albeit making it configurable would be the best solution IMHO) solves the problem.
We should probably add a flag and configure the Dockerfile accordingly, to add all locales if needed on build time, or use another Docker base image.
Describe alternatives you've considered
Use it as is, with possible downgraded user experience.
Additional context
I am using this on a Rancher cluster.
Hi @soriyath, thanks for opening this issue.
We are going to open an internal task to solve it. In the meantime, do you think you can create a custom Dockerfile from the Bitnami one to execute the required commands?
@andresbono yes i'll try doing that this week. just to be clear, we want to implement the changes I've proposed in the bitnami Dockerfile for moodle?
a simple feature flag will suffice? i.e. a boolean flag that, when true, will simply add all the locales on the container?
Hi @soriyath, we made some changes in the container: https://github.com/bitnami/bitnami-docker-moodle/commit/9b8b32329a8eec55ac28eb2cf39285d8530f69c8 and we added a new section in the README on this topic. https://github.com/bitnami/bitnami-docker-moodle#installing-additional-language-packs. We hope you find this useful!
We won't add all the locales by default, but you can follow the steps explained in the link above to add the ones that you need.
@andresbono I've seen this. I think it's not good because most of the users won't extend the docker file. Therefore, it is not a long term solution. I've started working on this yesterday and can push some code so that you can consider my approach ?
Yes, of course! Please, open a PR and we will be glad to review it.
I've created this issue on the moodle docker project: https://github.com/bitnami/bitnami-docker-moodle/issues/122 so that I can reference my PR.
The content of file /usr/share/i18n/SUPPORTED is relevant for adding extra locales. Should we add it as part of the documentation or point to it? I haven't found it from the Debian documentation.
Users could also just run: docker run -it --rm docker.io/bitnami/minideb:buster /bin/bash and cat /usr/share/i18n/SUPPORTED; so there is a (not obvious) workaround.
What do you think?
@andresbono Please check my PR: https://github.com/bitnami/bitnami-docker-moodle/pull/123 .
I've added the possibility to add only some extra locales as well.
FYI I've added the changes in the README.md file here, so that you can inspect the new "API" quicker:
Alternatively, you can add some extra locales using docker build arg EXTRA_LOCALES with the desired values.
The value must be entries from file /usr/share/i18n/SUPPORTED in the container docker.io/bitnami/minideb:buster.
The default locales en_AU.UTF-8 UTF-8 and en_US.UTF-8 UTF-8 will still be packaged, defaulting to en_US.UTF-8 UTF-8.
You MUST NOT re-add them.
If you're adding several new locales, separate them with a comma and a space, like so: "fr_CH.UTF-8 UTF-8, de_CH.UTF-8 UTF-8, it_CH.UTF-8 UTF-8, de_DE.UTF-8 UTF-8".
Modify the docker-compose.yml file present in this repository:
moodle:
...
# image: 'bitnami/moodle:3' # remove this line !
build:
context: .
dockerfile: Dockerfile
args:
- EXTRA_LOCALES="fr_CH.UTF-8 UTF-8, de_CH.UTF-8 UTF-8, it_CH.UTF-8 UTF-8, de_DE.UTF-8 UTF-8"
...
For manual execution:
$ docker build -t bitnami/moodle:latest --build-arg EXTRA_LOCALES="fr_CH.UTF-8 UTF-8, de_CH.UTF-8 UTF-8, it_CH.UTF-8 UTF-8, de_DE.UTF-8 UTF-8" .
Finally, you can generate all supported locales by setting the build environment variable WITH_ALL_LOCALES to 1. The generation of the locales takes some time.
Modify the docker-compose.yml file present in this repository:
moodle:
...
# image: 'bitnami/moodle:3' # remove this line !
build:
context: .
dockerfile: Dockerfile
args:
- WITH_ALL_LOCALES=1
...
For manual execution:
$ docker build -t bitnami/moodle:latest --build-arg WITH_ALL_LOCALES=1 .
Thanks for opening the PR, @soriyath. We will evaluate the suggested approach and will review the PR shortly.
@andresbono apparently https://github.com/bitnami/bitnami-docker-moodle/pull/123 won't be merged. This issue won't be solved then. Too bad I lost all of that time when I could have gone the private helm repo directly.
Sorry to hear that, @soriyath. In any case, we made some good improvements to the container thanks to your suggestions: https://github.com/bitnami/charts/issues/2493#issuecomment-633896431. And from what I see in https://github.com/bitnami/bitnami-docker-moodle/pull/123, there are pieces that we agree on evaluating for including them.
We always try to find balance between ease of use, simplicity and in the case of containers, keeping them in a small size.
Most helpful comment
Yes, of course! Please, open a PR and we will be glad to review it.