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

feat: introduce matchSource match template variable #1220

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

miurahr
Copy link
Member

@miurahr miurahr commented Dec 17, 2024

split of #963

Pull request type

  • Feature enhancement -> [enhancement]

Which ticket is resolved?

RFE#1251

What does this PR change?

  • Change default fuzzy match pane template with matchSource
  • Add method MatchesVarExpansion#expandMatchSource
  • Extend NearString.MATCH_SOURCE to have TM_SUBSEG
  • Update test expectations of MatchesTextAreaTest, and FindMatchesTest
  • Add human-readable names of MATCH_SOURCE in Bundle.properties

Other information

This comment was marked as outdated.

- Change default fuzzy match pane template with matchSource
- Add method MatchesVarExpansion#expandMatchSource
- Extend NearString.MATCH_SOURCE to have TM_SUBSEG
- Update test expectations of MatchesTextAreaTest, and FindMatchesTest
- Add human-readable names of MATCH_SOURCE in Bundle.properties

Signed-off-by: Hiroshi Miura <[email protected]>
@miurahr miurahr force-pushed the topic/miurahr/introduce-match-source-match-template-variable branch from 821d6a9 to 53854ed Compare December 17, 2024 23:32
Copy link

❌ Quality checks failed.

Please look a Gradle Scan page for details:
https://gradle.com/s/xqvgpqtwhvm26

This comment was marked as resolved.

Signed-off-by: Hiroshi Miura <[email protected]>
Copy link

❌ Acceptance Tests failed.

Please look a Gradle Scan page for details:
https://gradle.com/s/bj5i5ehblv3xm

Copy link

❌ Quality checks failed.

Please look a Gradle Scan page for details:
https://gradle.com/s/h4ltp4n7ujf5c

src/org/omegat/Bundle.properties Outdated Show resolved Hide resolved
- Ignore NearString warnings

Signed-off-by: Hiroshi Miura <[email protected]>

This comment was marked as outdated.

@miurahr
Copy link
Member Author

miurahr commented Dec 19, 2024

The acceptance test error is

java.lang.AssertionError: [org.omegat.gui.matches.MatchesTextArea[name='matches_pane', text='1. Error while reading MT results	
Erreur lors de la lecture des résultats de TA	
<20/20/30%From Project>', enabled=true, visible=true, showing=true] - property:'text'] 	
Expecting actual:	
  "1. Error while reading MT results	
Erreur lors de la lecture des résultats de TA	
<20/20/30%From Project>"	
to match pattern:	
  "1. Error while reading MT results\nErreur lors de la lecture des résultats de TA\n<\d+/\d+/\d+%\s*>"

@miurahr
Copy link
Member Author

miurahr commented Dec 19, 2024

I have updated bundle keys and test expectation.
During process I merged the master branch.

@miurahr
Copy link
Member Author

miurahr commented Dec 22, 2024

I have updated bundle keys and test expectation. During process I merged the master branch.

With new changes, the part of "<50/50/60% >" will become like

  1. "<50/50/60% Project>"
  2. "<50/50/60% External TMX tm/penalty-010/segment.tmx>"
  3. "<50/50/60% Source files source/foo.po>"
  4. "<50/50/60% Sub-segmented match>"

@t-cordonnier @brandelune is the resulted change suitable for your assumption?

When #1226 is merged, No4 will become like "<50/50/60% Sub-segmented match tm/file1.tmx,tm/file2.tmx>"

@brandelune
Copy link
Contributor

brandelune commented Dec 22, 2024

I have updated bundle keys and test expectation. During process I merged the master branch.

With new changes, the part of "<50/50/60% >" will become like

  1. "<50/50/60% Project>"
  2. "<50/50/60% External TMX tm/penalty-010/segment.tmx>"
  3. "<50/50/60% Source files source/foo.po>"
  4. "<50/50/60% Sub-segmented match>"

@t-cordonnier @brandelune is the resulted change suitable for your assumption?

When #1226 is merged, No4 will become like "<50/50/60% Sub-segmented match tm/file1.tmx,tm/file2.tmx>"

Ok. So we should first modify the second item in that representation of the match pane this way:

<50/50/60% >

<50/50/60% Project>

Is that correct ?

In the case of orphan segments (we should not has a plural here, right @Kazephil), what will be the display ? Since orphan matches all come from the project file, there will be a double indication.

Regarding the various labels:

  1. "<50/50/60% Project>"

Ok for now.

  1. "<50/50/60% External TMX tm/penalty-010/segment.tmx>"

should be External TM: <path> since all bilingual files are accepted in the /tm folder, not exclusively TMX files.

  1. "<50/50/60% Source files source/foo.po>"

should be Source file: <path>

  1. "<50/50/60% Sub-segmented match>"

not easy to understand. What about

Reconstructed match, Merged match, etc.

@t-cordonnier, what do you think about all that?

@miurahr
Copy link
Member Author

miurahr commented Dec 22, 2024

Answer the question.

In the case of orphan segments (we should not has a plural here, right @Kazephil), what will be the display ? Since orphan matches all come from the project file, there will be a double indication.

Current master branch has been programmed to store localized of "Orphan segments" as a TMX name field.
The message is defined in the Bundle with the key "CT_ORPHAN_STRINGS".

see.

String fileName = project.isOrphaned(source) ? ORPHANED_FILE_NAME : null;

It may become fuzzy match pane to show

<50/50/60% Project Orphan segments>

This comment was marked as outdated.

This comment was marked as outdated.

@miurahr miurahr dismissed brandelune’s stale review December 25, 2024 22:21

Requested changes are done.

return localTemplate.replace(VAR_MATCH_SOURCE, OStrings.getString("MATCHES_VAR_EXPANSION_MATCH_COMES_FROM_MEMORY"));
case SUBSEGMENTS:
return localTemplate.replace(VAR_MATCH_SOURCE, OStrings.getString(
"MATCHES_VAR_EXPANSION_MATCH_COMES_FROM_TM_SUBSEG") + " ");
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"MATCHES_VAR_EXPANSION_MATCH_COMES_FROM_TM_SUBSEG") + " ");
"MATCHES_VAR_EXPANSION_MATCH_COMES_FROM_SUBSEGMENTS") + " ");

MATCHES_VAR_EXPANSION_MATCH_COMES_FROM_TM=External TM
MATCHES_VAR_EXPANSION_MATCH_COMES_FROM_FILES=Source Files
MATCHES_VAR_EXPANSION_MATCH_COMES_FROM_MEMORY=Project
MATCHES_VAR_EXPANSION_MATCH_COMES_FROM_TM_SUBSEG=Sub-segmented match
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
MATCHES_VAR_EXPANSION_MATCH_COMES_FROM_TM_SUBSEG=Sub-segmented match
MATCHES_VAR_EXPANSION_MATCH_COMES_FROM_SUBSEGMENTS=Sub-segmented match

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants