easy_localization icon indicating copy to clipboard operation
easy_localization copied to clipboard

Why are these files being created in the Android APK?

Open tim-eucalyptus opened this issue 3 years ago • 3 comments

Our real localization files are in assets/locale and we have 8 of them. However there are 4 other json files that are not in our source folder ANYWHERE. How can they be getting in the final APK? Any ideas? Is it coming from some 3rd party library perhaps?

From APK explorer:

Screen Shot 2022-12-09 at 4 23 21 PM
  • en.json
  • en-US.json
  • ar.json
  • ar-DZ.json
{
  "test": "test",
  "day": {
    "zero": "{} days",
    "one": "{} day",
    "two": "{} days",
    "few": "{} few days",
    "many": "{} many days",
    "other": "{} other days"
  },
  "hat": {
    "zero": "no hats",
    "one": "one hat",
    "two": "two hats",
    "few": "few hats",
    "many": "many hats",
    "other": "other hats"
  },
  "hat_other": {
    "other": "other hats"
  }
}

tim-eucalyptus avatar Dec 09 '22 15:12 tim-eucalyptus

They are part of easy_localization's code for some reason:

https://github.com/aissat/easy_localization/tree/develop/i18n

dJani97 avatar Jan 26 '23 14:01 dJani97

Good find! and referenced here: https://github.com/aissat/easy_localization/blob/develop/pubspec.yaml

and that's why they get packaged. I propose removing this from that file:

flutter:
  assets:
    - i18n/

Why would that be needed?

tim-eucalyptus avatar Jan 26 '23 17:01 tim-eucalyptus

I did an experiment and the files are needed for easy_localization_widget_test.dart apparently. Too bad they are packaged in the final distributed build.

tim-eucalyptus avatar Jan 29 '23 10:01 tim-eucalyptus