Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[i18n-3762] Moving UI labels translations into vitro #350

Conversation

chenejac
Copy link
Contributor

@chenejac chenejac commented Nov 23, 2022

VIVO GitHub issue: 3762

Companion PR

What does this pull request do?

Moving UI labels translations from Vitro-languages into Vitro (+ adoption of a pom file)

What's new?

webapp directories from Vitro-languages repository are not needed any more. Together with PR for doing the same for home directories from Vitro-languages should enable archiving the Vitro-languages repositories.

How should this be tested?

  • Checkout https://github.com/vivo-project/Vitro-languages/tree/i18n-redesign as Vitro-languages project
  • Remove Vitro home and install the new, fresh instance of Vitro
  • Validate it is working as expected
  • Try switching between all 8 languages (set in the runtime.properties languages.selectableLocales = en_US, de_DE, sr_Latn_RS, ru_RU, fr_CA, en_CA, es, pt_BR)

Interested parties

Tag (@ mention) interested parties or, if unsure, @VIVO-project/vivo-committers

@litvinovg
Copy link
Contributor

litvinovg commented Nov 25, 2022

How to validate data in this PR and companion PR:

webapp/src/main/webapp/WEB-INF/resources/startup_listeners.txt should be fixed
edu.cornell.mannlib.vitro.webapp.i18n.selection.LocaleSelectionSetup
should run before line
edu.cornell.mannlib.vitro.webapp.servlet.setup.ConfigurationModelsSetup

  • Clean tdbModels and tdbContentModels directories or use fresh instance
  • Add line log4j.logger.edu.cornell.mannlib.vitro.webapp.i18n.TranslationConverter=DEBUG to the file installer/webapp/src/main/webResources/WEB-INF/classes/log4j.properties
  • Build Vitro with PR changes (Optionally you can merge this PR on top of this otherwise loading ttl can take ages)
  • Set languages.selectableLocales = en_US, de_DE, fr_CA, ru_RU, es, en_CA, pt_BR, sr_Latn_RS in runtime.properties
  • Log in, go to Ingest tools, configuration models, click output interface model http://vitro.mannlib.cornell.edu/default/interface-i18n, model shouldn't be empty. If it is empty - try restart tomcat and check again. If there is some data, go to the next step.
  • Shutdown Tomcat. Make copies of vitro-dir/rdf and tdbModels directories
  • Build Vitro without this PR applied
  • Copy all contents of saved vitro-dir/rdf into vitro-dir/rdf (to add the same n3 files that provided in this PR, otherwise they might be removed from the model before validation)
  • Start Tomcat
  • Inspect webapp log file in tomcat/logs directory. Look for entries like listed below. If no triples listed, then there is no difference between n3 data provided by this PR and translations from property files. If triples are found, then this PR has not the same data as loaded from property files.
    2022-11-25 17:19:59,091 DEBUG [TranslationConverter] Remove from model
    2022-11-25 17:19:59,092 DEBUG [TranslationConverter] Add to model

results.txt

@chenejac chenejac marked this pull request as ready for review November 25, 2022 19:25
@chenejac chenejac marked this pull request as draft November 25, 2022 19:26
@chenejac chenejac force-pushed the movingUILabelsTranslationsIntoVitro branch from 455d3de to 71426f0 Compare November 28, 2022 07:39
@chenejac chenejac force-pushed the movingUILabelsTranslationsIntoVitro branch from 71426f0 to 7340b7f Compare November 28, 2022 07:44
@chenejac chenejac marked this pull request as ready for review November 29, 2022 12:47
@litvinovg
Copy link
Contributor

Copy link
Contributor

@litvinovg litvinovg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

Copy link
Contributor

@litvinovg litvinovg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From vivo review, I suggest rename UiLabelsVocabulary.nt into UiLabelsVocabulary.ttl
to avoid
2022-11-29 15:07:49,027 ERROR [UpdateKnowledgeBase] Unable to load RDF from UiLabelsVocabulary.nt
org.apache.jena.riot.RiotException: [line: 1, col: 7 ] Element or attribute do not match QName production: QName::=(NCName':')?NCName.
at org.apache.jena.riot.system.ErrorHandlerFactory$ErrorHandlerStd.fatal(ErrorHandlerFactory.java:153)

@litvinovg
Copy link
Contributor

Log in the report below related to this bad translation

2022-11-29 15:06:33,308 DEBUG [TranslationConverter] Add to modelurn:uuid:cdc906b0-1905-4195-8597-6bcf570258fe http://www.w3.org/1999/02/22-rdf-syntax-ns#type http://www.w3.org/2002/07/owl#NamedIndividual .
urn:uuid:cdc906b0-1905-4195-8597-6bcf570258fe http://www.w3.org/1999/02/22-rdf-syntax-ns#type http://vivoweb.org/ontology/core/properties/vocabulary#PropertyKey .
urn:uuid:cdc906b0-1905-4195-8597-6bcf570258fe http://vivoweb.org/ontology/core/properties/vocabulary#hasApp "Vitro" .
urn:uuid:cdc906b0-1905-4195-8597-6bcf570258fe http://vivoweb.org/ontology/core/properties/vocabulary#hasKey "" .
urn:uuid:cdc906b0-1905-4195-8597-6bcf570258fe http://www.w3.org/2000/01/rdf-schema#label "who_can_edit_profile Quem pode editar o meu perfil"@pt-br .

@litvinovg litvinovg self-requested a review November 29, 2022 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants