aissat / easy_localization

Easy and Fast internationalizing your Flutter Apps
https://pub.dev/packages/easy_localization
MIT License
906 stars 325 forks source link

Flutter Web Load both en.json and en-US.json #574

Open apoleo03 opened 1 year ago

apoleo03 commented 1 year ago

For some reason only when I deploy Flutter Web it tries to load both en.json and en-US.json (same problem for other languages)

The en-US.json, returns correctly, but the en.json returns the content of index.html and it triggers invalid JSON file.

Adding a copy of en-US.json as en.json, doesn't work, still, the index.html is returned.

The only solution that seems to work is to add a Rewrite:

      {
        "source": "/translations/en.json",
        "destination": "/translations/en-US.json"
      },
      {
        "source": "/assets/translations/en.json",
        "destination": "/assets/translations/en-US.json"
      },

( I don't know why but it appears both rewrites are needed, or maybe I am only tired? Careful with the cache)

bw-flagship commented 1 year ago

@apoleo03 This sounds very strange! Could you post a reproducable sample?