PyCharm 4.0.0 Web Help

PyCharm provides a dedicated intention action to wrap strings in Django templates in {%trans%}, or {%blocktrans%} tags.

The lines with i18n tags are marked with py_i18n_icon icon in the gutter.

To wrap block of text in translation tags
  1. Open the desired Django template for editing, and select strings to be marked for translation.
  2. Press Alt+EnterAlt+EnterAlt+EnterAlt+EnterAlt+EnterAlt+EnterAlt+EnterAlt+Enter, Shift+Alt+J or Ctrl+Shift+MAlt EnterAlt Enter⌘ 1, or click the light bulb to reveal the list of available intention actions:

    py_wrapTransTag

  3. Select intention action Wrap with 'trans' tag, and press EnterEnterEnterEnterEnterEnterEnterEnterEnterEnterEnter. PyCharm wraps selected text in translation tags, and adds {% load i18n %}, if extracting text is performed for the first time.

See Also

Procedures:

External Links:

Web Resources: