Closed mightyaleksey closed 7 years ago
Alright, straight out of the gate there are two issues blocking this from landing in it's current state.
As an organization, we are moving to a single standard way of doing things to simplify maintenance. Code style, Allowed Language Features, Test Frameworks ... the whole nine yards.
So before this can be considered conceptually and it will be considered
given the age of the related issue, there are two things that need to happen.
1.) webpack-contrib/i18n-webpack-plugin#41 needs to land which is the basis for everything above.
2.) This lib needs validations in place for the major version that is about to land before any major features are considered.
First blocking issue should land this weekend. The second, to completely honest, is going to get done whenever I have time to circle back to it. The webpack-contrib
org maintainers have more than a few fires to fight at the moment and upgrading this plugin was upgraded out of order to address a deprecation issue that requires a semver MAJOR
hence why the webpack-defaults
upgrade was done now.
Any assistance with getting a test suite in place would be greatly appreciated. As I said, the four of us are swamped getting standards in place for every loader & plugin in the organization. Optionally, I can leave this PR open and ping you when I get time to put a test suite in place though I can't honestly tell you when that is going to be at this point.
@d3viant0ne thank you for the reply.
I'll wait till you finish with the basics. Then, I guess, I can split the current pr and help you with tests, so we can discuss the new features after.
Fixes #6, #16
A small note. Looks like a babel-loader transforms all the templated literals into the binary expressions (string concatenation) before the plugin. So it's better to support both variants.
@sullenor - Basics are in master as of this afternoon & out on a beta dist-tag. Once I get the coverage up to something reasonable, we can start working on some of these long standing features.
Anything new about this PR?
@Telokis yeah, finally managed to make a smaller version in https://github.com/webpack-contrib/i18n-webpack-plugin/pull/58
Dynamic and Parametrized keys
Adds support of dynamic and parametrized keys (issue https://github.com/webpack-contrib/i18n-webpack-plugin/issues/1):
Syntax example:
Configuration example:
Unfortunately, only template literals supported in the current version. Binary expressions (like
a + ': ' + b
) won't work.Nested dictionaries
Since, it is not possible to localize properly keys with dots (with
nested
option). For example,won't be possible to localize with partialy flat object
since the sentence will be splitted by dots and it will be possible to localize the part of it only with
I decided to move the
path
part to the separated argument (optionkeyset
), so the resulting call will look like:and the configuration will be: