Skip to content

[Yaml] Automatic translation from Twig to YAML generates full path #708

@setlord

Description

@setlord

When I use "Create translation key" from a Twig template and select an existing YAML file (messages.es.yml for example), it creates the whole path to the key.

messages.es.yml before

acme:
  index:
    main:
      title: 'Administración'

then I write in a Twig template

{{ 'acme.index.main.description' | trans }}

The plugin shows 'missing translation' and offers me to 'create translation key', I accept that, select the messages.es.yml file and it creates the whole path:

acme:
  index:
    main:
      title: 'Administración'
acme:
  index:
    main:
      description: 'acme.index.main.description'

The expected behaviour (as before PHPStorm 2016.1) would be to create only the missing key:

acme:
  index:
    main:
      title: 'Administración'
      description: 'acme.index.main.description'

Sorry about my poor english.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions