Skip to content

Instantly share code, notes, and snippets.

@machisuji
Created May 25, 2020
Embed
What would you like to do?
OpenProject: Testing translations via docker
  1. Get the current translations from the locales folder inside of the container.
docker run --name openroject -d --rm openproject/community:10

This will start the container from which you can copy the current files like this:

docker cp openproject:/app/config/locales ./

If you are in your home directory on the docker host this will copy the locales to /home/$USER/locales for instance. Where $USER is your username on the system. Once copied you can stop the container. It will be removed automatically due to the --rm option.

docker stop openproject
  1. Make your changes to the locales for instance in /home/$USER/locales/crowdin/en.yml and /home/$USER/locales/crowdin/js-en.yml, or in which ever language you want to change (e.g. sl.yml for Slovenian).

  2. Start the final container using your changed locales.

docker run --name openproject -p 8080:80 -v /home/$USER/locales:/app/config/locales -d openproject/community:10

Here we expose the port 80 on the host's port 8080 and mount your changed locales from your host too. Once the container has booted up, which may take a minute, you can test it on http://localhost:8080 (login: admin, password: admin).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment