V5.5 problem Load the languages.zip file into your Dataverse Installation

99 views
Skip to first unread message

leonardr...@gmail.com

unread,
Jul 19, 2021, 11:09:29 AM7/19/21
to Dataverse Users Community
Dear,

I have dataverse 5.5 installed on a server on debian 10.

I performed the following procedure to use the English language in version 5.5

Creating a languages.zip File

The Dataverse Software provides and API endpoint for adding languages using a zip file.

First, clone the “dataverse-language-packs” git repo.

git clone https://github.com/GlobalDataverseCommunityConsortium/dataverse-language-packs.git

Take a look at https://github.com/GlobalDataverseCommunityConsortium/dataverse-language-packs/branches to see if the version of the Dataverse Software you’re running has translations.

Change to the directory for the git repo you just cloned.

cd dataverse-language-packs

Switch (git checkout) to the branch based on the Dataverse Software version you are running. The branch “dataverse-v4.13” is used in the example below.

export BRANCH_NAME=dataverse-v5.5

git checkout $BRANCH_NAME

Create a “languages” directory in “/tmp”.

mkdir /tmp/languages

Copy the properties files into the “languages” directory

cp -R en_US/*.properties /tmp/languages

cd /tmp/languages

zip languages.zip *.properties

Load the languages.zip file into your Dataverse Installation

Now that you have a “languages.zip” file, you can load it into your Dataverse installation with the command below.

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.


As I didn't find the same procedure for the Portuguese language in the dataverse version 5.5, I tried to use the version 4.13.

But when I ran the same procedure for Portuguese, at the time I ran the command. My dataverse doesn't open anymore.

Could you help me on how to reverse this? Or how to solve?

The error log is attached.

server.log

James Myers

unread,
Jul 19, 2021, 1:42:05 PM7/19/21
to dataverse...@googlegroups.com

FWIW:

 

The loadpropertyfiles api call unzips your files and writes it to the Dataverse lang directory (set via the dataverse.lang.directory property, /tmp/languages by default).

 

The error in the log indicates that Dataverse can’t find the properties files for English (en), which appears to be fatal. From looking in the code, I think creating/adding files to the languages dir makes Dataverse look for an en file rather than using the builtin Bundle.properties file.

 

So – just to restore, I think if you remove files from the Dataverse.lang.directory dir you should be able to boot. To run with Portuguese, you should make sure you have en files in your zip/ in the lang directory as well.

 

In general, the problem with older language bundles is that they are missing entries added in later versions and you’ll see odd labels in the UI for those new fields. So, it probably would work for testing, but I think you’d want to update the language pack before thinking about production (manually or using weblate.dataverse.org).

 

Hope that helps,

 

--Jim

--
You received this message because you are subscribed to the Google Groups "Dataverse Users Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dataverse-commu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dataverse-community/9e230e24-456a-4413-8751-731cb68bb825n%40googlegroups.com.

leonardr...@gmail.com

unread,
Jul 21, 2021, 1:43:28 PM7/21/21
to Dataverse Users Community
Thanks for the answer Jim.

Am I doing something wrong?

I'm using the en_US file from the 5.5 version and the pt_BR from the 4.13 version of the dataverse

The application only works if I comment out the Ddataverse.lang.directory command in the domain.xml file

See attached images of the procedure.

Graciously,
Leonard
dataverse.languages0.png
dataverse.languages2.png
server.log
dataverse.languages1.png
dataverse.languages7.png
dataverse.languages8.png
dataverse.languages3.png
dataverse.languages4.png
dataverse.languages6.png
dataverse.languages5.png

leonardr...@gmail.com

unread,
Jul 21, 2021, 1:56:38 PM7/21/21
to Dataverse Users Community
The dataverse looks like this according to the image langues9.png

After I remove the command and restart payara. the dataverse normalizes.
dataverse.languages11.png
dataverse.languages9.png
dataverse.languages10.png

James Myers

unread,
Jul 21, 2021, 2:40:58 PM7/21/21
to dataverse...@googlegroups.com

Leonard,

I haven’t gotten to look through everything but I have one quick thought from image2: the code may expect the en_US and pt_BR directly under /home/Dataverse/langBundles rather than in a Dataverse-language-packs subdir. That could be due to your zip including that parent dir when it shouldn’t, but I think you could try manually moving the subdirs up on directory level.

 

-- Jim

James Myers

unread,
Jul 23, 2021, 4:30:17 PM7/23/21
to dataverse...@googlegroups.com

Leonard,

I looked again and did some testing:

 

Whatever you have for your language dir setting, e.g. /tmp/languages, you have to have all of the properties files in that dir with no subdirs.

 

The config guide instructions say:

cp -R en_US/*.properties /tmp/languages

And then

cd /tmp/languages

zip languages.zip *.properties

 

which should give you a flat set of files in /tmp/languages when you unzip there.

 

W.r.t. to testing: when I set my Dataverse.lang.directory jvm-option to a directory that didn’t exist, I got 500 errors. When I created the dir and then added Bundle.properties from the us_en pack, I was able to get to the homepage.

 

So – I think if you remove the subdirectory structure in what you did, you should be up and running.

 

Then – I would suggest some dir outside of /tmp for your real data.lang.directory (some filesystems periodically delete everything in /tmp!) and you’ll then be in a position to look into updating the older pt pack to add missing terms (e.g. with Weblate).

 

Hope that helps!

-- Jim

 

From: dataverse...@googlegroups.com [mailto:dataverse...@googlegroups.com] On Behalf Of leonardr...@gmail.com


Sent: Wednesday, July 21, 2021 1:57 PM

Leonard Richard Rodrigues R. Campelo

unread,
Jul 27, 2021, 2:46:04 PM7/27/21
to dataverse...@googlegroups.com
Thanks for the response James,

I threw the English translation files into the /home/dataverse/langBundles directory and it started working again.

cp -R en_US/*.properties /home/dataverse/langBundles

And it worked again :)

With that I did the same procedure with the pt_BR file from the dataverse in version 4. But it didn't work :(

I made a modification in the Bundle.properties file, restarted the payara service and the modification appeared.

With that I created a copy of Bundle.properties in version 5.5 and named Bundle_br.properties and made a small change, but the translation is not happening.

In fact, the only translation being made into Portuguese is the dates, see attached.

If you can help me I will be very grateful.

Sincerely,

Leonard Richard

Livre de vírus. www.avast.com.


Livre de vírus. www.avast.com.
langBundles1.png
langBundles2.png
langBundles3.png
langBundles4.png
langBundles5.png
langBundles6.png
langBundles7.png
langBundles8.png
server.log

Philip Durbin

unread,
Aug 11, 2021, 4:34:55 PM8/11/21
to dataverse...@googlegroups.com
Hi Leonard,

If you're still having trouble with this, please feel free to email sup...@dataverse.org

Thanks,

Phil



--

James Myers

unread,
Aug 20, 2021, 1:45:57 PM8/20/21
to dataverse...@googlegroups.com

Leonard,

Sorry for the delay. If you haven’t figured this out yet:

I was able to display pt_BR translations with the following:

 

·         Using “locale”:”pt_BR” in the :Languages setting

·         Using files with names like Bundle_pt_BR.properties in the /home/dataverse/langBundles directory.

 

-- Jim

Reply all
Reply to author
Forward
0 new messages