unfoldingWord / gateway-edit

Book Package harmonized view.
https://gatewayedit.com
MIT License
1 stars 4 forks source link

Update scripture-resources-rcl in GWE for Greek highlight fix #570

Closed elsylambert closed 8 months ago

elsylambert commented 10 months ago

Need to update scripture-resources-rcl version to incorporate the fix for highlighting in GWE.

Message from Stepheh in Zulip:

I'd like to revisit the highlighting problems in tCC and GE whenever the Quote field in a TN includes a Greek word with an elision marks. This is causing serious difficulties for our proofreaders, which means it will cause the same difficulties for end users. For example, here's a section of the proofreading spreadsheet: image Every single one of these rows is a place where the highlighting is incorrect because tCC and GE are not recognizing the Greek words with elision marks. Here's an example of what it looks like in tCC: image (1) I've included every Greek word in the Quote field, but every word with an elision mark fails to highlight. How is the program recognizing words in the UGNT based on the Quote field? Is it stripping out punctuation when it looks for a matching string of characters? Fixing this issue will make the resources much more useable, so I appreciate any help.

elsylambert commented 10 months ago

This PR fixes the issue in scripture-resource-rcl https://github.com/unfoldingWord/scripture-resources-rcl/pull/180

birchamp commented 10 months ago

535 will need to be retested when this is complete. @elsylambert

kintsoogi commented 9 months ago

I updated to the most recent version of scripture-resources-rcl but it didn't seem to fix the problem. @abelpz I could use your help on this!

abelpz commented 9 months ago

@kintsoogi You may need to update that library in single-scripture-rcl too. @PhotoNomad0 may be able to point you in the right direction.

kintsoogi commented 9 months ago

Ohhhh that makes sense!

PhotoNomad0 commented 9 months ago

I updated to the most recent version of scripture-resources-rcl but it didn't seem to fix the problem. @abelpz I could use your help on this!

I can't get it to work either - so probably something more complicated going on.

PhotoNomad0 commented 9 months ago

@abelpz @kintsoogi - I seem to remember that the scripture-reasources-rcl had a refactor to remove the selection maps. So the changes will probably be more involved with GWE and single-scripture-rcl.

PhotoNomad0 commented 9 months ago

@kintsoogi I looks like the additional change you will need to make is in ScriptureCard. The new SelectionsContextProvider props are:

SelectionsContextProvider.propTypes = {
  /** words in a selection */
  selections: PropTypes.instanceOf(Map),
  /** action taken after a selection is made */
  onSelections: PropTypes.func.isRequired,
  /** the quote to be selected */
  quote: PropTypes.string.isRequired,
  /** all chapter-verses where quote may be found */
  bookObject: PropTypes.object,
  /** string chapter-verse reference. i.e. 1:5-6 */
  refString: PropTypes.string,
  /** if quote occurs mulitple times, this is the occurence of the one selected */
  occurrence: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
  /** action taken when quote is provided */
  onQuote: PropTypes.func,
};

Currently we are passing:

  return (
    <SelectionsContextProvider
      selections={selections}
      onSelections={newSelections => {
        // console.log('onSelections', newSelections)
      }}
      quote={selectedQuote?.quote}
      occurrence={fixOccurrence(selectedQuote?.occurrence)}
      verseObjectsMap={verseObjectsMap}
    >
PhotoNomad0 commented 9 months ago

Part of the challenge is that in the UGNT we are not actually using an elision character, but using the RIGHT SINGLE QUOTATION MARK (U+2019) . So where that would normally be treated as punctuation, we have to add special handling to include it as part of the word in the original language.

abelpz commented 9 months ago

Part of the challenge is that in the UGNT we are not actually using an elision character, but using the RIGHT SINGLE QUOTATION MARK (U+2019) . So where that would normally be treated as punctuation, we have to add special handling to include it as part of the word in the original language.

This is fixed with the latest version of scripture-resources-rcl and working in tc-create. I think you are right pointing to the change in the API for the selections component @PhotoNomad0, adapting to that should fix it. No need to do any special handling in gE or other library.

PhotoNomad0 commented 9 months ago

Part of the challenge is that in the UGNT we are not actually using an elision character, but using the RIGHT SINGLE QUOTATION MARK (U+2019) . So where that would normally be treated as punctuation, we have to add special handling to include it as part of the word in the original language.

This is fixed with the latest version of scripture-resources-rcl and working in tc-create. I think you are right pointing to the change in the API for the selections component @PhotoNomad0, adapting to that should fix it. No need to do any special handling in gE or other library.

Made progress with the update to the props for the selections context. At least now highlighting is working on most tNotes. But still this specific issue is not working even with the newer rcl. Double checking to see if I have missed one detail.

OK found the problem is in getQuoteMatchesInBookRef() which is stripping out the right quote character here

https://github.com/unfoldingWord/uw-quote-helpers/blob/main/src/helpers/quote.js#L244

PhotoNomad0 commented 9 months ago

@elsylambert @danielklapp The fix is in release v2.2.0 build 3179311 QA

elsylambert commented 9 months ago

v2.2.0 build 3179311 QA. Highlights for Greek elision marks and for occurrence number works fine #535.