long1eu / flutter_i18n

This plugin create a binding between your translations from .arb files and your Flutter app.
Apache License 2.0
251 stars 55 forks source link

String parsing crash with manual generator flutter_i18n/flutter_l10n/ #122

Open EArminjon opened 5 years ago

EArminjon commented 5 years ago

Hello,

I add flutter_l10n to my pubspec.yaml to allow my team with others IDE as AndroidStudio or Intelij to generate translation.

So I add this :

 l10n_generator:
    git:
      url: https://github.com/long1eu/flutter_i18n
      path: flutter_l10n/

My team can run the package with the following commande :

flutter packages pub run l10n_generator:main -o lib/generated

But their is a problem which wasn't present when we use flutter_i18n plugin directly on the IDE :

In my arb file I have string like : "appMessage": "The message... Blabla ...\n Blabla.",

When using generator manually, string parsing fail on the \n and I got this following string on generated/i18n.dart :

String get appMessage => "The message... Blabla...

Blabla.";

As you can see, the \n was interpreted and broke all the processus...

Can you fix it please :) ?

@noordawod

alizera commented 4 years ago

I have the same, I'm using Android Studio 3.5.3 on Windows and i18n.dart doesn't generate automatically (while my mac is OK). I've run AS by addministration privillage but have problem. And finally use manual generator and face the issue @EArminjon had mentioned.