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

Allow splitting the current subtitle cell in the editor with a keyboard shortcut #1008

Closed
PCF-Testing opened this Issue Oct 29, 2013 · 9 comments

Comments

Projects
None yet
4 participants
@PCF-Testing
Member

PCF-Testing commented Oct 29, 2013

When a subtitle line has focus, a special key combination should split the line into two.

Ideas:
CTRL+SHIFT+| (vertical line)
Shift + C (suggested by client)
Cmd + T (GarageBand)
Cmd + B (Final Cut "blade")
ctrl+shift+v (Subtitle Workshop)

Text:

  • Lines should be split by the current position of the text cursor
  • If the text cursor is at the beginning of the line, all the text goes into the second new line
  • If the text cursor is at the end of the line, all the text goes into the first new line

Timing:

  • If the split line is untimed, both new lines should be untimed
  • If the split line is timed AND time cursor is at the start/end of the line or outside of it, the line should be split into two equal halves
  • If the line is timed AND time cursor is at the middle of the line, the line should be split by the current timestamp. Both new lines should have no less than 0.7 s.
  • If the line is open-ended (has the start time but not the end time) AND time cursor is outside of it, the first of the new lines should last 2 seconds, and the second one be open-ended.

Example:

<p begin="00:01:08.910000" end="00:01:12.600000" xml:id="subtitle42"> I would like to stick my nose in and get involved but that's that's just me,</p>
<p begin="00:01:12.600000" end="00:01:13.440000" xml:id="subtitle43"> or maybe that's daughters</p>
<p begin="00:01:14.130000" end="00:01:14.710000" xml:id="subtitle44"> talked and therefore</p>

Typing the split shortcut when the cursor is placed between in and would produce:

<p begin="00:01:08.910000" end="some time" xml:id="subtitle42"> I would like to stick my nose in</p>
<p begin="some time" end="00:01:12.600000" xml:id="subtitle43"> and get involved but that's that's just me,</p>
<p begin="00:01:12.600000" end="00:01:13.440000" xml:id="subtitle44"> or maybe that's daughters</p>
<p begin="00:01:14.130000" end="00:01:14.710000" xml:id="subtitle45"> talked and therefore</p>

We would not change the start time of the original line, and the added line would have the end time of the original line. The middle times would be calculated based on some logic."

@bendk

This comment has been minimized.

Member

bendk commented Mar 21, 2014

I think this one would be really cool. Especially in conjunction with #1336. That way you could split the line into 2, then adjust the times of both subtitles with one mouse motion.

Maybe we could make it less of a power user thing and more of a regular feature as well. Some ideas for that:

  • A second button next to the plus at the bottom of the subtitle
  • A second button somewhere else on the subtitle (maybe on the right side in the middle?)
  • Right click on the subtitle pops up a context menu and split subtitle is one option.
@jdragojevic

This comment has been minimized.

Contributor

jdragojevic commented Mar 21, 2014

I'd vote for a keyboard shortcut for power users.

I'm also +1 for a context menu, as I think there are a few things that would be good to do in the context of a subtitle, but we don't want to clutter the main workspace too much.

so maybe both.

@kslottow kslottow changed the title from New editor: Add key combination to split the current line to Allow splitting the current subtitle line Nov 29, 2017

@kslottow kslottow changed the title from Allow splitting the current subtitle line to Allow splitting the current subtitle cell in the editor Nov 29, 2017

@kslottow

This comment has been minimized.

Contributor

kslottow commented Nov 29, 2017

Current process:

Currently, a translator or transcriber can:
Pause-->put the cursor where you want to split the line-->hit shift+enter

However, if it's the second line in the subtitle that needs to split, you also have to:
Select and copy the extra words--> paste in next line or subtitle-->skip back 4/8 sec to replay-->adjust subtitle timing by dragging.

OR

Cmd-Shift-arrow down (to select remaining text),
Cmd-X (to cut), add … at the end of the line,
Cmd-Shift-I (to insert a new row below),
Enter (to move to the next line)
Cmd-V (to paste)

