Script for translators

67 views
Skip to first unread message

Juan Corrales

unread,
Sep 21, 2018, 7:40:20 AM9/21/18
to Dataverse Internationalization Working Group
Philip Durbin propose here next idea:

"Hmm, maybe someone could write a script to do a "sort" and then "diff" between the keys in Bundle.properties between releases. So translators would know which keys were added or removed. Of course, this wouldn't report on changes made to the value of a key, to improve the wording or add or remove dynamic elements (i.e. {0}, {1}, etc.). So maybe the values should be "diffed" as well? I don't know. I haven't had any coffee yet. :) "

It is not exactly the same , but in linux, I use:


_________________________
#!/bin/bash
initVersion=v4.9.1 # any version
endVersion=v4.9.2 # any version
tempDir=diffBundles
onlyLabels=true # diff labels or translations

mkdir $tempDir
wget https://raw.githubusercontent.com/IQSS/dataverse/"$initVersion"/src/main/java/Bundle.properties -O $tempDir/Bundle_$initVersion
wget https://raw.githubusercontent.com/IQSS/dataverse/"$endVersion"/src/main/java/Bundle.properties -O $tempDir/Bundle_$endVersion

if [[ $onlyLabelss -eq true ]]; then
  sort $tempDir/Bundle_$initVersion | uniq | grep "=" | grep -v "^#" | cut -d "=" -f 1 > $tempDir/Bundle_sorted_$initVersion
  sort $tempDir/Bundle_$endVersion | uniq | grep "=" | grep -v "^#"  | cut -d "=" -f 1 > $tempDir/Bundle_sorted_$endVersion
else
  sort $tempDir/Bundle_$initVersion | uniq | grep "=" | grep -v "^#" > $tempDir/Bundle_sorted_$initVersion
  sort $tempDir/Bundle_$endVersion | uniq | grep "=" | grep -v "^#" > $tempDir/Bundle_sorted_$endVersion
fi

diff $tempDir/Bundle_sorted_$initVersion $tempDir/Bundle_sorted_$endVersion
_________________________


Philip Durbin

unread,
Sep 27, 2018, 8:18:00 PM9/27/18
to dataverse-intern...@googlegroups.com
Thanks for posting this code, Juan! I mentioned this post during this week's community call and added a link to it in the notes: https://groups.google.com/d/msg/dataverse-community/vO7WcrxdeCA/7Cpb_RKLAQAJ

Phil

--
You received this message because you are subscribed to the Google Groups "Dataverse Internationalization Working Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dataverse-internationa...@googlegroups.com.
To post to this group, send email to dataverse-intern...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dataverse-internationalization-wg/f0a6d570-d7dd-4df4-aff1-e80630fad569%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--

Juan Corrales

unread,
Sep 28, 2018, 1:33:19 PM9/28/18
to Dataverse Internationalization Working Group
Thanks Philip

uit.p...@gmail.com

unread,
Oct 6, 2018, 8:17:10 AM10/6/18
to Dataverse Internationalization Working Group
In addition to, or based on, the script mentioned above, I think it would be a good idea to use a translation platform (cf. this post in the Dataverse Users Community Google Group). I have now experience with software translation or translation platforms, but I guess it would be useful to have an overview (a kind of concordance) of all the terms (both single terms and wordings) used in Dataverse and their equivalents in the different languages Dataverse is (going to be) translated into. Maybe Slava could briefly describe how translation actually works in the framework DataverseEU is using?

Best,
Philipp

o.be...@fz-juelich.de

unread,
Oct 15, 2018, 5:14:03 AM10/15/18
to Dataverse Internationalization Working Group
Somehow this thread slipped through. I just opened another thread about concrete tooling. Sry for crossposting.

Vyacheslav Tikhonov

unread,
Oct 15, 2018, 10:06:24 AM10/15/18
to Dataverse Internationalization Working Group
Hi Juan,

I've slightly modified your script to produce pairs with new properties to be translated, it contains property name and value:

Example:
language=Language

downloadOriginal=Original Format

downloadArchival=Archival Format (.tab)

toggleNavigation=Toggle navigation

defaultBody=Default Body



Best,
Slava

Juan Corrales

unread,
Oct 15, 2018, 10:36:30 AM10/15/18
to Dataverse Internationalization Working Group
Thanks Slava,

  New version have a better output.

  Best,

Juan
Reply all
Reply to author
Forward
0 new messages