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

It should not be assumed that the Original Language resource is always first in ScriptureTable books array param. #174

Closed
abelpz opened this issue Aug 25, 2023 · 6 comments
Assignees

Comments

@abelpz
Copy link
Member

abelpz commented Aug 25, 2023

Summary

ScriptureTable has a param called books, this is being passed in to it by ParallelScripture component after processing an array of resource URLs, this array is supposed to contain URLs for: an Original Language (Source), translations aligned to the previous original language. The problem is the Original Language is assumed to always be first in that array and ScriptureTable renders each resource in the same order they are set in that resources array, so when users want to move the original languages to a different position, some features like highlighting break.

Critical places where hardcoded position is breaking highlighting:

https://github.com/unfoldingWord/scripture-resources-rcl/blob/138664f1a2ae8a9c784f5dad9742722f36a29685/src/components/parallel-scripture/ScriptureTable.js#L148C26-L148C29

https://github.com/unfoldingWord/scripture-resources-rcl/blob/138664f1a2ae8a9c784f5dad9742722f36a29685/src/components/parallel-scripture/helpers.js#L92C11-L92C22

The Zero (0) in both places refers to the position of the Original Language resource.

Motivation

  • ScriptureTable should allow the user to place the Original Language in any position preferred by him.
  • ScriptureTable should either infer what is position of the Original Language in that array, or the user should be able to tell it via a param.

DoD

Changing the order of the resources array sent to the ParallelScripture component should not break alignment.

@abelpz abelpz changed the title Original Text is assumed to always be first in array of resources in the ScriptureTable component. It should not be assumed that the original text is always first in ScriptureTable books array param. Aug 25, 2023
@abelpz abelpz changed the title It should not be assumed that the original text is always first in ScriptureTable books array param. It should not be assumed that the Original Language resource is always first in ScriptureTable books array param. Aug 25, 2023
@Joel-C-Johnson
Copy link
Collaborator

thanks for creating the issue with proper details. I will work on this.

@Joel-C-Johnson
Copy link
Collaborator

Joel-C-Johnson commented Aug 28, 2023

Solved the issue: unfoldingWord/tc-create-app#1600 (comment)

@Joel-C-Johnson
Copy link
Collaborator

@Joel-C-Johnson
Copy link
Collaborator

Test Instruction in RCL :

const ORIGINAL_LANG_POSITION = 1;
  • Change the array index of defaultResourceLinks as shown below
const defaultResourceLinks = [
   `unfoldingWord/${path.nt}/master/${bookId}`,
  `unfoldingWord/en/ult/master/${bookId}`,
  `https://git.door43.org/unfoldingWord/en_ust/src/branch/master`,
];
  • You can see the original language moved to the first position

Note: In defaultResourceLinks the value unfoldingWord/${path.nt}/master/${bookId} is the original (Greek / Hebrew) language, So if we move this link to a different index and also change the value of ORIGINAL_LANG_POSITION as the same index value.

@danielklapp
Copy link

Looks good to me. User can place the Original Language in any position they prefer in the array without breaking alignment. Tested with ScriptureResourcesRcl v5.5.5.

@Joel-C-Johnson
Copy link
Collaborator

Looks good to me. User can place the Original Language in any position they prefer in the array without breaking alignment. Tested with ScriptureResourcesRcl v5.5.5.

Moving to QA Done as it is already merged and closed.

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

No branches or pull requests

4 participants