chenejac / VIVOTestMigrationJIRA

0 stars 0 forks source link

VIVO-1870: i18n - Inadequate "No Entry for that Letter" message when browsing alphabetically #1761

Closed chenejac closed 3 years ago

chenejac commented 4 years ago

Nicolas B Dickn (Migrated from VIVO-1870) said:

In

the variables

are declared with the values

extracted from

those variables are then used in :

to display a "no entry for that letter" message when browsing alphabetically in the sections "Persons", "Organizations"' "Research" and "Events":

if ( alpha != "all" ) { nothingToSeeHere = '<p class="no-individuals">' + browseByVClass.thereAreNo + ' ' + vclass.name + ' ' + browseByVClass.indNamesStartWith + ' <em>'+ alpha.toUpperCase() +'</em>.</p> <p class="no-individuals">' + browseByVClass.tryAnotherLetter + '</p>'; } else { nothingToSeeHere = '<p class="no-individuals">' + browseByVClass.thereAreNo + ' ' + vclass.name + ' ' + browseByVClass.indsInSystem + '</p> <p class="no-individuals">' + browseByVClass.selectAnotherClass + '</p>'; }

However, this was obviously coded with only the "Persons" section in mind, since indNamesStartWith has the value "individuals whose name starts with". Therefore, the concatenation results in weird sentences in all the other sections. For instance:

  • There are no Academic Department individuals whose name starts with K.
  • There are no Academic Article individuals whose name starts with K.
  • There are no Conference individuals whose name starts with K.

Additionally, this concatenation tends to creates grammar problems in non-English context, which makes it both a general and i18n issue.

Since there is redundancy between the labels (see screenshots), a possible solution would be to ditch the concatenated message altogether, and display a simple "No entry starting with letter x"

 

chenejac commented 4 years ago

Andrew Woods said:

Pull-requests:

chenejac commented 4 years ago

Andrew Woods said:

Resolved by:

chenejac commented 3 years ago

Andrew Woods said:

It appears that an additional update was missed in this PR:

+++ b/webapp/src/main/webapp/templates/freemarker/body/partials/menupage/menupage-scripts.ftl
@@ -33,8 +33,7 @@
-        thereAreNo: '${i18n().there_are_no?js_string}',
-        indNamesStartWith: '${i18n().individuals_names_starting_with?js_string}',
+        thereAreNoEntriesStartingWith: '${i18n().there_are_no_entries_starting_with?js_string}',
chenejac commented 3 years ago

Andrew Woods said:

Follow-on pull-request: https://github.com/vivo-project/Vitro/pull/183

Follow-on resolution: https://github.com/vivo-project/Vitro/commit/2863d1f094ce460a2f779d42a25a1e07ca77abeb