Skip to content

Commit 3ce4430

Browse files
author
MBriedis
committed
Merge remote-tracking branch 'upstream/4.x' into vuejs-utf8-fix
# Conflicts: # tests/AssetsTest.php
2 parents d54768c + 494237c commit 3ce4430

4 files changed

Lines changed: 23 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
77

88
Previous releases are documented in [github releases](https://github.com/oscarotero/Gettext/releases)
99

10+
## [4.8.1] - 2019-11-15
11+
### Fixed
12+
- Php error when scanning for a single domain but other string found [#238]
13+
1014
## [4.8.0] - 2019-11-04
1115
### Changed
1216
- Many `private` properties and methods were changed to `protected` in order to improve the extensibility [#231]
@@ -145,7 +149,9 @@ Previous releases are documented in [github releases](https://github.com/oscarot
145149
[#226]: https://github.com/oscarotero/Gettext/issues/226
146150
[#230]: https://github.com/oscarotero/Gettext/issues/230
147151
[#231]: https://github.com/oscarotero/Gettext/issues/231
152+
[#238]: https://github.com/oscarotero/Gettext/issues/238
148153

154+
[4.8.1]: https://github.com/oscarotero/Gettext/compare/v4.8.0...v4.8.1
149155
[4.8.0]: https://github.com/oscarotero/Gettext/compare/v4.7.0...v4.8.0
150156
[4.7.0]: https://github.com/oscarotero/Gettext/compare/v4.6.3...v4.7.0
151157
[4.6.3]: https://github.com/oscarotero/Gettext/compare/v4.6.2...v4.6.3

src/Utils/FunctionsScanner.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public function saveGettextFunctions($translations, array $options)
7070
continue;
7171
}
7272

73-
if (!$isDefaultDomain && !$domainTranslations) {
73+
if (!$domainTranslations) {
7474
continue;
7575
}
7676

tests/AssetsTest.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -548,6 +548,15 @@ public function testVueJs2MultipleDomainScanning()
548548
}
549549
}
550550

551+
public function testMissingDomainScanWithOtherStringsInFile()
552+
{
553+
$translations = (new Translations())->setDomain('unknown-domain');
554+
555+
PhpCode::fromFileMultiple(static::asset('phpcode6/input.php'), [$translations]);
556+
557+
self::assertCount(0, $translations);
558+
}
559+
551560
public function testVueJsUtf8Scanning()
552561
{
553562
$translations = new Translations();
@@ -592,6 +601,6 @@ public function testXliffUnitIds()
592601

593602
// Converting from an XLIFF that contains duplicate <source> elements
594603
// to a PO file will result in the loss of the duplicates.
595-
$this->runTestFormat('xliff/Po', $countTranslations-1, $countTranslated-1, $countHeaders);
604+
$this->runTestFormat('xliff/Po', $countTranslations - 1, $countTranslated - 1, $countHeaders);
596605
}
597606
}

tests/assets/phpcode6/input.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?php
2+
3+
pgettext('context', 'Text with context');
4+
_('No domain text');
5+
6+
dgettext('other', 'Other domain text');

0 commit comments

Comments
 (0)