Skip to content

Instantly share code, notes, and snippets.

@machisuji
Created May 25, 2020 11:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save machisuji/830f30d9c75c3a0cc6a9da839c40a847 to your computer and use it in GitHub Desktop.
Save machisuji/830f30d9c75c3a0cc6a9da839c40a847 to your computer and use it in GitHub Desktop.
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