@automattic/i18n-check-webpack-plugin 1.0.17 → 1.0.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/README.md +20 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [1.0.18] - 2022-08-23
|
|
9
|
+
### Added
|
|
10
|
+
- Add documentation of another problematic pattern (same string with different translator comments). [#25677]
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
- Updated package dependencies. [#25339, #25762]
|
|
14
|
+
|
|
8
15
|
## [1.0.17] - 2022-07-26
|
|
9
16
|
### Changed
|
|
10
17
|
- Updated package dependencies. [#25158]
|
|
@@ -90,6 +97,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
90
97
|
### Added
|
|
91
98
|
- Initial release.
|
|
92
99
|
|
|
100
|
+
[1.0.18]: https://github.com/Automattic/i18n-check-webpack-plugin/compare/v1.0.17...v1.0.18
|
|
93
101
|
[1.0.17]: https://github.com/Automattic/i18n-check-webpack-plugin/compare/v1.0.16...v1.0.17
|
|
94
102
|
[1.0.16]: https://github.com/Automattic/i18n-check-webpack-plugin/compare/v1.0.15...v1.0.16
|
|
95
103
|
[1.0.15]: https://github.com/Automattic/i18n-check-webpack-plugin/compare/v1.0.14...v1.0.15
|
package/README.md
CHANGED
|
@@ -148,6 +148,26 @@ if ( value === 'foo' ) {
|
|
|
148
148
|
}
|
|
149
149
|
```
|
|
150
150
|
|
|
151
|
+
This can also happen if you use different translator comments for the same string in multiple places, whether in the same file or different files.
|
|
152
|
+
```js
|
|
153
|
+
export const usedFunction = v => {
|
|
154
|
+
return sprintf(
|
|
155
|
+
/* translators: A thing */
|
|
156
|
+
__( 'Thing: %s', 'domain' ),
|
|
157
|
+
v
|
|
158
|
+
);
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
export const unusedFunction = v => {
|
|
162
|
+
return sprintf(
|
|
163
|
+
/* translators: A munged thing */
|
|
164
|
+
__( 'Thing: %s', 'domain' ),
|
|
165
|
+
munge( v )
|
|
166
|
+
);
|
|
167
|
+
};
|
|
168
|
+
```
|
|
169
|
+
In that case a good fix would be to use identical translator comments for all instances of the string. Or, if the comments need to be different, that's a good sign you should be using `_x()` with differing contexts too.
|
|
170
|
+
|
|
151
171
|
## Caveats
|
|
152
172
|
|
|
153
173
|
Certain situations cannot be detected by the plugin:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@automattic/i18n-check-webpack-plugin",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.18",
|
|
4
4
|
"description": "A Webpack plugin to check that WordPress i18n hasn't been mangled by Webpack optimizations.",
|
|
5
5
|
"homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/js-packages/i18n-check-webpack-plugin/#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"debug": "^4.3.2"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@babel/core": "7.18.
|
|
24
|
+
"@babel/core": "7.18.13",
|
|
25
25
|
"jest": "28.1.0",
|
|
26
26
|
"webpack": "5.72.1",
|
|
27
27
|
"webpack-cli": "4.9.1"
|