More context on these forum topics:
https://support.amara.org/support/discussions/topics/313472; https://support.amara.org/support/discussions/topics/28857/page/7?url_locale=;
https://support.amara.org/support/solutions/articles/192394-how-do-i-split-a-subtitle-into; https://support.amara.org/support/discussions/topics/28857/page/8?url_locale=

@kslottow

This comment has been minimized.

Contributor

kslottow commented Nov 29, 2017

  • video editing tools have several ways of splitting for different use cases. You split while playing the video by using a keyboard shortcut, or split while paused by holding down a key to select a "blade" or "razor" tool (B in Final Cut and C in Premiere) and then clicking at a point in the middle of a video clip. This is different from what we want to do because the Amara knows where they want to split based on the text; not based on the timing. We should find out if this is true all the time.
  • Garageband uses cmd+t for splitting
@bendk

This comment has been minimized.

Member

bendk commented Nov 29, 2017

I'm pretty sure the main use case is a subtitle that's too many chars, so it's going to be based on splitting the text. Seems like there should be quick ways to do the following:

  • Take a single subtitle, and split it into two subtitles, based on the position if the cursor inside a textbox.
    • I'm not sure how we should split the time out. Maybe just 50/50
  • Adjust the timings for both subtitles at once. There should be a way to adjust the end time of subtitle 1 and the start time of subtitle 2 without it being two different actions
    • Alternatively, maybe some sort of close the gap action, so I would adjust the end time of subtitle 1, then click somewhere, and subtitle 2's start time would be set to the end time of subtitle 1.

@kslottow kslottow modified the milestones: Sprint 27, Sprint 33 Feb 22, 2018

@kslottow kslottow changed the title from Allow splitting the current subtitle cell in the editor to Allow splitting the current subtitle cell in the editor with a keyboard shortcut Apr 4, 2018

@kslottow kslottow modified the milestones: Sprint 33, Sprint 36 Apr 4, 2018

@kslottow kslottow removed their assignment Apr 4, 2018

bendk added a commit that referenced this issue Apr 10, 2018

Implemented split subtitles (#1008)
- Added model code to handle splitting the subtitles
- Added directive code to calculate what text should be based on the textarea and cursor position
- Added controller code to glue it all together
- Reworked the DomUtil selection code a bit.  I think we can assume that
  browsers support setSelectionRange() at this point
@PCF-Testing

This comment has been minimized.

Member

PCF-Testing commented Apr 13, 2018

Splitting works well for me. However, the shortcut has not been added to the list of available shortcuts in the editor (Keyboard controls -> more commands>>>).

One potential problem with the new feature I see is that SHIFT+ENTER (new line) and CTRL+ENTER (split subtitle) are on most keyboards very close to each other, so users are bound to make mistakes often, splitting subtitles instead of just inserting a line break. Splitting a subtitle is pretty hard to correct if you don't have the merge command, which is a natural undo for splitting. So I think it would be best to implement both splitting and merging on the same branch and release both together.

@bendk

This comment has been minimized.

Member

bendk commented Apr 13, 2018

I disagree that users are particularly likely to make a mistake. I don't think that happens with other ctrl combinations that often, like typing "Shift-C" instead of Ctrl-C. Still, I agree that it would make sense to deploy merging and splitting together in one release.

One thing we could do is just comment out the code for now so the functionality is there, but it's just not enabled. I guess it depends on how urgent this is for on-demand and our partners.

@kslottow tell me what you think

@bendk

This comment has been minimized.

Member

bendk commented Apr 17, 2018

Talked with kenzie and she says we should try to get this one out quickly. So I'm going to make a PR for it.

bendk added a commit that referenced this issue Apr 17, 2018

asabine added a commit that referenced this issue Apr 17, 2018

@PCF-Testing

This comment has been minimized.

Member

PCF-Testing commented Apr 25, 2018

Deployed.

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