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-1925] i18n: Editing labels results in new label #188

Merged
merged 4 commits into from
Oct 1, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -304,9 +304,14 @@ public void addLiteralToForm(EditConfigurationVTwo editConfig, FieldVTwo field,
String rangeLang = field.getRangeLang(); //UQAM Default value
try {
if (_vreq != null ) {
// only if the request comes from the rdfsLabelGenerator the language should be used
Boolean get_label_language = false;
if (!StringUtils.isBlank(editConfig.formUrl) && editConfig.formUrl.contains("RDFSLabelGenerator")) {
get_label_language = true;
dofeldsc marked this conversation as resolved.
Show resolved Hide resolved
}
// if the language is set in the given Literal, this language-tag should be used and remain the same
// for example when you edit an label with an langauge-tag (no matter which language is selected globally)
if (!StringUtils.isBlank(editConfig.getLiteralsInScope().get("label").get(0).getLanguage()))
if (!StringUtils.isBlank(editConfig.getLiteralsInScope().get("label").get(0).getLanguage()) && get_label_language)
{
rangeLang = editConfig.getLiteralsInScope().get("label").get(0).getLanguage();
} else { // if the literal has no langauge-tag, use the language which is globally selected
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -312,9 +312,14 @@ protected AdditionsAndRetractions parseN3ToChange(
String lingCxt=null;
//UQAM Taking into account the linguistic context in retract
try {
// only if the request comes from the rdfsLabelGenerator the language should be used
Boolean get_label_language = false;
dofeldsc marked this conversation as resolved.
Show resolved Hide resolved
if (!StringUtils.isBlank(editConfig.formUrl) && editConfig.formUrl.contains("RDFSLabelGenerator")) {
get_label_language = true;
}
// if the language is set in the given Literal, this language-tag should be used and remain the same
// for example when you edit an label with an langauge-tag (no matter which language is selected globally)
if (editConfig != null && !StringUtils.isBlank(editConfig.getLiteralsInScope().get("label").get(0).getLanguage())) {
if (editConfig != null && !StringUtils.isBlank(editConfig.getLiteralsInScope().get("label").get(0).getLanguage()) && get_label_language) {
lingCxt = editConfig.getLiteralsInScope().get("label").get(0).getLanguage();
} else { // if the literal has no langauge-tag, use the language which is globally selected
lingCxt = vreq.getLocale().getLanguage();
Expand Down