CDN config with last updated timestamp for files

Hello,

Another idea from the discord here. In order to download the translations only when needed, I need to know when was the last update. For that a timestamps can be added for each file.

Like this on our side we can save the last timestamp and check if there is a recent one. If it is we download the file and update, if not we ignore.

{
  "fileID": {
    "file": "error.arb",
    "path": "",
    "library": "",
    "module": "",
    "buildType": "",
    "productFlavors": [ ],
    "locales": [
      {
        "language": "en",
        "region": "",
        "script": "",
        "lastUpdated": 1624001854,
        "isRtl": false,
        "name": "English",
        "localizedName": "English",
        "uri": ".../en/error.arb"
      },
      {
        "language": "es",
        "region": "MX",
        "lastUpdated": 1624011854,
        "script": "",
        "isRtl": false,
        "name": "Mexican Spanish",
        "localizedName": "Español De México",
        "uri": ".../es-MX/error.arb"
      }
    ]
  },

Any news on this ? I’m finishing my Flutter package that will allow users to download localazy translations on the fly. But in order to avoid downloading each time the translations we need a timestamps or a build version.

@vaclav Please take a look. This could help us not only to better integrate with Flutter but it’ll make the CDN much more usable for everyone.

We have just released a new version with support for this.

It’s not yet documented and we need to add it to CLI too, but for all newly published projects, a new meta file .../_e0.v2.json is generated with a bit different format and including timestamps.

The timestamps are in our internal format (based on our distributed collision-free IDs) but they are guaranteed to be ordered.

Works great! Thanks!

Hello,

I was just wondering, did you manage to get the plugin going? Would you be open to share it with the community? :slight_smile: