*Deprecated* See https://wiki.duraspace.org/display/VIVODOC/All+Documentation for current documentation

Here are some examples of the process I use to keep the es_GO files current

Properties files

Vitro/webapp/languages/es_GO/i18n/all_es_GO.properties

  1. Open a command-line window.
  2. Got to the property utilities directory

    cd git/VIVO/utilities/languageSupport/translateValuesInPropertyFile
  3. Extract all of the English-language strings from the properties file
    1. reads the properties file, sorts by key, then prints the values, one per line

      ruby property_stripper.rb  ../../../../Vitro/webapp/web/i18n/all.properties vitro_all.props
  4. Use Google Translate to create a "Spanish"-language version
    1. Go to https://translate.google.com/
    2. paste the contents of vitro_all.props into the left side, choose "English" on the left side and "Spanish" on the right.
    3. save the resulting translation as vitro_all_es.props
  5. Merge the new translation with the old translation
    1. reads the properties file, sorts by key and reads the new values, one per line.
    2. reads the previous translation file and keeps any value it finds, discarding the corresponding new translation.
    3. write the new file in the form of the old one.

      ruby property_inserter.rb  ../../../../Vitro/webapp/web/i18n/all.properties vitro_all_es.props ../../../../Vitro/webapp/languages/es_GO/i18n/all_es_GO.properties vitro_all_es_GO.properties
  6. Use a "diff" tool to see whether the changes look reasonable
  7. Copy the new translation file to overwrite the previous one.

    cp vitro_all_es_GO.properties ../../../../Vitro/webapp/languages/es_GO/i18n/all_es_GO.properties

This assumes that the only changes are additions, not deletions or modifications. It would be nice to do a diff between the previous and the current english-language files, so we can see what properties have been deleted or modified. Then, we would delete those from the old translation file before using it as an override. This means that the new translation would affect deletions and modifications also.

VIVO/languages/es_GO//themes/wilma/i18n/all_es_GO.properties

cd git/VIVO/utilities/languageSupport/translateValuesInPropertyFile
ruby property_stripper.rb ../../../themes/wilma/i18n/all.properties wilma.props

translate...

ruby property_inserter.rb ../../../themes/wilma/i18n/all.properties wilma.props ../../../languages/es_GO/themes/wilma/i18n/all_es_GO.properties wilma_es_GO.properties
cp wilma_es_GO.properties ../../../languages/es_GO/themes/wilma/i18n/all_es_GO.properties

Display names for classes and properties

VIVO/languages/es_GO//rdf/display/everytime/PropertyConfig_es_GO.n3

Not as polished as the scripts for properties files. There is no way to do an incremental translation. All the script will do is to replace the entire file.

cd git/VIVO/utilities/languageSupport/translateDisplayNames
ruby display_name_stripper.rb ../../../rdf/display/everytime/PropertyConfig.n3 displayNames_en_US

translate displayNames_en_US and save as displayNames_es_GO (the names are not significant)

ruby display_name_inserter.rb ../../../rdf/display/everytime/PropertyConfig.n3 displayNames_es_GO es-GO PropertyConfig_es_GO.n3
cp PropertyConfig_es_GO.n3 ../../../languages/es_GO/rdf/display/everytime/PropertyConfig_es_GO.n3

 

Labels in the ontology

VIVO/languages/es_GO//rdf/tbox/firsttime/initialTBoxAnnotations_es_GO.n3

As with DisplayNames, these scripts do not allow an incremental translation. As they stand now, a nicely curated file would be completely overwritten by its update.

cd git/VIVO/utilities/languageSupport/translateLabelsInOntology
ruby label_stripper.rb ../../../rdf/tbox/firsttime/initialTBoxAnnotations.n3 vivo_core_filter labels_en_US
ruby label_inserter.rb ../../../rdf/tbox/firsttime/initialTBoxAnnotations.n3 labels_es_GO es-GO vivo_core_filter initialTBoxAnnotations_es_GO.n3
cp initialTBoxAnnotations_es_GO.n3 ../../../languages/es_GO/rdf/tbox/firsttime/initialTBoxAnnotations_es_GO.n3

translate labels_en_US, save as labels_es_GO

cd git/VIVO/utilities/languageSupport/translateLabelsInOntology
ruby label_stripper.rb ../../../rdf/tbox/firsttime/initialTBoxAnnotations.n3 vivo_core_filter labels_en_US
ruby label_inserter.rb ../../../rdf/tbox/firsttime/initialTBoxAnnotations.n3 labels_es_GO es-GO vivo_core_filter initialTBoxAnnotations_es_GO.n3
cp initialTBoxAnnotations_es_GO.n3 ../../../languages/es_GO/rdf/tbox/firsttime/initialTBoxAnnotations_es_GO.n3
  • No labels