localizely / flutter-intl-intellij

This Android Studio & IntelliJ plugin generates boilerplate code for localization of Flutter apps with official Dart Intl library
MIT License
129 stars 4 forks source link

Intention ExtractStringKey is not writing to arb files. #74

Closed Schrall closed 2 years ago

Schrall commented 3 years ago

When i extract a String with ExtractStringKey to generate an ARB entry.

From: return 'Please enter some text'; to return S.of(context).pleaseEnterSomeText;

The translation is missing in all the selected Files:

{ "Login": "Login" }

Intellij 2021.2.2 (Ultimate) Flutter Intl 1.15.0-2019.2 macOS Big Sur 11.6

Read and Write Permission for Everybody on the whole Projekt.

Bildschirmfoto 2021-10-16 um 12 58 24 Bildschirmfoto 2021-10-16 um 12 57 39 Bildschirmfoto 2021-10-16 um 12 57 49
lzoran commented 3 years ago

Hi @Schrall,

Thanks for reporting this!

I've tried to reproduce this issue, but without success. 😕

I noticed that you are using the 1.15.0-2019.2 version of the Flutter Intl plugin, which is intended to work with older IDE versions (2019.2 - 2020.2.4). Could you try to upgrade the Flutter Intl plugin to the 1.15.0-2020.3 version and check if the reported issue still occurs?

lzoran commented 2 years ago

I'm closing this issue now. In case the same problem occurs after the plugin update, feel free to open it again.

KhanhPham0102 commented 2 years ago

Hi @lzoran, I still get this error in the new version.

Intellij 2021.3 (Ultimate) Flutter Intl 1.17.0-2020.3 Win 11 Home.

Does it need any additional settings to use?

lzoran commented 2 years ago

Hi @KhanhPham0102,

I've tested string key extraction with your settings on my machine, and it seems to work well. 😕

extact-string-key

A minimal reproducible example is welcome.

Does it need any additional settings to use?

No, you just need to have Flutter Intl plugin enabled for your Flutter project.

KhanhPham0102 commented 2 years ago

Hi @lzoran ,

This is the problem I recorded.

https://user-images.githubusercontent.com/35913261/148421338-1e799490-c567-4db6-8b40-b60e37b21806.mp4

It is not added to the .arb file so reloading the .arb file automatically is not done.

My config in pubspec.yaml :

image

lzoran commented 2 years ago

Hi @KhanhPham0102,

Thanks for provided materials!

I've tried again to reproduce this issue, but without success. Everything works well on my machine. 😞

I noticed few interesting things on your screen recording:

Not sure what might cause this issue. 😕 Maybe re-installing Flutter Intl plugin and IDE restart might help.

Also, does the same issue appears on other Flutter projects? Maybe you can try to reproduce this issue on this sample project.

w568w commented 2 years ago

Same to me on Android Studio Arctic Fox | 2020.3.1 Patch 4, Windows 11 & Flutter Intl 1.17.0-2020.3.

No arb file updated and no generation triggered. Tried on different OS (Ubuntu, Debian, Windows 10…) with clean installed IDE and the sample project, but no luck. 🤕

cubuspl42 commented 2 years ago

For me, "Extract to ARB" doesn't work even for the sample project.

cubuspl42 commented 2 years ago

@lzoran Inspired by your observation about the ARB files icons, I checked that out, and I also did't have any fancy icons on ARB files. I checked the File Types settings:

image

The ARB file type didn't have any file name pattern registered. Registering *.arb fixed the issue.

image