ilteoood / flutter_i18n

I18n made easy, for Flutter!
MIT License
217 stars 57 forks source link

Having both a translation key and object #214

Closed AlexBolot closed 10 months ago

AlexBolot commented 10 months ago

Hi,

I encountered a use-case that I can't seem to solve yet ! I receive some key-base content, that I need to translate. This is the keys format :

reporting.bus_stop.update
reporting.bus_stop.update.status
reporting.bus_stop.update.status.done

The issue is that it would require this JSON, which is of course invalid:

"reporting" : {
  "bus_stop" : "My title",
  "bus_stop" : {
    "update" : "Update title",
    "update" : {
      "status" : "Status title",
      ...
    }
  }
}

Any way I could make this work ? I've tries alternatives but with no success...

ilteoood commented 10 months ago

The data source should always be valid, you should move the title inside the object