chenejac / VIVOTestMigration

0 stars 0 forks source link

VIVO-1906: sprint-i18n: Use ParameterizedSparqlString where appropriate when language filters are injected into queries #1790

Closed chenejac closed 3 years ago

chenejac commented 4 years ago

Brian Lowe (Migrated from VIVO-1906) said:

To support i18n, queries used in the generation of editing forms now include language filters.  Instead of replacing strings like LANGUAGE with the desired language/locale code, a more robust solution is to include a normal variable name like ?language and bind the variable using ParameterizedSparqlString, e.g.:

ParameterizedSparqlString pQueryStr = new ParameterizedSparqlString(queryStr);

pQueryString.setLiteral("language", language);

 

chenejac commented 4 years ago

Andrew Woods said:

Pull-request: https://github.com/vivo-project/VIVO/pull/185

chenejac commented 4 years ago

Andrew Woods said:

Pending response to code review comments.

chenejac commented 4 years ago

Andrew Woods said:

Resolved with: https://github.com/vivo-project/VIVO/commit/f32dea3628d8a0d8570ad9edead4ac15fe349816

chenejac commented 3 years ago

Andrew Woods said:

We need to keep toString() on "locale". https://github.com/vivo-project/VIVO/pull/185/files/c3eb45be1cdd9e2962796e8744440a70ae745616#diff-980302343660eb12edae2d88b10d55a0R239

My comment was only referring to the toString() on "locale.getLanguage()": https://github.com/vivo-project/VIVO/pull/185/files/c3eb45be1cdd9e2962796e8744440a70ae745616#r479402551

chenejac commented 3 years ago

Andrew Woods said:

Follow-on bug fix: https://github.com/vivo-project/VIVO/pull/187

chenejac commented 3 years ago

Andrew Woods said:

Follow-on bugfix: https://github.com/vivo-project/VIVO/commit/e5c7485b93fcdfc7cfe1b9730e4d11ccb1348040