vslavik / poedit

Translations editor for Mac, Windows and Unix
https://poedit.net
MIT License
1.76k stars 274 forks source link

Shortcut for compile in MO #526

Open vaites opened 5 years ago

vaites commented 5 years ago

There's no shorcut for this item, and if you disable the automatic compilation to MO can be very useful.

I'm using Poedit 2.2 on macOS 10.12.6.

c72578 commented 5 years ago

There is the possibility to use: File - Compile to MO... Did you mean, you would like to have a shortcut for this?

BTW, the name of the program is Poedit (not PoEdit)

vaites commented 5 years ago

I'm so sorry, just edited the comment to change the program name...

There's a compile in MO item in the menu, but I'm asking for a keyboard shortcut like save or export to HTML.

I would even add two shorcuts: one for compile in MO (as the menu item does) and another one to compile assuming the PO name and overwriting (as the autocompile does).

vslavik commented 5 years ago

and if you disable the automatic compilation to MO can be very useful.

Can you please elaborate? Is it actually needed by you, and if, for what workflow? I'm confused by this because on one hand you disabled automatic compilation, i.e. you don't need this to be done hassle-free and frequently, but on the other, you want a shortcut, so presumably you do want to use it frequently… This seems like a contradiction to me.

vaites commented 5 years ago

The 80% of the times I use Poedit don't need to compile it to PO. The framework used in many projects works without problem with MO files so they are compiled to PO only for production. So for this workflow, I disabled the automatic compilation. Then I have other projects (like many on WordPress) that needs the PO, so is here where I miss the shortcut.

Other option can be a flag to enable automatic compilation per project, using a custom header like others used y Poedit.

I know this can be a little used functionality, but a simple shortcut has a little cost too...

vslavik commented 5 years ago

The framework used in many projects works without problem with MO files so they are compiled to PO only for production.

This confused me before I realized you swapped "PO" and "MO". "MO" stands for "machine object", i.e. the compiled version.

Still: I do understand why you don't need MOs, but what I don't understand is why you feel the need to disable them — presumably Symfony can load MOs from the same location as well, so I don't see what's gained by disabling this option.

Other option can be a flag to enable automatic compilation per project, using a custom header like others used y Poedit.

This would even actually be more logical (especially given that some setups require the MO in a different location and differently named), yes.

but a simple shortcut has a little cost too…

That may be, but it has non-zero cost. More things that may break (cross-platform, stepping over something), it eats up a shortcut that might be better used by something else in the future (this happened multiple times already), it signals that this menu item is important and should be used (it has, after all, a shortcut of its own), while in reality it's not so. I'm vary because I've been burned by haphazardly added shortcuts in the past.

By the way: note that on a Mac, you can add your own shortcuts to applications in System Preferences → Keyboard → Shortcuts → App Shortcuts yourself.

vaites commented 5 years ago

Whoops, I swapped "PO" and "MO", you're right. Forgive me...

I disabled the automatic compilation for various completely subjective reasons:

I requested a shorcut not to just trigger the menu item, the requested feature is compile like automatic compilation, without prompting for path or overwrite. Maybe this requires another menu item...

Don't worry, if you prefer to do not add the shortcut and save it for the future, just close de issue, is not a critital feature.

vslavik commented 5 years ago

is not a critital feature.

That's rather obvious :) I'd like to keep this issue open even when I can't promise addressing it right away — it's now a nice overview of the (larger) issue and you raise some very valid points.

vaites commented 5 years ago

Thank you!