IQSS / dataverse-docker

Dataverse 6.2 on Docker with integrated services called "Archive in a box" and could be used both as demo and production system and easily integrated with other services.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to change languge versions of the interface?

pkiraly opened this issue · comments

In the last section of the README there is an emphasis on multilinguality, but there is no description on how to change language versions of the interface? Is it available out of the box (that's what README suggests)? If not, please describe the steps to add language files.

I found a solution for this, but it is not a clean one.

1.) Add a Volume with this parameters
- domains:/opt/payara/appserver/glassfish/domains/

2.) start docker and wait until Dataverse is ready
docker-compose up

3.) stop dataverse

Optional
4.) Copy everything from the "domains" Volume in the docker-compose parth

Optional
5.) Add the "domains" folder as volume and remove the volume from point 1
- ./domains:/opt/payara/appserver/glassfish/domains/

6.) open the file "domains/config/domains.xml"
image

7.) Search for </java-config> (there should be 2 entries in the file) and edit it.
replace
</java-config>
with

        <jvm-options>-Ddataverse.lang.directory=/extern/lang</jvm-options>
</java-config>

you can change "/extern/lang" with something else, but it have to be a place in the dataverse image.
I use the folder "/extern/lang/" but you can use "/lang/", or some other names, too.
image

image

8.) Mount the folder in the docker image. It has to be the same path as point 7.
- ./lang:/extern/lang

9.) create the folder "lang" I mounted in point 8.
It has the be in the same folder as the docker-compose file.

10.) Add the language files in the "lang" folder.
I used the files from:
https://github.com/GlobalDataverseCommunityConsortium/dataverse-language-packs

You only have to add the .properties files, and not the folders.
image

Thank you for the link to the script.

There is one problem with that approach.
With the use of the docker-compose.yml file, the setting of
asadmin --user=${ADMIN_USER} --passwordfile=${PASSWORD_FILE} create-jvm-options '-Ddataverse.lang.directory=/opt/payara/langproperties'
will get lost after a restart.

I even tried the following.

  • Downloading the files from en_US
  • edit some text int he file (example: "Laboratory=_")
  • zip it with
    zip languages.zip *.properties
  • set up the language folder and upload the zip
asadmin --user=${ADMIN_USER} --passwordfile=${PASSWORD_FILE} create-jvm-options '-Ddataverse.lang.directory=/opt/payara/langproperties'

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

Nothing changed with that approach.

With the use of a volume
- domains:/opt/payara/appserver/glassfish/domains/
and the one line from the script
asadmin --user=${ADMIN_USER} --passwordfile=${PASSWORD_FILE} create-jvm-options '-Ddataverse.lang.directory=/opt/payara/langproperties'
it would work.