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

Implementing keyboard shortcut for toggling between edit and preview … #875

Merged
merged 1 commit into from
Feb 1, 2016

Conversation

jcouv
Copy link
Contributor

@jcouv jcouv commented Aug 15, 2015

…in editor.

I love that the Ctrl-S shortcut is working, but was frustrated about the lack of shortcut for going into preview mode and back to editing mode.
So I implemented it. I verified on my local deployment that it works.
I picked Ctrl-Enter, but feel free to pick whichever combination works best. The only caveat is that some combinations interfere with the browser (for instance, I was using Ctrl-E at first, which worked but also moved the caret into the URL bar).

Let me know if this is acceptable or if there is anything I can do.

Cheers,
Julien

@phillipadsmith
Copy link
Member

That is pretty handy, indeed.

@dereklieu Tests are passing. Functionality works as expected. Thoughts on the key combination and merging?

Phillip.

},
"shortcuts": {
"title": "Shortcuts",
"content": "<p>Press <code>Ctrl-S</code> to commit your changes. <br/> Press <code>Ctrl-Enter</code> to toggle between editing and previewing.</p>\n"
Copy link
Member

Choose a reason for hiding this comment

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

So these translations are generated from Transifex by running the gulp translations task, and as soon as we publish a new translation, say someone contributes a new language and we need to deploy it, then your text here would get wiped out.

@mikemorris am I right in thinking that if we went in and changed the english phrasing of this in Transifex, then all the other language translations would be out of sync? Not a huge deal for this but definitely seems to be a pain if for example we need to change bigger chunks of critical text?

Copy link
Contributor

Choose a reason for hiding this comment

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

Sort of, I think other translations would just bump down from 100% to 98% complete if we added a new English string in Transifex. Not sure how it would handle changing a source phrase - @tristen?

Copy link
Member

Choose a reason for hiding this comment

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

Sort of, I think other translations would just bump down from 100% to 98% complete if we added a new English string in Transifex.

Yep exactly.

Not sure how it would handle changing a source phrase

There's no specific handling. The new addition just needs to be account for in the application.

Copy link
Contributor

Choose a reason for hiding this comment

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

@tristen Will changing an English phrase in Transifex flag translations of that phrase as possibly outdated though?

Copy link
Member

Choose a reason for hiding this comment

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

Oh I see. I am 99% certain Transifex flags translations as outdated when the source file (en) is updated. It's been awhile since I've used it though.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dereklieu, sorry, I didn't realize those files were generated.
I can move that text to the proper location if that helps.

@dereklieu dereklieu mentioned this pull request Feb 1, 2016
@dereklieu dereklieu merged commit e014185 into prose:master Feb 1, 2016
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

Successfully merging this pull request may close these issues.

5 participants