@wordpress/i18n 4.16.0 → 4.16.1-next.957ca95e4c.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/i18n",
3
- "version": "4.16.0",
3
+ "version": "4.16.1-next.957ca95e4c.0",
4
4
  "description": "WordPress internationalization (i18n) library.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -30,9 +30,8 @@
30
30
  },
31
31
  "dependencies": {
32
32
  "@babel/runtime": "^7.16.0",
33
- "@wordpress/hooks": "^3.16.0",
33
+ "@wordpress/hooks": "^3.16.1-next.957ca95e4c.0",
34
34
  "gettext-parser": "^1.3.1",
35
- "lodash": "^4.17.21",
36
35
  "memize": "^1.1.0",
37
36
  "sprintf-js": "^1.1.1",
38
37
  "tannin": "^1.2.0"
@@ -40,5 +39,5 @@
40
39
  "publishConfig": {
41
40
  "access": "public"
42
41
  },
43
- "gitHead": "171b87c7465b93e685e081c5f57f153507363c95"
42
+ "gitHead": "272a74bbbaab10ee24424eafe9578e705fbfbbb4"
44
43
  }
@@ -4,7 +4,6 @@
4
4
  * External dependencies
5
5
  */
6
6
  const gettextParser = require( 'gettext-parser' );
7
- const { isEmpty } = require( 'lodash' );
8
7
  const fs = require( 'fs' );
9
8
 
10
9
  const TAB = '\t';
@@ -47,8 +46,8 @@ function convertTranslationToPHP( translation, textdomain, context = '' ) {
47
46
  let original = translation.msgid;
48
47
  const comments = translation.comments;
49
48
 
50
- if ( ! isEmpty( comments ) ) {
51
- if ( ! isEmpty( comments.reference ) ) {
49
+ if ( Object.values( comments ).length ) {
50
+ if ( comments.reference ) {
52
51
  // All references are split by newlines, add a // Reference prefix to make them tidy.
53
52
  php +=
54
53
  TAB +
@@ -59,7 +58,7 @@ function convertTranslationToPHP( translation, textdomain, context = '' ) {
59
58
  NEWLINE;
60
59
  }
61
60
 
62
- if ( ! isEmpty( comments.translator ) ) {
61
+ if ( comments.translator ) {
63
62
  // All extracted comments are split by newlines, add a tab to line them up nicely.
64
63
  const translator = comments.translator
65
64
  .split( NEWLINE )
@@ -68,7 +67,7 @@ function convertTranslationToPHP( translation, textdomain, context = '' ) {
68
67
  php += TAB + `/* ${ translator } */${ NEWLINE }`;
69
68
  }
70
69
 
71
- if ( ! isEmpty( comments.extracted ) ) {
70
+ if ( comments.extracted ) {
72
71
  php +=
73
72
  TAB + `/* translators: ${ comments.extracted } */${ NEWLINE }`;
74
73
  }
@@ -77,8 +76,8 @@ function convertTranslationToPHP( translation, textdomain, context = '' ) {
77
76
  if ( '' !== original ) {
78
77
  original = escapeSingleQuotes( original );
79
78
 
80
- if ( isEmpty( translation.msgid_plural ) ) {
81
- if ( isEmpty( context ) ) {
79
+ if ( ! translation.msgid_plural ) {
80
+ if ( ! context ) {
82
81
  php += TAB + `__( '${ original }', '${ textdomain }' )`;
83
82
  } else {
84
83
  php +=
@@ -88,7 +87,7 @@ function convertTranslationToPHP( translation, textdomain, context = '' ) {
88
87
  } else {
89
88
  const plural = escapeSingleQuotes( translation.msgid_plural );
90
89
 
91
- if ( isEmpty( context ) ) {
90
+ if ( ! context ) {
92
91
  php +=
93
92
  TAB +
94
93
  `_n_noop( '${ original }', '${ plural }', '${ textdomain }' )`;