localizely / flutter-intl-vscode

This VS Code extension generates boilerplate code for localization of Flutter apps with official Dart Intl library
MIT License
87 stars 1 forks source link

How to extract a string from my code to .arb file #32

Closed bigbang489 closed 4 years ago

bigbang489 commented 4 years ago

In your document: "Extract string to ARB files using code actions. The dialog will ask you to enter the string key, which will be extracted to ARB files together with the selected content."

But I couldn't find the option in Source Actions... or Refactor...

aleksakrstic commented 4 years ago

Hi @bigbang489 Here is animated video that explains it better: https://twitter.com/localizely/status/1255175275454881793 However, thanks for the feedback, maybe we should put such animation in documentation page for the IDE extension.

corymalcolmtaylor commented 3 years ago

Is there a way to do that in vscode? The option does not appear for me in vscode (latest version).

lzoran commented 3 years ago

Hi @corymalcolmtaylor,

I've just tested it on my machine, and it works well 😕. Could you give us an example of what you are trying to extract?

Note, you need to select the whole string that you want to extract together with the quotes and then to trigger the "Extract to ARB" code action via lightbulb or Ctrl+.?

corymalcolmtaylor commented 3 years ago

Thanks that worked, I was not selecting the whole string and quotes, I was just putting the cursor in the string.

lzoran commented 3 years ago

Glad it works @corymalcolmtaylor!

It seems that there is a space for improvement. We will try to make this action more intuitive in the future.

apremalal commented 1 year ago

It doesn't appear in my vscode. I tried copying the whole string with quotes and it didn't work.

lzoran commented 1 year ago

Hi @apremalal,

I've tried to reproduce your issue on the VS Code 1.72.2, with Flutter 3.3.5, and Flutter Intl 1.18.2, but everything seems to work as expected.

vsc-flutter-intl-extract-to-arb

Not sure what might be the issue. 😕

Do you have enabled Flutter Intl extension for the project (Ctrl+Shift+P > Flutter Intl: Initialize)?

ayoubboumzebra commented 2 weeks ago

I am using VSCode and this trick works: Ctrl+Shift+P > Flutter Intl: Initialize