flutter_i18n icon indicating copy to clipboard operation
flutter_i18n copied to clipboard

Not extracting Strings

Open dpedrinha opened this issue 4 years ago • 31 comments

Hi. Since latest updates the extract feature isn't updating the .arb files anymore. How to reproduce: Create new Flutter project. Alt+Enter a String -> extract. It doesn't change the .arb files.

Android Studio 3.5.1 Build #AI-191.8026.42.35.5900203, built on September 25, 2019 JRE: 1.8.0_202-release-1483-b03 amd64 JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o Windows 10 10.0

dpedrinha avatar Oct 04 '19 01:10 dpedrinha

Thanks @dpedrinha for reporting this. However, I still don't understand how to reproduce or what is the problem?

What version of the plugin are you using? Make sure you're using 1.1.4 (latest) as it fixes a couple of issues with previous versions.

noordawod avatar Oct 04 '19 10:10 noordawod

@noordawod Thank you for your response. I was using 1.1.2 which was released to fix my last complain about not generating the i18n.dart file (remember me now? :). Just got the new 1.1.4 update and the problem persists. The problem is that prior to the 1.1.1 update I could Alt + Enter on a string in my code, click "Extract the string resource" and it would be added to my .arb files automatically. It's not working anymore. When I click on "Extract the string resource", it shows the pop up asking about the .arb files to add the string to, but when I click OK, it closes and nothing happens. The .arb files are not updated. The string is not added to them.

And I it doesn't even work on a brand new Flutter project.

I can upload a test project here but I don't think it's necessary. You can create a new project and test it without changing a single line of code. Create a Flutter project, open /lib/screens/home_page.dart, ALT + Enter on any String and Extract. Check .arb file, it's empty when it should have the extracted string.

dpedrinha avatar Oct 04 '19 16:10 dpedrinha

Thanks for the detailed description! :+1:

Any chance you could upload a couple of screenshots showing this behavior?

noordawod avatar Oct 04 '19 16:10 noordawod

I'll see to it

dpedrinha avatar Oct 04 '19 16:10 dpedrinha

Perfect, now I understand what's going on! Are you sure this feature used to work in previous versions of the plugin? I believe you mentioned 1.0.6, is that correct? Can you please verify?

noordawod avatar Oct 04 '19 17:10 noordawod

I don't know how to verify this. If you can walk me through I'd gladly do it.

But I remember I updated the plugin to 1.1.1 and the i18n.dart wasn't being generated. Then it got fixed with 1.1.2 and this feature didn't work anymore (I don't know if this feature was working when on 1.1.1). I truly don't remember which version I was using before.

But this is a feature of this plugin...

dpedrinha avatar Oct 05 '19 01:10 dpedrinha

I am also facing this problem.

TheVinhLuong avatar Oct 05 '19 04:10 TheVinhLuong

Yea, me too. Alt+enter -> extract the string resource shortcut not working after the update. For now, I do insert manually by putting new string into .arb files. Hope this fix will land very soon. Anyway, thanks for this plugin 👍

samuelg123 avatar Oct 05 '19 12:10 samuelg123

I'm having the same problem.

A few weeks ago, I created all my .arb files (17), got them translated and the i18n.dart file successfully generated. All good.

Then yesterday I decided to include some new strings that I had to add to my app. Pressing alt-enter on the string and selecting 'Extract the string resource' brings up the arb file dialogue as expected. I select all my arb files (or just the en one) and select Ok. I get the message "Create string value resource 'no_internet_access'" on the status bar and the string in my code file changes to 'S.of(context).no_internet_access' but nothing else happens - no error message, no updated arb files and hence no new i18n.dart. Just a sad red line under my new variable name. Hope you have some idea of what the problem is....don't wanna go back to manual i18n. Your great plugin has spoilt me.

Versions: Win 10 Build 18999 (insiders skip ahead) Android Studio 3.5.1 Flutter_i18n plugin v1.1.4-191 (says version 192 is incompatible)

GrahamDi avatar Oct 10 '19 08:10 GrahamDi

Just realised I have the exact same issue.

Plugin version: 1.1.4-191 Environment: MacOS Catalina, Android Studio 3.5.1 (Stable channel)

When extracting strings they won't automatically be added to the .arb files. I have to do that manually.

PerLycke avatar Oct 10 '19 11:10 PerLycke

I have the same issue too. Everything is exactly as @dpedrinha described.

nikitattt avatar Oct 14 '19 11:10 nikitattt

Same for me

UPDATE: Last working version is 1.0.6

r0ck3r avatar Oct 17 '19 09:10 r0ck3r

Same here, any update on this?

sydneyagcaoili avatar Oct 22 '19 17:10 sydneyagcaoili

Been busy lately so not had time to look into this, sorry guys...

noordawod avatar Oct 22 '19 18:10 noordawod

No worries, it is worth waiting for. Also, really looking forward to it working in VSCode...my much preferred IDE (people call it an editor but it is way more). 👍

GrahamDi avatar Oct 22 '19 18:10 GrahamDi

Hi @noordawod , I am having the same issue (no strings added to .arb file even though the string is replaced with key in the .dart file)

I have tried with

  • plugin version Flutter_i18n-1.1.4-192 on IntelliJ Ultimate IntelliJ IDEA 2019.2.3 (Ultimate Edition) Build #IU-192.6817.14

  • plugin version Flutter_i18n-1.1.4-191 on *Android Studio 3.5.1 Build #AI-191.8026.42.35.5900203

Both have the same issue

TIA

sumeet-toptal avatar Oct 23 '19 06:10 sumeet-toptal

Problem still here :'(

EDIT : FIX

My ide was with multiple project, so i open only once and the plugin works well.

EArminjon avatar Nov 07 '19 05:11 EArminjon

DialogWrapper has a bug , submit a PR to fix

paul1992li avatar Nov 07 '19 07:11 paul1992li

Hi Noor, Is there a date when the PR will be approved and merged?

GrahamDi avatar Nov 15 '19 08:11 GrahamDi

Same for me

kirimi avatar Nov 15 '19 10:11 kirimi

Any updates?

Deishelon avatar Nov 18 '19 06:11 Deishelon

Compiled plugin with @paul1992li PR fix: https://github.com/xBioDreadx/flutter_i18n/releases Cant wait for owner release so made it myself...

192 - for idea 2019.2 191 - idea 2019.1 or Android Studio 3.5.2 and so on... Install manually in idea: image

xBioDreadx avatar Nov 20 '19 20:11 xBioDreadx

@paul1992li @xBioDreadx Thank you very much !! It works perfectly. I really appreciate it..

samuelg123 avatar Nov 21 '19 03:11 samuelg123

@xBioDreadx Thanks a lot. works well on IntelliJ 2019.2

sumeet-toptal avatar Nov 21 '19 05:11 sumeet-toptal

@xBioDreadx Works perfectly on Android Studio 3.5.2. Thanks very much for stepping up here...needed to be fixed.

GrahamDi avatar Nov 21 '19 07:11 GrahamDi

@xBioDreadx Thank you very much!

kirimi avatar Nov 21 '19 10:11 kirimi

@xBioDreadx, thank you!

r0ck3r avatar Nov 21 '19 12:11 r0ck3r

@paul1992li Sorry, forgot to thank you also for the original fix.

GrahamDi avatar Nov 21 '19 12:11 GrahamDi

@xBioDreadx Thank you very much. Works on Android Studio 3.5.2

donghua-wang avatar Dec 01 '19 03:12 donghua-wang