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

Multi-line sentence translation #428

Closed
bwkimmel opened this issue May 20, 2024 · 3 comments
Closed

Multi-line sentence translation #428

bwkimmel opened this issue May 20, 2024 · 3 comments

Comments

@bwkimmel
Copy link
Contributor

bwkimmel commented May 20, 2024

Is your feature request related to a problem? Please describe.

Sentence translation only translates the current line of text, even if the sentence spans multiple lines.

Describe the solution you'd like

Some texts may consistently include punctuation (periods), while others may not. Perhaps there could be a per-book setting (with a configurable default -- perhaps in the language settings?) to indicate what characters are considered sentence delimiters (and, in particular, whether newlines are considered sentence delimiters).

Alternatively, or in addition, perhaps there could be a separate option to pass all of the highlighted text (which may span multiple lines) to the configured sentence translation page.

Describe alternatives you've considered

Alternatives include:

Additional context

In the screenshot below, I have a word within a 2-line sentence selected. When I hit 't', only the line containing the highlighted word is passed to the translation page. I would like for both lines to be passed. This particular text consistently has periods to delimit sentences.

image
@bwkimmel
Copy link
Contributor Author

Actually, a better solution, rather than a per-book import option, might be just to have separate hotkeys for "translate line" and "translate sentence". The former would work the same way it works currently. The latter would scan forwards and backwards for the previous and next sentence delimiter and translate everything in between. Sentence delimiters could be configurable per-language.

@jzohrab
Copy link
Collaborator

jzohrab commented May 28, 2024

Thanks @bwkimmel .

The challenge here is that Lute thinks that sentences that break across lines are separate things. Parsing gets pretty tough with various scenarios, song lyrics, etc. Lute thinks these are two sentences, even though that's obviously not the case:

I have
a fast car.

I usually remove all of the unwanted newlines from simple imports ... but that gets messy. Sometimes I just live with it.

Sentence delimiters are configurable per language already :-) in the settings > language > forms.

@jzohrab
Copy link
Collaborator

jzohrab commented Sep 13, 2024

I don't think I can implement anything for this ... but Lute does have a "translate page" option in the sidebar that really gives you what you need, without me implementing another feature (which could get tricky!)

image

Given the above, I'll close this. Cheers and thank you, LMK if you have a different idea.

@jzohrab jzohrab closed this as completed Sep 13, 2024
@github-project-automation github-project-automation bot moved this to Done in Lute-v3 Sep 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

2 participants