Skip to content

Commit

Permalink
Merge pull request #10940 from IQSS/10939-i18n-docker
Browse files Browse the repository at this point in the history
how to set up languages (English, French, etc.) in Docker
  • Loading branch information
ofahimIQSS authored Oct 21, 2024
2 parents d039a10 + 0854019 commit e82069e
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 1 deletion.
5 changes: 5 additions & 0 deletions doc/release-notes/10939-i18n-docker.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## Multiple Language in Docker

Configuration and documentation has been added to explain how to set up multiple languages (e.g. English and French) in the tutorial for setting up Dataverse in Docker.

See also #10939
17 changes: 17 additions & 0 deletions doc/sphinx-guides/source/container/running/demo.rst
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,23 @@ In the example below of configuring :ref:`:FooterCopyright` we use the default u

One you make this change it should be visible in the copyright in the bottom left of every page.

Multiple Languages
++++++++++++++++++

Generally speaking, you'll want to follow :ref:`i18n` in the Installation Guide to set up multiple languages such as English and French.

To set up the toggle between English and French, we'll use a slight variation on the command in the instructions above, adding the unblock key we created above:

``curl "http://localhost:8080/api/admin/settings/:Languages?unblock-key=unblockme" -X PUT -d '[{"locale":"en","title":"English"},{"locale":"fr","title":"Français"}]'``

Similarly, when loading the "languages.zip" file, we'll add the unblock key:

``curl "http://localhost:8080/api/admin/datasetfield/loadpropertyfiles?unblock-key=unblockme" -X POST --upload-file /tmp/languages/languages.zip -H "Content-Type: application/zip"``

Stop and start the Dataverse container in order for the language toggle to work.

Note that ``dataverse.lang.directory=/dv/lang`` has already been configured for you in the ``compose.yml`` file. The step where you loaded "languages.zip" should have populated the ``/dv/lang`` directory with files ending in ".properties".

Next Steps
----------

Expand Down
2 changes: 1 addition & 1 deletion doc/sphinx-guides/source/installation/config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1783,7 +1783,7 @@ Now that you have a "languages.zip" file, you can load it into your Dataverse in

``curl http://localhost:8080/api/admin/datasetfield/loadpropertyfiles -X POST --upload-file /tmp/languages/languages.zip -H "Content-Type: application/zip"``

Click on the languages using the drop down in the header to try them out.
Stop and start Payara and then click on the languages using the drop down in the header to try them out.

.. _help-translate:

Expand Down
1 change: 1 addition & 0 deletions docker-compose-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ services:
-Ddataverse.pid.fake.label=FakeDOIProvider
-Ddataverse.pid.fake.authority=10.5072
-Ddataverse.pid.fake.shoulder=FK2/
-Ddataverse.lang.directory=/dv/lang
ports:
- "8080:8080" # HTTP (Dataverse Application)
- "4949:4848" # HTTPS (Payara Admin Console)
Expand Down
1 change: 1 addition & 0 deletions docker/compose/demo/compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ services:
-Ddataverse.pid.fake.label=FakeDOIProvider
-Ddataverse.pid.fake.authority=10.5072
-Ddataverse.pid.fake.shoulder=FK2/
-Ddataverse.lang.directory=/dv/lang
ports:
- "8080:8080" # HTTP (Dataverse Application)
- "4848:4848" # HTTP (Payara Admin Console)
Expand Down

0 comments on commit e82069e

Please sign in to comment.