poedit icon indicating copy to clipboard operation
poedit copied to clipboard

Shortcut for compile in MO

Open vaites opened this issue 5 years ago • 8 comments

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.

vaites avatar Nov 07 '18 09:11 vaites

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)

c72578 avatar Nov 07 '18 10:11 c72578

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).

vaites avatar Nov 07 '18 10:11 vaites

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.

vslavik avatar Dec 20 '18 16:12 vslavik

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...

vaites avatar Dec 20 '18 18:12 vaites

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.

vslavik avatar Dec 21 '18 08:12 vslavik

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

I disabled the automatic compilation for various completely subjective reasons:

  • Keep only text files on translations folder (some projects not even need the MO file)
  • Avoid compiled files on Git, like any other assets (minified frontend files, etc...)
  • I only request PO files to external translators
  • The MO file can be only compiled with build automation

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.

vaites avatar Dec 21 '18 09:12 vaites

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.

vslavik avatar Dec 21 '18 09:12 vslavik

Thank you!

vaites avatar Dec 21 '18 09:12 vaites