Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract translation into translation file #213

Closed
lazyants opened this issue Jan 15, 2014 · 6 comments
Closed

Extract translation into translation file #213

lazyants opened this issue Jan 15, 2014 · 6 comments
Labels

Comments

@lazyants
Copy link

Is there any way to add a functional for extracting selected translation from twig?
So f.e. I select some string and click on "extract translation". Then I have to enter a translation key and probably select/enter translation domain (if it couldn't be detected). After that translation will be added into translation file and in the twig template the selected string will be replaced with {{ 'translation_key'|trans }}

@Haehnchen
Copy link
Owner

iam also not happy with translation workflow. that can be much easier. your sounds like a good idea, its on todo list...

@lazyants
Copy link
Author

i think there will be a couple of things should be implemented step by step

  1. we have several formats for storing translations (probably yaml is a simplest one to start)
  2. locales could be a dropdown, where the default locale is preselected
  3. translation domain - it can be parsed from twig trans function, or from translation domain above, otherwise it standard message domain should be prefilled/preselected

by the way, an other problem could be, if there are several translation domains with the same name living in different bundles.
unfortunately it works already not properly - in this case the symfony plugin can't find the right file with translations

@Haehnchen
Copy link
Owner

possible ui from android studio translation key extraction

android_stuiod_translation

@Haehnchen
Copy link
Owner

so its ready and out...

@Haehnchen Haehnchen added fixed and removed todo labels May 19, 2014
@ByScripts
Copy link

Doesn't work for me.

1> I select the text "I am foobar"
2> I choose "Extract translation"
3> I enter the desired translation key "foobar"
4> I select the domain "messages"
5> I check the "create" checkbox for my bundle
6> I click OK

Then I get an Exception:

IncorrectOperationException: Must not change document outside command or undo-transparent action. See com.intellij.openapi.command.WriteCommandAction or com.intellij.openapi.command.CommandProcessor

Working on PhpStorm 8 EAP 138.256

@Haehnchen
Copy link
Owner

closing this for now. improvements pls in new issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants