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

VIVO-1451 Capability Map i18n #67

Closed
wants to merge 9 commits into from

Conversation

KitioFofack
Copy link
Collaborator

@KitioFofack KitioFofack commented May 2, 2018

This PR makes the Capability Map fully internationalized.


JIRA Issue: https://jira.duraspace.org/browse/VIVO-1451

What does this pull request do?

After integrating this PR, one will be able to display the feature in different languages and then run the feature in the current language selected.

What's new?

Text from template are replaced by reference to values in language properties files.
Text in Javascrpt are replace by variables containing values from language properties files.
The SPARQL queries are language aware and retrieve only the data having the proper language tag

How should this be tested?

This new feature should be tested using a multilingual sample dataset, here are the steps:

1- Build VIVO languages updated on this PR: vivo-project/VIVO-languages#9
2- Build VIVO and enable fr-ca in runtime.properties
3-import sample data n3 dataset in VIVO (The corresponding PR creates transaltions for fr-CA: vivo-project/VIVO-languages#9)
4-Select English Language and run search then Search and expand
5-Only English terms should appear among research areas and on the resulting graph
4-Select another language (fr-ca)
6-You should be redirected on the capability map context but cleared
7-All the interface should appear in the selected language
8-Search then "search and expand"
9-Research areas in the search bar and result apprearing should all be in fr-CA

Additional Notes:

This PR is comming along with PRs on VIVO-languages(vivo-project/VIVO-languages#9) and;
VIVO-sampledata (vivo-project/sample-data#2) and require them.

Interested parties

@awoods @gneissone

@gneissone
Copy link
Member

Glad to see these hard coded language strings teased out.

The way VIVO is distributed now vivo-languages is not included by default and english i18n strings are used from the VIVO project itself. Not sure if that's the way it should be... but this pull request reverses that which I think is outside the scope of the ticket and PR.

Side note, are you using an IDE that is applying styling to the code automatically? All the white space, indentation, and line break changes make evaluating the actual changes a lot more difficult. It would be a lot easier to review if all the styling changes were reversed.

@KitioFofack
Copy link
Collaborator Author

KitioFofack commented May 2, 2018 via email

@gneissone
Copy link
Member

I believe this is the correct approach and it is very much needed. Switching from hard-coded english terms to i18n tags is a no-brainer, we definitely should merge those changes. I'm just not sure if changing the inclusion of the vivo-languages dependencies from opt-in to opt-out is appropriate for this Jira issue and pull request. I'm referring to the removal of the comment lines here, here, etc.

@KitioFofack
Copy link
Collaborator Author

KitioFofack commented May 2, 2018 via email

@gneissone
Copy link
Member

With Kitio's help I was finally able to build with multilanguage support. In summary, clone vivo-languages repo w/ Kitio's PR, mvn install from inside vivo-lanauges. Add to runtime.properties RDFService.languageFilter = true and languages.selectableLocales = en_US, es, fr_CA. Added sample data with fr_CA tags. I can select languages, yay!

Issues I see on first glance:

  1. Text on red 'reset' button is missing on initial load
  2. Capability map does not support concepts with no language tag. Problematic because concepts added through the UI are not added with language tags.

@KitioFofack
Copy link
Collaborator Author

@gneissone I fixed the issue on Reset button.
The second point I guess is an issue on concept entering but not Capability map since I has been decided that "All labels must have appropriate language tag".
I created this JIRA issue just to make sure that we do not forget: https://jira.duraspace.org/browse/VIVO-1499

@gneissone
Copy link
Member

I agree that all labels should have a language tag, but I disagree that the capability map should ignore those that don't. Concepts in OpenVIVO don't have language tags. If we upgraded OpenVIVO following the current upgrade procedure the Capability Map would return zero results. The perception will be that upgrading breaks the Capability Map.

I checked some concepts at Scholars@Duke, CU Experts, and Connect UNAVCO and none of the sites have language tags on their concept labels. One of the following three should happen:

  • Capability map should support concepts with no language tag
  • Upgrade listeners should add (English, by default) language tags to all concept labels during startup following upgrade to 1.10.0
  • Documentation should be updated to instruct users to manually add language tags to their concepts

@mconlon17
Copy link
Member

See https://wiki.duraspace.org/display/VIVODOC110x/Data+types+for+string+and+language recommendation 3. Applies to labels for concepts.

@gneissone
Copy link
Member

Lang tags should be used on all strings which might render differently in different languages. Use "United States"@en-us. For strings which are not rendered differently in different languages use a simple untyped string literal. For example "0000-0001-2345-321X"

What about a scientific concept like Drosophila melanogaster? Following recommendation 3 there should be no language tag and therefore it would never appear in the capability map.

@mconlon17
Copy link
Member

Agree, the capability map should render strings without language tags. But in your specific example, perhaps the language tag is latin. @LA (latin) or a language tag for binomial nomenclature if there is one.

@gneissone
Copy link
Member

Sure, you could add the latin tag. In reference to this pull request, that highlights another situation where the capability map should display a concept in a language other than the one currently selected by the user. In my opinion the capability map should include all concepts (as it currently does), even if there isn't a label in the current language.

  • If there is 1 label > display that label, regardless of language tag.
  • If there are multiple labels
    • display label tagged w/ selected language OR
    • display label with english tag OR
    • display label with no tag
    • display any label if tags are neither selected language nor english

I would say in that order of preference, but maybe no tag should have higher priority than the english tag. This conversation is relevant to the rest of the app, too. Right now, if a label isn't available in the selected language it picks the first one returned. So you get a mashup of many languages.

@mconlon17
Copy link
Member

I believe there are standards for internationalization that describe processing very similar to what you are describing. We should find them and align internationalization work with accepted best practices.

@j2blake
Copy link
Member

j2blake commented May 18, 2018

I'm coming late to this conversation, so forgive me if this is irrelevant, but...

It sounds like you might want to change the code to use a Language-Aware data model, such as a
edu.cornell.mannlib.vitro.webapp.rdfservice.filter.LanguageFilteringRDFService. @brianjlowe developed this to provide language awareness in VIVO, in the first place. The service (or an OntModel based on the service) accepts a list of one or more preferred languages. Query results are filtered to give preference to results with those language tags.

This should be accessible by a call like

ModelAccess.on(req).getRDFService(LANGUAGE_AWARE);

In other words, it might be possible (perhaps even easy), to allow the concept map code to delegate this issue to the RDFService.

Again, I apologize if this is not useful, or has already been considered.

@KitioFofack
Copy link
Collaborator Author

@j2blake your input is very usefull !
I'm going to use your input in the modification I will push soon.

@j2blake
Copy link
Member

j2blake commented May 18, 2018

Great. If I can answer any questions, let me know.

@gneissone
Copy link
Member

Reopening this pull request. In an effort to follow current best practices, the VIVO project will now be developed against the master branch. As a result of removing the develop branch, this pull request was automatically closed by GitHub, apologies for any confusion this may have caused.

@gneissone gneissone reopened this Feb 5, 2020
@gneissone gneissone changed the base branch from develop to master February 5, 2020 16:23
Base automatically changed from master to main January 20, 2021 17:28
@chenejac chenejac linked an issue Nov 1, 2021 that may be closed by this pull request
@chenejac
Copy link
Contributor

chenejac commented Nov 1, 2021

I believe this PR has been replaced with #84
Therefore, I believe we should consider closing this PR.

@gneissone
Copy link
Member

I believe this PR has been replaced with #84 Therefore, I believe we should consider closing this PR.

Also see https://jira.lyrasis.org/browse/VIVO-1892 / #179.

chenejac pushed a commit to chenejac/VIVO that referenced this pull request Sep 29, 2022
Move files from everytime to firsttime
@chenejac chenejac closed this Dec 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants