Skip to content

Commit 2513a3e

Browse files
committed
Adapt to v5.5.0
1 parent d20dd77 commit 2513a3e

File tree

3 files changed

+34
-2
lines changed

3 files changed

+34
-2
lines changed

CHANGELOG.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,17 @@
22

33
All notable changes to this project will be documented in this file.
44

5-
The format is based on [Keep a Changelog](http://keepachangelog.com/)
5+
The format is based on [Keep a Changelog](http://keepachangelog.com/)
66
and this project adheres to [Semantic Versioning](http://semver.org/).
77

8+
## [1.1.0] - Unreleased
9+
### Removed
10+
- Function `_` in the list of default functions to scan
11+
12+
### Fixed
13+
- Support for `gettext/gettext v5.5.0`
14+
815
## 1.0.0 - 2019-11-05
916
First version
17+
18+
[1.1.0]: https://github.com/php-gettext/JS-Scanner/compare/v1.0.0...HEAD

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
},
2020
"require": {
2121
"php": "^7.2",
22-
"gettext/gettext": "^5.0.0",
22+
"gettext/gettext": "dev-feature/functions-handlers-trait",
2323
"mck89/peast": "^1.9"
2424
},
2525
"require-dev": {

src/JsScanner.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,29 @@
1010
*/
1111
class JsScanner extends CodeScanner
1212
{
13+
use FunctionsHandlersTrait;
14+
15+
protected $functions = [
16+
'gettext' => 'gettext',
17+
'__' => 'gettext',
18+
'ngettext' => 'ngettext',
19+
'n__' => 'ngettext',
20+
'pgettext' => 'pgettext',
21+
'p__' => 'pgettext',
22+
'dgettext' => 'dgettext',
23+
'd__' => 'dgettext',
24+
'dngettext' => 'dngettext',
25+
'dn__' => 'dngettext',
26+
'dpgettext' => 'dpgettext',
27+
'dp__' => 'dpgettext',
28+
'npgettext' => 'npgettext',
29+
'np__' => 'npgettext',
30+
'dnpgettext' => 'dnpgettext',
31+
'dnp__' => 'dnpgettext',
32+
'noop' => 'gettext',
33+
'noop__' => 'gettext',
34+
];
35+
1336
public function getFunctionsScanner(): FunctionsScannerInterface
1437
{
1538
return new JsFunctionsScanner(array_keys($this->functions));

0 commit comments

Comments
 (0)