webpack-contrib / i18n-webpack-plugin

[DEPRECATED] Embed localization into your bundle
MIT License
317 stars 74 forks source link

i18n parameters #36

Open bmpc opened 7 years ago

bmpc commented 7 years ago

Does this plugin support parameters?

I have the following in en.json:

"a": {
   "b": {
        "header": "Add Bananas to Basket %s"
    }
}

and then on a react component, outside the render method:

var x = __("a.b.header", "B2");

This doesn't seem to work as the output is "a.b.header".

EcutDavid commented 7 years ago

@bmpc since this is impossible to tell the difference between

{
  "a.b.header":  "Add Bananas to Basket %s"
}

And

{
  "a": {
     "b": {
          "header": "Add Bananas to Basket %s"
      }
  }
}

Not going to implement it in near futurešŸ˜¢