webpack-contrib / i18n-webpack-plugin

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

Nested support problem #33

Closed tanagumo closed 7 years ago

tanagumo commented 7 years ago

I want to use nested support option, but I don't have any good idea to hundle a case like below.

"foo": {"bar": "バー", "baz": "バズ"},
"Webpack is awesome. It's a great tool!!": "Webpackは素晴らしいツールです!"

Since nested option splits keys by dot, __('Webpack is awesome. It's a great tool!!') does not translate correctly.

Is there any good idea?

mightyaleksey commented 7 years ago

Looks like it will be better to move the path to the another argument, so it would look like:

__('foo', 'bar')

Looks like it was added here: https://github.com/webpack-contrib/i18n-webpack-plugin/pull/9