Skip to content

Commit 92d6979

Browse files
committed
fixed noop extraction
1 parent 9998d58 commit 92d6979

4 files changed

Lines changed: 5 additions & 3 deletions

File tree

src/Extractors/JsCode.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ class JsCode extends Extractor implements ExtractorInterface
2626
'np__' => 'npgettext',
2727
'dnpgettext' => 'dnpgettext',
2828
'dnp__' => 'dnpgettext',
29-
'gettext_noop' => 'noop',
29+
'noop' => 'noop',
30+
'noop__' => 'noop',
3031
],
3132
];
3233

src/Utils/FunctionsScanner.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ public function saveGettextFunctions(Translations $translations, array $options)
3535
$domain = $context = $original = $plural = null;
3636

3737
switch ($functions[$name]) {
38+
case 'noop':
3839
case 'gettext':
3940
if (!isset($args[0])) {
4041
continue 2;

tests/assets/jscode/input.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ $(document).ready(function () {
99
// var value6 = __('Other commented function')
1010

1111
var resp = __("I can't get response.");
12-
resp += " " + __("Please, try with other interface type.");
12+
resp += " " + noop__("Please, try with other interface type.");
1313

1414
resp = '<div class="alert alert-danger">';
1515
resp += __("I can't get response. Please, try with other interface type.");

tests/assets/phpcode/input.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<div>
66
<p><?php __($var); ?></p>
77
<p><?php p__('context', 'text 1 with context'); ?></p>
8-
<p><?php __('text 2'); ?></p>
8+
<p><?php noop__('text 2'); ?></p>
99
<p><?php __('text 3 (with parenthesis)'); ?></p>
1010
<p><?php __('text 4 "with double quotes"'); ?></p>
1111
<p><?php __('text 5 \'with escaped single quotes\''); ?></p>

0 commit comments

Comments
 (0)