Main menu

Using the translation editor in Loco Translate

The visual editor in Loco Translate lets you edit translation files directly in WordPress admin and save them to the correct file formats for WordPress to use.

The editor can edit PO and POT files. The difference being that POT files are templates containing only English source strings. PO files contain the actual translations. These are what you'll be editing most of the time.

Translate mode

The editor is split into several panes. The top half is a list of all the English strings you can translate. Bold, blue items are untranslated; Brown items are Fuzzy. You can use the arrow keys to move up and down the list. The currently highlighted item is editable in the panes below.

With an item selected you will see the English "Source text" in the panel below the list. This is the text that the author wants translating. It may have other information in smaller text. Enter your translation in the bottom pane.

You'll notice that you can't edit the source text. This is deliberate, because changing the source text would stop your translations from working.

Template mode

The editor layout is slightly different when editing POT (template) files. Instead of the bottom pane being for a translation, it is where you enter "Context". This is used in combination with the source text to make strings unambiguous.

Editing a template manually should be avoided unless you're the author of the theme or plugin being translated. (See working with templates). As of v2.3.4 you will be warned when editing a template, because people sometimes do this by mistake. Developers can disable the warning in the plugin settings.

The editor toolbar

  • Save
    You'll notice as you make changes that items you've translated show a :star icon:. This means your changes are unsaved. You can keep making edits, but we recommend you save your work regularly.

    As soon as you click "Save" Loco Translate will commit a new PO file to your server's disk and also compile a new MO file. It's the MO file that WordPress will load to display your translations. Saving files requires permission to write to your server's disk. See our guide to file system access if you have any problems with this.

  • Revert
    This button simply refreshes the page. You will be warned if you've made unsaved changes since the page was last loaded.

  • Sync
    The button with the :sync icon: updates your translations from the available source strings. If any have changed since you last saved your file, you will see new ones added and any obsolete ones will be deleted.

    Syncing doesn't save any changes until you click Save, so it's safe to try it out and see what it does. Just reload the page or click the :Revert icon: to go back to the saved state.

  • Auto (since v.2.4)
    The button with the :robot icon: opens a window for automatically translating the entire PO file. You will be given a choice of which translation provider to use and nothing will be saved to disk until you save the changes. The option to automatically mark translations as Fuzzy is a good way to keep track of which ones may need human review. See the page on [third party translation providers][providers] for more about automatic translation.

    Note that this option is disabled when you have unsaved work in the editor. This is to avoid you having your own translations overwritten by automatic ones. Just click Save before using this function.

  • Toggle invisibles
    The :pilcrow icon: shows and hides invisible (white space) characters in the text fields. This is useful for seeing where you have too many spaces, or where your spaces don't match the source text.

  • Toggle code view
    The :code icon: enables and disables "code view". This doesn't mean you're editing PHP code, but it makes editing HTML or other advanced string formatting easier to read and edit.

    As of v2.4: enabling the code view also displays clickable file references above the source text window. Clicking a file reference attempts to find the lines of PHP code where the string is used.

  • Download buttons
    If you're unable to save your file due to permission problems, you can download the current state of the file in PO, MO or POT format depending on what you're editing. Your changes will still be "unsaved" as far as the editor is concerned, but your translations should be safe instead the downloaded file. You (or your web developers) can then upload these files to your server some other way.

Translation window

When a translation is selected for editing in the bottom window, you will see further buttons which act on the selected string.

  • Toggle Fuzzy
    The button with the :cloud icon: toggles the Fuzzy state of a completed translation. The same function can be performed by pressing Ctrl-U on your keyboard. Fuzzy strings are those that may be incorrect and are waiting for a translator to review them. They may not appear on your website's front end depending on your compilation settings.

  • Suggest button (since v2.4) Clicking the :robot icon: opens a window with suggestions from any automatic translation providers you've configured. You can press Ctrl-J on your keyboard for faster access. Be warned that clicking this button may immediately result in charges from your translation provider.

    Tip: You can hit (Enter) to use the first automatic suggestion, or press a number key 1 to 9 if you have multiple APIs configured.

Keyboard controls

The following keyboard controls are supported by the editor:

  • Ctrl ↵ Done and Next
  • Ctrl ↓ Next message
  • Ctrl ↑ Previous message
  • ⇧ Ctrl ↓ Next untranslated
  • ⇧ Ctrl ↑ Previous untranslated
  • Ctrl B Copy from source text
  • Ctrl K Clear translation
  • Ctrl U Toggle Fuzzy
  • Ctrl J Suggest translation (since v2.4)

On a Mac? You can use ⌘ Cmd instead of Ctrl.